diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c525e12a69d..54f8a64ece9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,5 +1,6 @@ { "packages/gapic-node-templating": "0.0.0", + "packages/google-ai-generativelanguage": "1.0.1", "packages/google-analytics-admin": "6.0.0", "packages/google-analytics-data": "4.0.1", "packages/google-api-apikeys": "1.0.1", @@ -9,11 +10,14 @@ "packages/google-appengine": "3.0.1", "packages/google-area120-tables": "3.0.1", "packages/google-cloud-accessapproval": "3.0.1", + "packages/google-cloud-advisorynotifications": "1.0.1", "packages/google-cloud-aiplatform": "3.2.0", + "packages/google-cloud-alloydb": "1.0.1", "packages/google-cloud-apigateway": "3.0.1", "packages/google-cloud-apigeeconnect": "3.0.1", "packages/google-cloud-asset": "5.0.2", "packages/google-cloud-assuredworkloads": "4.0.1", + "packages/google-cloud-automl": "4.0.0", "packages/google-cloud-baremetalsolution": "1.1.1", "packages/google-cloud-batch": "1.2.0", "packages/google-cloud-beyondcorp-appconnections": "1.0.1", @@ -33,7 +37,10 @@ "packages/google-cloud-certificatemanager": "1.0.1", "packages/google-cloud-channel": "3.1.0", "packages/google-cloud-clouddms": "3.1.0", + "packages/google-cloud-commerce-consumer-procurement": "0.1.1", "packages/google-cloud-compute": "4.0.1", + "packages/google-cloud-confidentialcomputing": "1.1.0", + "packages/google-cloud-config": "0.1.0", "packages/google-cloud-contactcenterinsights": "3.0.1", "packages/google-cloud-contentwarehouse": "1.1.0", "packages/google-cloud-datacatalog": "4.0.1", @@ -65,13 +72,16 @@ "packages/google-cloud-ids": "3.0.1", "packages/google-cloud-iot": "4.0.1", "packages/google-cloud-kms": "4.0.1", + "packages/google-cloud-kms-inventory": "1.0.1", "packages/google-cloud-language": "6.1.0", "packages/google-cloud-lifesciences": "3.0.1", "packages/google-cloud-managedidentities": "3.0.1", "packages/google-cloud-mediatranslation": "4.0.1", "packages/google-cloud-memcache": "3.0.1", "packages/google-cloud-metastore": "4.0.1", + "packages/google-cloud-migrationcenter": "1.0.1", "packages/google-cloud-monitoring": "4.0.0", + "packages/google-cloud-netapp": "0.1.0", "packages/google-cloud-networkconnectivity": "3.0.1", "packages/google-cloud-networkmanagement": "3.1.0", "packages/google-cloud-networksecurity": "2.0.1", @@ -83,7 +93,9 @@ "packages/google-cloud-oslogin": "5.1.0", "packages/google-cloud-phishingprotection": "4.0.1", "packages/google-cloud-policytroubleshooter": "3.1.1", + "packages/google-cloud-policytroubleshooter-iam": "0.2.1", "packages/google-cloud-privatecatalog": "3.0.1", + "packages/google-cloud-rapidmigrationassessment": "1.0.1", "packages/google-cloud-recaptchaenterprise": "4.0.1", "packages/google-cloud-recommender": "6.1.0", "packages/google-cloud-redis": "4.0.1", @@ -99,6 +111,9 @@ "packages/google-cloud-servicedirectory": "5.0.1", "packages/google-cloud-shell": "3.0.1", "packages/google-cloud-speech": "6.0.2", + "packages/google-cloud-sql": "0.1.0", + "packages/google-cloud-storageinsights": "1.0.1", + "packages/google-cloud-support": "1.0.1", "packages/google-cloud-talent": "6.0.1", "packages/google-cloud-tasks": "4.0.1", "packages/google-cloud-texttospeech": "5.0.1", @@ -115,6 +130,7 @@ "packages/google-cloud-webrisk": "4.0.1", "packages/google-cloud-websecurityscanner": "3.0.1", "packages/google-cloud-workflows-executions": "3.1.0", + "packages/google-cloud-workstations": "1.1.0", "packages/google-container": "5.2.0", "packages/google-dataflow": "3.0.1", "packages/google-devtools-artifactregistry": "3.0.1", @@ -125,26 +141,11 @@ "packages/google-identity-accesscontextmanager": "3.0.1", "packages/google-maps-addressvalidation": "2.0.1", "packages/google-maps-mapsplatformdatasets": "1.0.1", + "packages/google-maps-places": "1.0.1", "packages/google-maps-routing": "1.0.1", "packages/google-monitoring-dashboard": "3.0.1", "packages/google-privacy-dlp": "5.0.1", "packages/google-storagetransfer": "3.0.1", "packages/grafeas": "5.0.1", - "packages/typeless-sample-bot": "2.0.0", - "packages/google-cloud-advisorynotifications": "1.0.1", - "packages/google-cloud-kms-inventory": "1.0.1", - "packages/google-cloud-alloydb": "1.0.1", - "packages/google-cloud-workstations": "1.1.0", - "packages/google-cloud-confidentialcomputing": "1.1.0", - "packages/google-ai-generativelanguage": "1.0.1", - "packages/google-cloud-storageinsights": "1.0.1", - "packages/google-maps-places": "1.0.1", - "packages/google-cloud-support": "1.0.1", - "packages/google-cloud-rapidmigrationassessment": "1.0.1", - "packages/google-cloud-migrationcenter": "1.0.1", - "packages/google-cloud-commerce-consumer-procurement": "0.1.1", - "packages/google-cloud-policytroubleshooter-iam": "0.2.1", - "packages/google-cloud-sql": "0.1.0", - "packages/google-cloud-config": "0.1.0", - "packages/google-cloud-netapp": "0.1.0" + "packages/typeless-sample-bot": "2.0.0" } diff --git a/packages/google-cloud-automl/.OwlBot.yaml b/packages/google-cloud-automl/.OwlBot.yaml new file mode 100644 index 00000000000..201863f2b57 --- /dev/null +++ b/packages/google-cloud-automl/.OwlBot.yaml @@ -0,0 +1,24 @@ +# 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/automl/(v.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-automl/$1 + +begin-after-commit-hash: fb91803ccef5d7c695139b22788b309e2197856b + diff --git a/packages/google-cloud-automl/.eslintignore b/packages/google-cloud-automl/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-automl/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-automl/.eslintrc.json b/packages/google-cloud-automl/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-automl/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-automl/.gitattributes b/packages/google-cloud-automl/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-automl/.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-automl/.gitignore b/packages/google-cloud-automl/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/packages/google-cloud-automl/.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-automl/.jsdoc.js b/packages/google-cloud-automl/.jsdoc.js new file mode 100644 index 00000000000..cd7589af389 --- /dev/null +++ b/packages/google-cloud-automl/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2023 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 2023 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/automl', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-automl/.mocharc.js b/packages/google-cloud-automl/.mocharc.js new file mode 100644 index 00000000000..49e7e228701 --- /dev/null +++ b/packages/google-cloud-automl/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2023 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-automl/.mocharc.json b/packages/google-cloud-automl/.mocharc.json new file mode 100644 index 00000000000..670c5e2c24b --- /dev/null +++ b/packages/google-cloud-automl/.mocharc.json @@ -0,0 +1,5 @@ +{ + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} diff --git a/packages/google-cloud-automl/.nycrc b/packages/google-cloud-automl/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-automl/.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-automl/.prettierignore b/packages/google-cloud-automl/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-automl/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-automl/.prettierrc.js b/packages/google-cloud-automl/.prettierrc.js new file mode 100644 index 00000000000..1e6cec783e4 --- /dev/null +++ b/packages/google-cloud-automl/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2023 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-automl/.readme-partials.yaml b/packages/google-cloud-automl/.readme-partials.yaml new file mode 100644 index 00000000000..42e30224ee4 --- /dev/null +++ b/packages/google-cloud-automl/.readme-partials.yaml @@ -0,0 +1,8 @@ +introduction: | + 🔔 **AutoML API NodeJS Client is now available in Vertex AI. Please visit** + [node-js-aiplatform](https://github.com/googleapis/nodejs-ai-platform) **for the new NodeJS Vertex AI client.** + Vertex AI is our next generation AI Platform, with many new features that are unavailable in the current platform. + [Migrate your resources to Vertex AI](https://cloud.google.com/vertex-ai/docs/start/migrating-to-vertex-ai) to get + the latest machine learning features, simplify end-to-end journeys, and productionize models with MLOps. + + Cloud AutoML API client for Node.js diff --git a/packages/google-cloud-automl/.repo-metadata.json b/packages/google-cloud-automl/.repo-metadata.json new file mode 100644 index 00000000000..83a62a28ad9 --- /dev/null +++ b/packages/google-cloud-automl/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "distribution_name": "@google-cloud/automl", + "release_level": "stable", + "product_documentation": "https://cloud.google.com/automl/docs/", + "repo": "googleapis/google-cloud-node", + "default_version": "v1", + "language": "nodejs", + "requires_billing": true, + "issue_tracker": "https://issuetracker.google.com/savedsearches/559744", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/automl/latest", + "name": "automl", + "name_pretty": "Cloud AutoML", + "api_id": "automl.googleapis.com", + "codeowner_team": "@googleapis/ml-apis", + "api_shortname": "automl", + "library_type": "GAPIC_COMBO" +} diff --git a/packages/google-cloud-automl/CHANGELOG.md b/packages/google-cloud-automl/CHANGELOG.md new file mode 100644 index 00000000000..c7a91c7b4c3 --- /dev/null +++ b/packages/google-cloud-automl/CHANGELOG.md @@ -0,0 +1,549 @@ +# Changelog + +[npm history][1] + +[1]: https://www.npmjs.com/package/@google-cloud/automl?activeTab=versions + +## [4.0.0](https://github.com/googleapis/nodejs-automl/compare/v3.1.3...v4.0.0) (2023-08-10) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 14 + +### Miscellaneous Chores + +* Upgrade to Node 14 ([a6ab913](https://github.com/googleapis/nodejs-automl/commit/a6ab913ae49222b75dccdaaf4f0cea64c0eef5d2)) + +## [3.1.3](https://github.com/googleapis/nodejs-automl/compare/v3.1.2...v3.1.3) (2023-04-02) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#701](https://github.com/googleapis/nodejs-automl/issues/701)) ([ed4b83e](https://github.com/googleapis/nodejs-automl/commit/ed4b83ecec7a6fce1c82a2aba42aaf07f95da153)) +* Regenerated protos JS and TS definitions ([#705](https://github.com/googleapis/nodejs-automl/issues/705)) ([8eb6181](https://github.com/googleapis/nodejs-automl/commit/8eb6181996fdc36b21d48e9589e0a4ab35cf6874)) + +## [3.1.2](https://github.com/googleapis/nodejs-automl/compare/v3.1.1...v3.1.2) (2022-09-22) + + +### Bug Fixes + +* Preserve default values in x-goog-request-params header ([#634](https://github.com/googleapis/nodejs-automl/issues/634)) ([1949bf9](https://github.com/googleapis/nodejs-automl/commit/1949bf9a26b63b4eefd13f5c6164691db46a0df2)) + +## [3.1.1](https://github.com/googleapis/nodejs-automl/compare/v3.1.0...v3.1.1) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#629](https://github.com/googleapis/nodejs-automl/issues/629)) ([b58d43f](https://github.com/googleapis/nodejs-automl/commit/b58d43ff09ce5e80dd0e51dac4e01af71d7aeddc)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-automl/issues/1553)) ([#628](https://github.com/googleapis/nodejs-automl/issues/628)) ([c29c1d0](https://github.com/googleapis/nodejs-automl/commit/c29c1d08817e23cae1d1183ef6a2a695cb146312)) + +## [3.1.0](https://github.com/googleapis/nodejs-automl/compare/v3.0.0...v3.1.0) (2022-08-23) + + +### Features + +* support regapic LRO ([#618](https://github.com/googleapis/nodejs-automl/issues/618)) ([24669e9](https://github.com/googleapis/nodejs-automl/commit/24669e921612949f777a1b5b9dc57a0d011d0a90)) + + +### Bug Fixes + +* better support for fallback mode ([#625](https://github.com/googleapis/nodejs-automl/issues/625)) ([301d706](https://github.com/googleapis/nodejs-automl/commit/301d706c3e4564da4ce7a0c6f082890e2e111b27)) +* change import long to require ([#626](https://github.com/googleapis/nodejs-automl/issues/626)) ([958e1c4](https://github.com/googleapis/nodejs-automl/commit/958e1c46e87f258356f8523548ff5b0401a12470)) +* **deps:** update dependency mathjs to v11 ([#622](https://github.com/googleapis/nodejs-automl/issues/622)) ([c0b8fa5](https://github.com/googleapis/nodejs-automl/commit/c0b8fa50f6cea30f7cc442c5f8e9599ab9cb8901)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-automl/issues/1546)) ([#627](https://github.com/googleapis/nodejs-automl/issues/627)) ([b333d59](https://github.com/googleapis/nodejs-automl/commit/b333d598b16ca9f97fd1a6539fbef0fee65ac3ae)) + +## [3.0.0](https://github.com/googleapis/nodejs-automl/compare/v2.5.2...v3.0.0) (2022-06-20) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#613) + +### Bug Fixes + +* Add back java_multiple_files option to the text_sentiment.proto to match with the previous published version of text_sentiment proto ([20995db](https://github.com/googleapis/nodejs-automl/commit/20995db72854243213a6ffabcb188a52c9cef8f6)) +* proto field markdown comment for the display_name field in annotation_payload.proto to point the correct public v1/ version ([20995db](https://github.com/googleapis/nodejs-automl/commit/20995db72854243213a6ffabcb188a52c9cef8f6)) + + +### Build System + +* update library to use Node 12 ([#613](https://github.com/googleapis/nodejs-automl/issues/613)) ([9ddf084](https://github.com/googleapis/nodejs-automl/commit/9ddf0845c8f5f1a2434a1f48d3740447fa2d747d)) + +### [2.5.2](https://www.github.com/googleapis/nodejs-automl/compare/v2.5.1...v2.5.2) (2021-12-30) + + +### Bug Fixes + +* **deps:** update dependency csv to v6 ([#565](https://www.github.com/googleapis/nodejs-automl/issues/565)) ([7f1d947](https://www.github.com/googleapis/nodejs-automl/commit/7f1d9477cfa2d9697206dffabdfb92dfb80bc1d1)) + +### [2.5.1](https://www.github.com/googleapis/nodejs-automl/compare/v2.5.0...v2.5.1) (2021-11-08) + + +### Bug Fixes + +* **deps:** update dependency mathjs to v10 ([#559](https://www.github.com/googleapis/nodejs-automl/issues/559)) ([120a457](https://www.github.com/googleapis/nodejs-automl/commit/120a457211590c48c0e8d81e35e364f6c098dbce)) + +## [2.5.0](https://www.github.com/googleapis/nodejs-automl/compare/v2.4.5...v2.5.0) (2021-10-14) + + +### Features + +* turns on self-signed JWT feature flag ([#540](https://www.github.com/googleapis/nodejs-automl/issues/540)) ([bb611a4](https://www.github.com/googleapis/nodejs-automl/commit/bb611a4f2f1c372bafc4088f1a7660f7fddb9e08)) + +### [2.4.5](https://www.github.com/googleapis/nodejs-automl/compare/v2.4.4...v2.4.5) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#538](https://www.github.com/googleapis/nodejs-automl/issues/538)) ([aac7447](https://www.github.com/googleapis/nodejs-automl/commit/aac7447912331ea0edc807985f530bca2e8f663c)) + +### [2.4.4](https://www.github.com/googleapis/nodejs-automl/compare/v2.4.3...v2.4.4) (2021-08-11) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#536](https://www.github.com/googleapis/nodejs-automl/issues/536)) ([1185736](https://www.github.com/googleapis/nodejs-automl/commit/1185736efefca56e2f86ac52ad340d231d92c25f)) + +### [2.4.3](https://www.github.com/googleapis/nodejs-automl/compare/v2.4.2...v2.4.3) (2021-07-21) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#526](https://www.github.com/googleapis/nodejs-automl/issues/526)) ([8911d45](https://www.github.com/googleapis/nodejs-automl/commit/8911d457513f2c0c9cca6d2b7473b314ac3a4efd)) +* **deps:** require google-gax v2.17.0 ([#524](https://www.github.com/googleapis/nodejs-automl/issues/524)) ([5863c54](https://www.github.com/googleapis/nodejs-automl/commit/5863c5440bf94fa2fd986b5c8f5265b86fd4497e)) +* make request optional in all cases ([#521](https://www.github.com/googleapis/nodejs-automl/issues/521)) ([a45622a](https://www.github.com/googleapis/nodejs-automl/commit/a45622a9f53683a73fd2057ef5a2ccf22e7da946)) +* REST fallback client header ([#513](https://www.github.com/googleapis/nodejs-automl/issues/513)) ([833d2d7](https://www.github.com/googleapis/nodejs-automl/commit/833d2d70ff1828a69e7f9482f58189f5d484751f)) +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#527](https://www.github.com/googleapis/nodejs-automl/issues/527)) ([dfb504e](https://www.github.com/googleapis/nodejs-automl/commit/dfb504e12075136707e5915b1db6f65ed72d5aa9)) + +### [2.4.2](https://www.github.com/googleapis/nodejs-automl/compare/v2.4.1...v2.4.2) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#501](https://www.github.com/googleapis/nodejs-automl/issues/501)) ([f88cc91](https://www.github.com/googleapis/nodejs-automl/commit/f88cc915df6ac67f7dc46fa345d9fc481b12d7da)) +* use require() to load JSON protos ([#504](https://www.github.com/googleapis/nodejs-automl/issues/504)) ([4cd9585](https://www.github.com/googleapis/nodejs-automl/commit/4cd9585da11b3a9189ed8f3f0e5ddc76c578a462)) + +### [2.4.1](https://www.github.com/googleapis/nodejs-automl/compare/v2.4.0...v2.4.1) (2021-03-07) + + +### Bug Fixes + +* **deps:** update dependency mathjs to v9 ([#482](https://www.github.com/googleapis/nodejs-automl/issues/482)) ([8917ce3](https://www.github.com/googleapis/nodejs-automl/commit/8917ce3d6ed53e94113ed5aa5a42f918a4531a40)) +* Wrote inputs as string to facilitate parsing ([#480](https://www.github.com/googleapis/nodejs-automl/issues/480)) ([3d9aa88](https://www.github.com/googleapis/nodejs-automl/commit/3d9aa8899dd39041cf45a5c298d7cc010ca8d020)) + +## [2.4.0](https://www.github.com/googleapis/nodejs-automl/compare/v2.3.1...v2.4.0) (2021-01-09) + + +### Features + +* adds style enumeration ([#478](https://www.github.com/googleapis/nodejs-automl/issues/478)) ([1eddaf2](https://www.github.com/googleapis/nodejs-automl/commit/1eddaf2618a1e65d3f54faba4e1ef37abcdab916)) + +### [2.3.1](https://www.github.com/googleapis/nodejs-automl/compare/v2.3.0...v2.3.1) (2020-11-25) + + +### Bug Fixes + +* **browser:** check for fetch on window ([50a3083](https://www.github.com/googleapis/nodejs-automl/commit/50a308349f819b06867b13d0300175b3ee5f43b7)) +* do not modify options object, use defaultScopes ([#466](https://www.github.com/googleapis/nodejs-automl/issues/466)) ([8aaf0c3](https://www.github.com/googleapis/nodejs-automl/commit/8aaf0c3aed7f4c2c705d14d4277223e11ba7349f)) + +## [2.3.0](https://www.github.com/googleapis/nodejs-automl/compare/v2.2.0...v2.3.0) (2020-10-27) + + +### Features + +* Added text extraction health care option in create model. ([#458](https://www.github.com/googleapis/nodejs-automl/issues/458)) ([8c488cb](https://www.github.com/googleapis/nodejs-automl/commit/8c488cb7013f2fea98396c4a734ff49a1b691745)) + + +### Bug Fixes + +* **deps:** update dependency yargs to v16 ([#438](https://www.github.com/googleapis/nodejs-automl/issues/438)) ([713d005](https://www.github.com/googleapis/nodejs-automl/commit/713d00568534884bc8cce9d8ca1bbf1c5b1e0bf5)) + +## [2.2.0](https://www.github.com/googleapis/nodejs-automl/compare/v2.1.0...v2.2.0) (2020-06-28) + + +### Features + +* move ts target to es2018 from es2016 ([#406](https://www.github.com/googleapis/nodejs-automl/issues/406)) ([c24dcc2](https://www.github.com/googleapis/nodejs-automl/commit/c24dcc2cf62ea62b1f187fb116652404d5f7cf05)) + + +### Bug Fixes + +* proper fallback option handling ([25d1f25](https://www.github.com/googleapis/nodejs-automl/commit/25d1f250ba9c5d80f66ced3be3dd2aa404248bd1)) + +## [2.1.0](https://www.github.com/googleapis/nodejs-automl/compare/v2.0.0...v2.1.0) (2020-06-04) + + +### Features + +* check status of long running operation by its name ([#397](https://www.github.com/googleapis/nodejs-automl/issues/397)) ([3edf825](https://www.github.com/googleapis/nodejs-automl/commit/3edf82526f57ff4ba60df39ea56956886cd6a123)) + + +### Bug Fixes + +* clean up synth.py for multiple version ([#396](https://www.github.com/googleapis/nodejs-automl/issues/396)) ([a356064](https://www.github.com/googleapis/nodejs-automl/commit/a35606438799b2ad25d6bd0ed84691a28e0a00d6)) +* remove eslint, update gax, fix generated protos, run the generator ([#377](https://www.github.com/googleapis/nodejs-automl/issues/377)) ([7889f29](https://www.github.com/googleapis/nodejs-automl/commit/7889f29cb2ebaf0ac96d68cd9ca1f74122449fcd)) +* **deps:** update dependency mathjs to v7 ([#400](https://www.github.com/googleapis/nodejs-automl/issues/400)) ([8cdcd80](https://www.github.com/googleapis/nodejs-automl/commit/8cdcd80f2a4d6cd9cb64b39e7f1b153dc36e8a2f)) + +## [2.0.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.11.0...v2.0.0) (2020-04-07) + + +### ⚠ BREAKING CHANGES + +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on npm. + +### Features + +* drop node8 support, support for async iterators ([#364](https://www.github.com/googleapis/nodejs-automl/issues/364)) ([156ff6f](https://www.github.com/googleapis/nodejs-automl/commit/156ff6f70880244a698d7a7ef7cac831281dd1f8)) + +## [1.11.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.10.1...v1.11.0) (2020-03-12) + + +### Features + +* deferred client initialization ([83ea415](https://www.github.com/googleapis/nodejs-automl/commit/83ea4156e8d57b65989d0ca8abc7ec39a45f3a82)) +* move to typescript code generation ([#332](https://www.github.com/googleapis/nodejs-automl/issues/332)) ([17f0d7a](https://www.github.com/googleapis/nodejs-automl/commit/17f0d7ab8393616a0aff557206cc233941782080)) +* publish proto updates for v1beta1 surface ([8b4a2b5](https://www.github.com/googleapis/nodejs-automl/commit/8b4a2b578629a624a1e9a318d6f3c503171fcc49)) + +### [1.10.1](https://www.github.com/googleapis/nodejs-automl/compare/v1.10.0...v1.10.1) (2020-01-28) + + +### Bug Fixes + +* enum, bytes, and Long types now accept strings ([6737cad](https://www.github.com/googleapis/nodejs-automl/commit/6737cad17f359cb0c2b3edd28093638d47c0d59e)) + +## [1.10.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.9.2...v1.10.0) (2019-12-05) + + +### Features + +* support resource definitions ([#282](https://www.github.com/googleapis/nodejs-automl/issues/282)) ([439b440](https://www.github.com/googleapis/nodejs-automl/commit/439b440a709d4fba35f3c8fcf297bb20af7dd9d5)) + + +### Bug Fixes + +* **deps:** pin TypeScript below 3.7.0 ([927b5ee](https://www.github.com/googleapis/nodejs-automl/commit/927b5ee5b88cb62e6aa86e44443c6d072fe80669)) +* correct AutoML Natural Language region tags to match with all other languages ([bab8fcb](https://www.github.com/googleapis/nodejs-automl/commit/bab8fcbc7ff3cdc34892fa165085d6bd7964413e)) + +### [1.9.2](https://www.github.com/googleapis/nodejs-automl/compare/v1.9.1...v1.9.2) (2019-11-18) + + +### Bug Fixes + +* **docs:** bump release level to GA ([#280](https://www.github.com/googleapis/nodejs-automl/issues/280)) ([04c897e](https://www.github.com/googleapis/nodejs-automl/commit/04c897ee00642843eb30304186c1628ba0625d56)) + +### [1.9.1](https://www.github.com/googleapis/nodejs-automl/compare/v1.9.0...v1.9.1) (2019-11-18) + + +### Bug Fixes + +* add extra proto list ([#274](https://www.github.com/googleapis/nodejs-automl/issues/274)) ([d4c456b](https://www.github.com/googleapis/nodejs-automl/commit/d4c456b02629fdbcc090297c67dfe2defb946bb2)) +* **deps:** update dependency yargs to v15 ([#279](https://www.github.com/googleapis/nodejs-automl/issues/279)) ([1341a27](https://www.github.com/googleapis/nodejs-automl/commit/1341a275e7b3f935c8945f887339514a91e149da)) +* update PHP protos, Import automl operation protos ([#273](https://www.github.com/googleapis/nodejs-automl/issues/273)) ([c7b285f](https://www.github.com/googleapis/nodejs-automl/commit/c7b285fc3dfad0410f58ac71c0d70c6f7c51eb68)) + +## [1.9.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.8.0...v1.9.0) (2019-11-12) + + +### Features + +* adds GetAnnotationSpec, DeployModel, UndeployModel, ExportModel ([#258](https://www.github.com/googleapis/nodejs-automl/issues/258)) ([0ffcec2](https://www.github.com/googleapis/nodejs-automl/commit/0ffcec2227ab36adb8e50f276837305f347dc9d7)) + + +### Bug Fixes + +* **docs:** snippets are now replaced in jsdoc comments ([#267](https://www.github.com/googleapis/nodejs-automl/issues/267)) ([5179b3c](https://www.github.com/googleapis/nodejs-automl/commit/5179b3c3991189d537794f43a0696838611be525)) + +## [1.8.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.7.3...v1.8.0) (2019-10-31) + + +### Features + +* added samples for api-endpoints ([#259](https://www.github.com/googleapis/nodejs-automl/issues/259)) ([550ffb6](https://www.github.com/googleapis/nodejs-automl/commit/550ffb631a4d2516337dc85972ce4062b78e3ee2)) + + +### Bug Fixes + +* **samples:** remove extra print statement and "setEndpoint.js" from linkinator ([#261](https://www.github.com/googleapis/nodejs-automl/issues/261)) ([5fcb647](https://www.github.com/googleapis/nodejs-automl/commit/5fcb647ed8746ed34f93b01b95dbb67a518f29bb)) + +### [1.7.3](https://www.github.com/googleapis/nodejs-automl/compare/v1.7.2...v1.7.3) (2019-10-22) + + +### Bug Fixes + +* **deps:** bump google-gax to 1.7.5 ([#256](https://www.github.com/googleapis/nodejs-automl/issues/256)) ([950cefc](https://www.github.com/googleapis/nodejs-automl/commit/950cefc29281a74721fb8a5ca2cf2fff5e03dd65)) + +### [1.7.2](https://www.github.com/googleapis/nodejs-automl/compare/v1.7.1...v1.7.2) (2019-10-14) + + +### Bug Fixes + +* **deps:** update dependency execa to v3 ([#251](https://www.github.com/googleapis/nodejs-automl/issues/251)) ([13de52a](https://www.github.com/googleapis/nodejs-automl/commit/13de52a60d0bbced5b8fb6955d05c5526486c5bb)) + +### [1.7.1](https://www.github.com/googleapis/nodejs-automl/compare/v1.7.0...v1.7.1) (2019-10-08) + + +### Bug Fixes + +* createDataset now correctly returns operation ([770b572](https://www.github.com/googleapis/nodejs-automl/commit/770b572)) + +## [1.7.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.6.0...v1.7.0) (2019-10-04) + + +### Bug Fixes + +* use compatible version of google-gax ([754467c](https://www.github.com/googleapis/nodejs-automl/commit/754467c)) + + +### Features + +* v1 API surface added ([#245](https://www.github.com/googleapis/nodejs-automl/issues/245)) ([dea9d08](https://www.github.com/googleapis/nodejs-automl/commit/dea9d08)) + +## [1.6.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.5.0...v1.6.0) (2019-10-01) + + +### Features + +* adds ImageClassificationModelDeploymentMetadata ([42d766d](https://www.github.com/googleapis/nodejs-automl/commit/42d766d)) + +## [1.5.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.4.0...v1.5.0) (2019-09-05) + + +### Features + +* load protos from JSON, grpc-fallback support ([ff43ecf](https://www.github.com/googleapis/nodejs-automl/commit/ff43ecf)) + +## [1.4.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.3.0...v1.4.0) (2019-08-28) + + +### Bug Fixes + +* **deps:** update dependency yargs to v14 ([01aa9d6](https://www.github.com/googleapis/nodejs-automl/commit/01aa9d6)) +* **docs:** remove reference-docs anchor ([ee86e1d](https://www.github.com/googleapis/nodejs-automl/commit/ee86e1d)) + + +### Features + +* introduces configuration, e.g., dimensions, for doc prediction ([9c8ce64](https://www.github.com/googleapis/nodejs-automl/commit/9c8ce64)) + +## [1.3.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.2.4...v1.3.0) (2019-08-19) + + +### Features + +* introduces validRowCount ([a776956](https://www.github.com/googleapis/nodejs-automl/commit/a776956)) + +### [1.2.4](https://www.github.com/googleapis/nodejs-automl/compare/v1.2.3...v1.2.4) (2019-08-05) + + +### Bug Fixes + +* allow calls with no request, add JSON proto ([c7bec4d](https://www.github.com/googleapis/nodejs-automl/commit/c7bec4d)) + +### [1.2.3](https://www.github.com/googleapis/nodejs-automl/compare/v1.2.2...v1.2.3) (2019-07-29) + + +### Bug Fixes + +* **deps:** update dependency execa to v2 ([#211](https://www.github.com/googleapis/nodejs-automl/issues/211)) ([751265a](https://www.github.com/googleapis/nodejs-automl/commit/751265a)) + +### [1.2.2](https://www.github.com/googleapis/nodejs-automl/compare/v1.2.1...v1.2.2) (2019-06-26) + + +### Bug Fixes + +* **docs:** link to reference docs section on googleapis.dev ([#205](https://www.github.com/googleapis/nodejs-automl/issues/205)) ([4e6d9a1](https://www.github.com/googleapis/nodejs-automl/commit/4e6d9a1)) + +### [1.2.1](https://www.github.com/googleapis/nodejs-automl/compare/v1.2.0...v1.2.1) (2019-06-14) + + +### Bug Fixes + +* parse CSV correctly ([#198](https://www.github.com/googleapis/nodejs-automl/issues/198)) ([8c0eb1c](https://www.github.com/googleapis/nodejs-automl/commit/8c0eb1c)) +* **docs:** move to new client docs URL ([#201](https://www.github.com/googleapis/nodejs-automl/issues/201)) ([3c01587](https://www.github.com/googleapis/nodejs-automl/commit/3c01587)) + +## [1.2.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.1.1...v1.2.0) (2019-06-11) + + +### Bug Fixes + +* **deps:** update dependency mathjs to v6 ([#195](https://www.github.com/googleapis/nodejs-automl/issues/195)) ([47364ab](https://www.github.com/googleapis/nodejs-automl/commit/47364ab)) + + +### Features + +* add video object tracking support ([#194](https://www.github.com/googleapis/nodejs-automl/issues/194)) ([f9c737f](https://www.github.com/googleapis/nodejs-automl/commit/f9c737f)) + +### [1.1.1](https://www.github.com/googleapis/nodejs-automl/compare/v1.1.0...v1.1.1) (2019-06-06) + + +### Bug Fixes + +* default opts to empty object ([#191](https://www.github.com/googleapis/nodejs-automl/issues/191)) ([7846b04](https://www.github.com/googleapis/nodejs-automl/commit/7846b04)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.0.0...v1.1.0) (2019-05-23) + + +### Features + +* add .repo-metadata.json; allows us to generate new docs site ([#183](https://www.github.com/googleapis/nodejs-automl/issues/183)) ([8b42e76](https://www.github.com/googleapis/nodejs-automl/commit/8b42e76)) + +## [1.0.0](https://www.github.com/googleapis/nodejs-automl/compare/v0.2.0...v1.0.0) (2019-05-13) + + +### Bug Fixes + +* **deps:** update dependency google-gax to v1 ([#176](https://www.github.com/googleapis/nodejs-automl/issues/176)) ([423ae98](https://www.github.com/googleapis/nodejs-automl/commit/423ae98)) +* DEADLINE_EXCEEDED is no longer retried ([20eb86c](https://www.github.com/googleapis/nodejs-automl/commit/20eb86c)) +* DEADLINE_EXCEEDED retry code is idempotent ([#177](https://www.github.com/googleapis/nodejs-automl/issues/177)) ([e8313ab](https://www.github.com/googleapis/nodejs-automl/commit/e8313ab)) +* **deps:** update dependency google-gax to ^0.26.0 ([#166](https://www.github.com/googleapis/nodejs-automl/issues/166)) ([b449fc7](https://www.github.com/googleapis/nodejs-automl/commit/b449fc7)) + + +### Build System + +* upgrade engines field to >=8.10.0 ([#168](https://www.github.com/googleapis/nodejs-automl/issues/168)) ([249c7a8](https://www.github.com/googleapis/nodejs-automl/commit/249c7a8)) + + +### BREAKING CHANGES + +* upgrade engines field to >=8.10.0 (#168) + +## v0.2.0 + +04-03-2019 12:39 PDT + +### New Features +- feat: support new AutoML problems; add batchPredict, exportModel methods + +### Implementation Changes +- fix: include 'x-goog-request-params' header in requests ([#149](https://github.com/googleapis/nodejs-automl/pull/149)) + +### Documentation +- docs: use backticks for JS values ([#142](https://github.com/googleapis/nodejs-automl/pull/142)) + +### Internal / Testing Changes +- chore: publish to npm using wombat ([#145](https://github.com/googleapis/nodejs-automl/pull/145)) +- build: use per-repo publish token ([#144](https://github.com/googleapis/nodejs-automl/pull/144)) + +## v0.1.4 + +03-12-2019 13:50 PDT + +This patch release has a few bug fixes and dependency updates. Enjoy! + +### Bug fixes +- fix: throw on invalid credentials ([#130](https://github.com/googleapis/nodejs-automl/pull/130)) +- fix: use credential file to get project id ([#111](https://github.com/googleapis/nodejs-automl/pull/111)) + +### Dependencies +- fix(deps): update dependency google-gax to ^0.25.0 ([#120](https://github.com/googleapis/nodejs-automl/pull/120)) + +### Documentation +- docs(samples): move AutoML vision samples from nodejs-vision ([#134](https://github.com/googleapis/nodejs-automl/pull/134)) +- docs: update proto docs and code style +- docs: update links in contrib guide ([#132](https://github.com/googleapis/nodejs-automl/pull/132)) +- docs: update contributing path in README ([#127](https://github.com/googleapis/nodejs-automl/pull/127)) +- docs: move CONTRIBUTING.md to root ([#126](https://github.com/googleapis/nodejs-automl/pull/126)) +- docs: add lint/fix example to contributing guide ([#124](https://github.com/googleapis/nodejs-automl/pull/124)) +- docs: update examples in comments ([#123](https://github.com/googleapis/nodejs-automl/pull/123)) +- docs: proper require stmt ([#113](https://github.com/googleapis/nodejs-automl/pull/113)) + +### Internal / Testing Changes +- refactor: update json import paths ([#140](https://github.com/googleapis/nodejs-automl/pull/140)) +- build: Add docuploader credentials to node publish jobs ([#138](https://github.com/googleapis/nodejs-automl/pull/138)) +- build: use node10 to run samples-test, system-test etc ([#137](https://github.com/googleapis/nodejs-automl/pull/137)) +- build: update release configuration +- chore(deps): update dependency mocha to v6 +- build: use linkinator for docs test ([#131](https://github.com/googleapis/nodejs-automl/pull/131)) +- build: create docs test npm scripts ([#129](https://github.com/googleapis/nodejs-automl/pull/129)) +- build: test using @grpc/grpc-js in CI ([#128](https://github.com/googleapis/nodejs-automl/pull/128)) +- refactor: improve generated code style. ([#122](https://github.com/googleapis/nodejs-automl/pull/122)) +- chore: re-arrange exports. ([#121](https://github.com/googleapis/nodejs-automl/pull/121)) +- chore(deps): update dependency eslint-config-prettier to v4 ([#119](https://github.com/googleapis/nodejs-automl/pull/119)) +- build: ignore googleapis.com in doc link check ([#117](https://github.com/googleapis/nodejs-automl/pull/117)) +- chore: sync gapic files +- build: check broken links in generated docs ([#112](https://github.com/googleapis/nodejs-automl/pull/112)) +- test: add a basic system test ([#106](https://github.com/googleapis/nodejs-automl/pull/106)) + +## v0.1.3 + +12-15-2018 12:46 PST + +### Dependencies +- fix(deps): update dependency google-gax to ^0.22.0 ([#82](https://github.com/googleapis/nodejs-automl/pull/82)) +- fix(deps): update dependency google-gax to ^0.20.0 ([#47](https://github.com/googleapis/nodejs-automl/pull/47)) + +### Documentation +- docs: Add a comment to hint at format of payload for prediction. ([#93](https://github.com/googleapis/nodejs-automl/pull/93)) +- docs: update readme badges ([#90](https://github.com/googleapis/nodejs-automl/pull/90)) + +### Internal / Testing Changes +- chore: basic proto updates ([#105](https://github.com/googleapis/nodejs-automl/pull/105)) +- chore(build): inject yoshi automation key ([#104](https://github.com/googleapis/nodejs-automl/pull/104)) +- chore: update nyc and eslint configs ([#103](https://github.com/googleapis/nodejs-automl/pull/103)) +- chore: fix publish.sh permission +x ([#102](https://github.com/googleapis/nodejs-automl/pull/102)) +- fix(build): fix Kokoro release script ([#101](https://github.com/googleapis/nodejs-automl/pull/101)) +- build: add Kokoro configs for autorelease ([#100](https://github.com/googleapis/nodejs-automl/pull/100)) +- chore: always nyc report before calling codecov ([#98](https://github.com/googleapis/nodejs-automl/pull/98)) +- chore: nyc ignore build/test by default ([#97](https://github.com/googleapis/nodejs-automl/pull/97)) +- chore: clean up usage of prettier and eslint ([#96](https://github.com/googleapis/nodejs-automl/pull/96)) +- chore: update license file ([#92](https://github.com/googleapis/nodejs-automl/pull/92)) +- fix(build): fix system key decryption ([#88](https://github.com/googleapis/nodejs-automl/pull/88)) +- chore: add synth.metadata +- chore: update eslintignore config ([#81](https://github.com/googleapis/nodejs-automl/pull/81)) +- chore: drop contributors from multiple places ([#80](https://github.com/googleapis/nodejs-automl/pull/80)) +- chore: use latest npm on Windows ([#79](https://github.com/googleapis/nodejs-automl/pull/79)) +- chore: update CircleCI config ([#78](https://github.com/googleapis/nodejs-automl/pull/78)) +- chore: include build in eslintignore ([#75](https://github.com/googleapis/nodejs-automl/pull/75)) +- chore(deps): update dependency eslint-plugin-node to v8 ([#71](https://github.com/googleapis/nodejs-automl/pull/71)) +- chore: update issue templates ([#70](https://github.com/googleapis/nodejs-automl/pull/70)) +- chore: remove old issue template ([#68](https://github.com/googleapis/nodejs-automl/pull/68)) +- build: run tests on node11 ([#67](https://github.com/googleapis/nodejs-automl/pull/67)) +- chores(build): do not collect sponge.xml from windows builds ([#66](https://github.com/googleapis/nodejs-automl/pull/66)) +- chores(build): run codecov on continuous builds ([#65](https://github.com/googleapis/nodejs-automl/pull/65)) +- chore: update new issue template ([#64](https://github.com/googleapis/nodejs-automl/pull/64)) +- build: fix codecov uploading on Kokoro ([#61](https://github.com/googleapis/nodejs-automl/pull/61)) +- Update kokoro config ([#59](https://github.com/googleapis/nodejs-automl/pull/59)) +- chore(deps): update dependency eslint-plugin-prettier to v3 ([#58](https://github.com/googleapis/nodejs-automl/pull/58)) +- build: prevent system/sample-test from leaking credentials +- Update kokoro config ([#55](https://github.com/googleapis/nodejs-automl/pull/55)) +- test: remove appveyor config ([#54](https://github.com/googleapis/nodejs-automl/pull/54)) +- Update the CI config ([#53](https://github.com/googleapis/nodejs-automl/pull/53)) +- Enable prefer-const in the eslint config ([#51](https://github.com/googleapis/nodejs-automl/pull/51)) +- Enable no-var in eslint ([#50](https://github.com/googleapis/nodejs-automl/pull/50)) +- Switch to let/const ([#49](https://github.com/googleapis/nodejs-automl/pull/49)) +- test: throw on deprecation ([#23](https://github.com/googleapis/nodejs-automl/pull/23)) +- Update CI config ([#46](https://github.com/googleapis/nodejs-automl/pull/46)) +- Remove unused dependencies ([#44](https://github.com/googleapis/nodejs-automl/pull/44)) +- Retry npm install in CI ([#43](https://github.com/googleapis/nodejs-automl/pull/43)) +- Update CI config ([#40](https://github.com/googleapis/nodejs-automl/pull/40)) +- Re-generate library using /synth.py ([#39](https://github.com/googleapis/nodejs-automl/pull/39)) +- chore(deps): update dependency nyc to v13 ([#37](https://github.com/googleapis/nodejs-automl/pull/37)) +- Update the CI config ([#36](https://github.com/googleapis/nodejs-automl/pull/36)) + +## v0.1.2 + +### Dependency updates +- fix(deps): update dependency google-gax to ^0.19.0 (#31) +- fix(deps): update dependency google-gax to ^0.18.0 (#22) +- chore(deps): update dependency eslint-config-prettier to v3 (#30) + +### Keepin' the lights on +- chore: make the CircleCI config consistent (#32) +- chore: do not use npm ci (#29) +- chore: ignore package-lock.json (#27) +- chore(deps): lock file maintenance (#26) +- chore(deps): lock file maintenance (#25) +- chore: update renovate config (#24) +- chore(deps): lock file maintenance (#21) +- chore: move mocha options to mocha.opts (#19) +- chore: require node 8 for samples (#20) +- Re-generate library using /synth.py (#18) +- chore(deps): lock file maintenance (#17) +- nit: Google LLC (#16) + +## v0.1.1 + +This patch release addresses a namespacing issue that affected our docs. + +### Documentation +- Add missing JSDoc namespaces. (#14) diff --git a/packages/google-cloud-automl/CODE_OF_CONDUCT.md b/packages/google-cloud-automl/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-automl/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-automl/CONTRIBUTING.md b/packages/google-cloud-automl/CONTRIBUTING.md new file mode 100644 index 00000000000..7fff5f7449f --- /dev/null +++ b/packages/google-cloud-automl/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 Cloud AutoML 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=automl.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-automl/LICENSE b/packages/google-cloud-automl/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-automl/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-automl/README.md b/packages/google-cloud-automl/README.md new file mode 100644 index 00000000000..984dc952c5e --- /dev/null +++ b/packages/google-cloud-automl/README.md @@ -0,0 +1,230 @@ +[//]: # "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 + +# [Cloud AutoML: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-automl) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/automl.svg)](https://www.npmjs.org/package/@google-cloud/automl) + + + + +Cloud AutoML 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-automl/CHANGELOG.md). + +* [Cloud AutoML Node.js Client API Reference][client-docs] +* [Cloud AutoML Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-cloud-automl](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-automl) + +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 Cloud AutoML 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/automl +``` + + +### Using the client library + +```javascript +const automl = require('@google-cloud/automl'); +const fs = require('fs'); + +// Create client for prediction service. +const client = new automl.PredictionServiceClient(); + +/** + * TODO(developer): Uncomment the following line before running the sample. + */ +// const projectId = `The GCLOUD_PROJECT string, e.g. "my-gcloud-project"`; +// const computeRegion = `region-name, e.g. "us-central1"`; +// const modelId = `id of the model, e.g. “ICN723541179344731436”`; +// const filePath = `local text file path of content to be classified, e.g. "./resources/flower.png"`; +// const scoreThreshold = `value between 0.0 and 1.0, e.g. "0.5"`; + +// Get the full path of the model. +const modelFullId = client.modelPath(projectId, computeRegion, modelId); + +// Read the file content for prediction. +const content = fs.readFileSync(filePath, 'base64'); + +const params = {}; + +if (scoreThreshold) { + params.score_threshold = scoreThreshold; +} + +// Set the payload by giving the content and type of the file. +const payload = {}; +payload.image = {imageBytes: content}; + +// params is additional domain-specific parameters. +// currently there is no additional parameters supported. +const [response] = await client.predict({ + name: modelFullId, + payload: payload, + params: params, +}); +console.log('Prediction results:'); +response.payload.forEach(result => { + console.log(`Predicted class name: ${result.displayName}`); + console.log(`Predicted class score: ${result.classification.score}`); +}); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-automl/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Auto_ml.create_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.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-automl/samples/generated/v1/auto_ml.create_dataset.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.create_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_model.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-automl/samples/generated/v1/auto_ml.create_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.delete_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.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-automl/samples/generated/v1/auto_ml.delete_dataset.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.delete_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_model.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-automl/samples/generated/v1/auto_ml.delete_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.deploy_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.deploy_model.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-automl/samples/generated/v1/auto_ml.deploy_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.export_data | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.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-automl/samples/generated/v1/auto_ml.export_data.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.export_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_model.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-automl/samples/generated/v1/auto_ml.export_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.get_annotation_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_annotation_spec.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-automl/samples/generated/v1/auto_ml.get_annotation_spec.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.get_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.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-automl/samples/generated/v1/auto_ml.get_dataset.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.get_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model.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-automl/samples/generated/v1/auto_ml.get_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.get_model_evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model_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-automl/samples/generated/v1/auto_ml.get_model_evaluation.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.import_data | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.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-automl/samples/generated/v1/auto_ml.import_data.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.list_datasets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.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-automl/samples/generated/v1/auto_ml.list_datasets.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.list_model_evaluations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_model_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-automl/samples/generated/v1/auto_ml.list_model_evaluations.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.list_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_models.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-automl/samples/generated/v1/auto_ml.list_models.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.undeploy_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.undeploy_model.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-automl/samples/generated/v1/auto_ml.undeploy_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.update_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_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-automl/samples/generated/v1/auto_ml.update_dataset.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.update_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_model.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-automl/samples/generated/v1/auto_ml.update_model.js,packages/google-cloud-automl/samples/README.md) | +| Prediction_service.batch_predict | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/prediction_service.batch_predict.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-automl/samples/generated/v1/prediction_service.batch_predict.js,packages/google-cloud-automl/samples/README.md) | +| Prediction_service.predict | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/prediction_service.predict.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-automl/samples/generated/v1/prediction_service.predict.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.create_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.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-automl/samples/generated/v1beta1/auto_ml.create_dataset.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.create_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_model.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-automl/samples/generated/v1beta1/auto_ml.create_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.delete_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.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-automl/samples/generated/v1beta1/auto_ml.delete_dataset.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.delete_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_model.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-automl/samples/generated/v1beta1/auto_ml.delete_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.deploy_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.deploy_model.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-automl/samples/generated/v1beta1/auto_ml.deploy_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.export_data | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.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-automl/samples/generated/v1beta1/auto_ml.export_data.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.export_evaluated_examples | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_evaluated_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-automl/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.export_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_model.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-automl/samples/generated/v1beta1/auto_ml.export_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.get_annotation_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_annotation_spec.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-automl/samples/generated/v1beta1/auto_ml.get_annotation_spec.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.get_column_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_column_spec.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-automl/samples/generated/v1beta1/auto_ml.get_column_spec.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.get_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.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-automl/samples/generated/v1beta1/auto_ml.get_dataset.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.get_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model.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-automl/samples/generated/v1beta1/auto_ml.get_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.get_model_evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model_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-automl/samples/generated/v1beta1/auto_ml.get_model_evaluation.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.get_table_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_table_spec.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-automl/samples/generated/v1beta1/auto_ml.get_table_spec.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.import_data | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.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-automl/samples/generated/v1beta1/auto_ml.import_data.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.list_column_specs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_column_specs.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-automl/samples/generated/v1beta1/auto_ml.list_column_specs.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.list_datasets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.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-automl/samples/generated/v1beta1/auto_ml.list_datasets.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.list_model_evaluations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_model_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-automl/samples/generated/v1beta1/auto_ml.list_model_evaluations.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.list_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_models.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-automl/samples/generated/v1beta1/auto_ml.list_models.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.list_table_specs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_table_specs.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-automl/samples/generated/v1beta1/auto_ml.list_table_specs.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.undeploy_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.undeploy_model.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-automl/samples/generated/v1beta1/auto_ml.undeploy_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.update_column_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_column_spec.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-automl/samples/generated/v1beta1/auto_ml.update_column_spec.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.update_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_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-automl/samples/generated/v1beta1/auto_ml.update_dataset.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.update_table_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_table_spec.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-automl/samples/generated/v1beta1/auto_ml.update_table_spec.js,packages/google-cloud-automl/samples/README.md) | +| Prediction_service.batch_predict | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.batch_predict.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-automl/samples/generated/v1beta1/prediction_service.batch_predict.js,packages/google-cloud-automl/samples/README.md) | +| Prediction_service.predict | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.predict.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-automl/samples/generated/v1beta1/prediction_service.predict.js,packages/google-cloud-automl/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/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-automl/samples/quickstart.js,packages/google-cloud-automl/samples/README.md) | + + + +The [Cloud AutoML 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://github.com/nodejs/release#release-schedule). +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/automl@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/automl/latest +[product-docs]: https://cloud.google.com/automl/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=automl.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-automl/linkinator.config.json b/packages/google-cloud-automl/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-cloud-automl/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-automl/owlbot.py b/packages/google-cloud-automl/owlbot.py new file mode 100644 index 00000000000..e4b3256d52a --- /dev/null +++ b/packages/google-cloud-automl/owlbot.py @@ -0,0 +1,20 @@ +# Copyright 2018 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. + +import synthtool.languages.node_mono_repo as node + +node.owlbot_main(relative_dir="packages/google-cloud-automl", + staging_excludes=['README.md', 'package.json'], + templates_excludes=['.kokoro/trampoline.sh', '.kokoro/continuous/node12/samples-test.cfg', '.kokoro/presubmit/node12/samples-test.cfg'] +) \ No newline at end of file diff --git a/packages/google-cloud-automl/package.json b/packages/google-cloud-automl/package.json new file mode 100644 index 00000000000..683fd2b99eb --- /dev/null +++ b/packages/google-cloud-automl/package.json @@ -0,0 +1,74 @@ +{ + "name": "@google-cloud/automl", + "description": "Cloud AutoML API client for Node.js", + "version": "4.0.0", + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=14.0.0" + }, + "repository": { + "type": "git", + "directory": "packages/google-cloud-automl", + "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 automl", + "automl", + "Cloud AutoML API" + ], + "scripts": { + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "lint": "gts check", + "fix": "gts fix", + "prelint": "cd samples; npm link ../; npm install", + "system-test": "npm run compile && c8 mocha build/system-test", + "docs": "jsdoc -c .jsdoc.js", + "docs-test": "linkinator docs", + "predocs-test": "npm run docs", + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "prepare": "npm run compile", + "precompile": "gts clean" + }, + "dependencies": { + "google-gax": "^4.0.3" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^20.4.9", + "@types/sinon": "^10.0.0", + "c8": "^8.0.1", + "codecov": "^3.6.5", + "gapic-tools": "^0.1.8", + "gts": "^5.0.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.0", + "ts-loader": "^9.0.0", + "typescript": "^5.1.6", + "webpack": "^5.0.0", + "webpack-cli": "^5.0.0" + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-automl" +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_payload.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_payload.proto new file mode 100644 index 00000000000..e8fd89c2585 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_payload.proto @@ -0,0 +1,65 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.automl.v1; + +import "google/cloud/automl/v1/classification.proto"; +import "google/cloud/automl/v1/detection.proto"; +import "google/cloud/automl/v1/text_extraction.proto"; +import "google/cloud/automl/v1/text_sentiment.proto"; +import "google/cloud/automl/v1/translation.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Contains annotation information that is relevant to AutoML. +message AnnotationPayload { + // Output only . Additional information about the annotation + // specific to the AutoML domain. + oneof detail { + // Annotation details for translation. + TranslationAnnotation translation = 2; + + // Annotation details for content or image classification. + ClassificationAnnotation classification = 3; + + // Annotation details for image object detection. + ImageObjectDetectionAnnotation image_object_detection = 4; + + // Annotation details for text extraction. + TextExtractionAnnotation text_extraction = 6; + + // Annotation details for text sentiment. + TextSentimentAnnotation text_sentiment = 7; + } + + // Output only . The resource ID of the annotation spec that + // this annotation pertains to. The annotation spec comes from either an + // ancestor dataset, or the dataset that was used to train the model in use. + string annotation_spec_id = 1; + + // Output only. The value of + // [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + // when the model was trained. Because this field returns a value at model + // training time, for different models trained using the same dataset, the + // returned value could be different as model owner could update the + // `display_name` between any two model training. + string display_name = 5; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_spec.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_spec.proto new file mode 100644 index 00000000000..75cd334f0b5 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_spec.proto @@ -0,0 +1,47 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.automl.v1; + +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// A definition of an annotation spec. +message AnnotationSpec { + option (google.api.resource) = { + type: "automl.googleapis.com/AnnotationSpec" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}" + }; + + // Output only. Resource name of the annotation spec. + // Form: + // 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}' + string name = 1; + + // Required. The name of the annotation spec to show in the interface. The name can be + // up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`. + string display_name = 2; + + // Output only. The number of examples in the parent dataset + // labeled by the annotation spec. + int32 example_count = 9; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/classification.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/classification.proto new file mode 100644 index 00000000000..3982ee4bd94 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/classification.proto @@ -0,0 +1,173 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.automl.v1; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "ClassificationProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Type of the classification problem. +enum ClassificationType { + // An un-set value of this enum. + CLASSIFICATION_TYPE_UNSPECIFIED = 0; + + // At most one label is allowed per example. + MULTICLASS = 1; + + // Multiple labels are allowed for one example. + MULTILABEL = 2; +} + +// Contains annotation details specific to classification. +message ClassificationAnnotation { + // Output only. A confidence estimate between 0.0 and 1.0. A higher value + // means greater confidence that the annotation is positive. If a user + // approves an annotation as negative or positive, the score value remains + // unchanged. If a user creates an annotation, the score is 0 for negative or + // 1 for positive. + float score = 1; +} + +// Model evaluation metrics for classification problems. +// Note: For Video Classification this metrics only describe quality of the +// Video Classification predictions of "segment_classification" type. +message ClassificationEvaluationMetrics { + // Metrics for a single confidence threshold. + message ConfidenceMetricsEntry { + // Output only. Metrics are computed with an assumption that the model + // never returns predictions with score lower than this value. + float confidence_threshold = 1; + + // Output only. Metrics are computed with an assumption that the model + // always returns at most this many predictions (ordered by their score, + // descendingly), but they all still need to meet the confidence_threshold. + int32 position_threshold = 14; + + // Output only. Recall (True Positive Rate) for the given confidence + // threshold. + float recall = 2; + + // Output only. Precision for the given confidence threshold. + float precision = 3; + + // Output only. False Positive Rate for the given confidence threshold. + float false_positive_rate = 8; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 4; + + // Output only. The Recall (True Positive Rate) when only considering the + // label that has the highest prediction score and not below the confidence + // threshold for each example. + float recall_at1 = 5; + + // Output only. The precision when only considering the label that has the + // highest prediction score and not below the confidence threshold for each + // example. + float precision_at1 = 6; + + // Output only. The False Positive Rate when only considering the label that + // has the highest prediction score and not below the confidence threshold + // for each example. + float false_positive_rate_at1 = 9; + + // Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1]. + float f1_score_at1 = 7; + + // Output only. The number of model created labels that match a ground truth + // label. + int64 true_positive_count = 10; + + // Output only. The number of model created labels that do not match a + // ground truth label. + int64 false_positive_count = 11; + + // Output only. The number of ground truth labels that are not matched + // by a model created label. + int64 false_negative_count = 12; + + // Output only. The number of labels that were not created by the model, + // but if they would, they would not match a ground truth label. + int64 true_negative_count = 13; + } + + // Confusion matrix of the model running the classification. + message ConfusionMatrix { + // Output only. A row in the confusion matrix. + message Row { + // Output only. Value of the specific cell in the confusion matrix. + // The number of values each row has (i.e. the length of the row) is equal + // to the length of the `annotation_spec_id` field or, if that one is not + // populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + repeated int32 example_count = 1; + } + + // Output only. IDs of the annotation specs used in the confusion matrix. + // For Tables CLASSIFICATION + // [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type] + // only list of [annotation_spec_display_name-s][] is populated. + repeated string annotation_spec_id = 1; + + // Output only. Display name of the annotation specs used in the confusion + // matrix, as they were at the moment of the evaluation. For Tables + // CLASSIFICATION + // [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type], + // distinct values of the target column at the moment of the model + // evaluation are populated here. + repeated string display_name = 3; + + // Output only. Rows in the confusion matrix. The number of rows is equal to + // the size of `annotation_spec_id`. + // `row[i].example_count[j]` is the number of examples that have ground + // truth of the `annotation_spec_id[i]` and are predicted as + // `annotation_spec_id[j]` by the model being evaluated. + repeated Row row = 2; + } + + // Output only. The Area Under Precision-Recall Curve metric. Micro-averaged + // for the overall evaluation. + float au_prc = 1; + + // Output only. The Area Under Receiver Operating Characteristic curve metric. + // Micro-averaged for the overall evaluation. + float au_roc = 6; + + // Output only. The Log Loss metric. + float log_loss = 7; + + // Output only. Metrics for each confidence_threshold in + // 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and + // position_threshold = INT32_MAX_VALUE. + // ROC and precision-recall curves, and other aggregated metrics are derived + // from them. The confidence metrics entries may also be supplied for + // additional values of position_threshold, but from these no aggregated + // metrics are computed. + repeated ConfidenceMetricsEntry confidence_metrics_entry = 3; + + // Output only. Confusion matrix of the evaluation. + // Only set for MULTICLASS classification problems where number + // of labels is no more than 10. + // Only set for model level evaluation, not for evaluation per label. + ConfusionMatrix confusion_matrix = 4; + + // Output only. The annotation spec ids used for this evaluation. + repeated string annotation_spec_id = 5; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/data_items.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/data_items.proto new file mode 100644 index 00000000000..9990e57d9dc --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/data_items.proto @@ -0,0 +1,187 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.automl.v1; + +import "google/cloud/automl/v1/geometry.proto"; +import "google/cloud/automl/v1/io.proto"; +import "google/cloud/automl/v1/text_segment.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// A representation of an image. +// Only images up to 30MB in size are supported. +message Image { + // Input only. The data representing the image. + // For Predict calls [image_bytes][google.cloud.automl.v1.Image.image_bytes] must be set . + oneof data { + // Image content represented as a stream of bytes. + // Note: As with all `bytes` fields, protobuffers use a pure binary + // representation, whereas JSON representations use base64. + bytes image_bytes = 1; + } + + // Output only. HTTP URI to the thumbnail image. + string thumbnail_uri = 4; +} + +// A representation of a text snippet. +message TextSnippet { + // Required. The content of the text snippet as a string. Up to 250000 + // characters long. + string content = 1; + + // Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed + // values are "text/html" and "text/plain". If left blank, the format is + // automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content]. + string mime_type = 2; + + // Output only. HTTP URI where you can download the content. + string content_uri = 4; +} + +// Message that describes dimension of a document. +message DocumentDimensions { + // Unit of the document dimension. + enum DocumentDimensionUnit { + // Should not be used. + DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0; + + // Document dimension is measured in inches. + INCH = 1; + + // Document dimension is measured in centimeters. + CENTIMETER = 2; + + // Document dimension is measured in points. 72 points = 1 inch. + POINT = 3; + } + + // Unit of the dimension. + DocumentDimensionUnit unit = 1; + + // Width value of the document, works together with the unit. + float width = 2; + + // Height value of the document, works together with the unit. + float height = 3; +} + +// A structured text document e.g. a PDF. +message Document { + // Describes the layout information of a [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the document. + message Layout { + // The type of TextSegment in the context of the original document. + enum TextSegmentType { + // Should not be used. + TEXT_SEGMENT_TYPE_UNSPECIFIED = 0; + + // The text segment is a token. e.g. word. + TOKEN = 1; + + // The text segment is a paragraph. + PARAGRAPH = 2; + + // The text segment is a form field. + FORM_FIELD = 3; + + // The text segment is the name part of a form field. It will be treated + // as child of another FORM_FIELD TextSegment if its span is subspan of + // another TextSegment with type FORM_FIELD. + FORM_FIELD_NAME = 4; + + // The text segment is the text content part of a form field. It will be + // treated as child of another FORM_FIELD TextSegment if its span is + // subspan of another TextSegment with type FORM_FIELD. + FORM_FIELD_CONTENTS = 5; + + // The text segment is a whole table, including headers, and all rows. + TABLE = 6; + + // The text segment is a table's headers. It will be treated as child of + // another TABLE TextSegment if its span is subspan of another TextSegment + // with type TABLE. + TABLE_HEADER = 7; + + // The text segment is a row in table. It will be treated as child of + // another TABLE TextSegment if its span is subspan of another TextSegment + // with type TABLE. + TABLE_ROW = 8; + + // The text segment is a cell in table. It will be treated as child of + // another TABLE_ROW TextSegment if its span is subspan of another + // TextSegment with type TABLE_ROW. + TABLE_CELL = 9; + } + + // Text Segment that represents a segment in + // [document_text][google.cloud.automl.v1p1beta.Document.document_text]. + TextSegment text_segment = 1; + + // Page number of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the original document, starts + // from 1. + int32 page_number = 2; + + // The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. + // Contains exactly 4 + // [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] + // and they are connected by edges in the order provided, which will + // represent a rectangle parallel to the frame. The + // [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are + // relative to the page. + // Coordinates are based on top-left as point (0,0). + BoundingPoly bounding_poly = 3; + + // The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document. + TextSegmentType text_segment_type = 4; + } + + // An input config specifying the content of the document. + DocumentInputConfig input_config = 1; + + // The plain text version of this document. + TextSnippet document_text = 2; + + // Describes the layout of the document. + // Sorted by [page_number][]. + repeated Layout layout = 3; + + // The dimensions of the page in the document. + DocumentDimensions document_dimensions = 4; + + // Number of pages in the document. + int32 page_count = 5; +} + +// Example data used for training or prediction. +message ExamplePayload { + // Required. The example data. + oneof payload { + // Example image. + Image image = 1; + + // Example text. + TextSnippet text_snippet = 2; + + // Example document. + Document document = 4; + } +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/dataset.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/dataset.proto new file mode 100644 index 00000000000..f6f8fc7c4be --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/dataset.proto @@ -0,0 +1,95 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.automl.v1; + +import "google/api/resource.proto"; +import "google/cloud/automl/v1/image.proto"; +import "google/cloud/automl/v1/text.proto"; +import "google/cloud/automl/v1/translation.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// A workspace for solving a single, particular machine learning (ML) problem. +// A workspace contains examples that may be annotated. +message Dataset { + option (google.api.resource) = { + type: "automl.googleapis.com/Dataset" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}" + }; + + // Required. + // The dataset metadata that is specific to the problem type. + oneof dataset_metadata { + // Metadata for a dataset used for translation. + TranslationDatasetMetadata translation_dataset_metadata = 23; + + // Metadata for a dataset used for image classification. + ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + + // Metadata for a dataset used for text classification. + TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + + // Metadata for a dataset used for image object detection. + ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + + // Metadata for a dataset used for text extraction. + TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + + // Metadata for a dataset used for text sentiment. + TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + } + + // Output only. The resource name of the dataset. + // Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}` + string name = 1; + + // Required. The name of the dataset to show in the interface. The name can be + // up to 32 characters long and can consist only of ASCII Latin letters A-Z + // and a-z, underscores + // (_), and ASCII digits 0-9. + string display_name = 2; + + // User-provided description of the dataset. The description can be up to + // 25000 characters long. + string description = 3; + + // Output only. The number of examples in the dataset. + int32 example_count = 21; + + // Output only. Timestamp when this dataset was created. + google.protobuf.Timestamp create_time = 14; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 17; + + // Optional. The labels with user-defined metadata to organize your dataset. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // Label values are optional. Label keys must start with a letter. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + map labels = 39; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/detection.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/detection.proto new file mode 100644 index 00000000000..a76c3538d81 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/detection.proto @@ -0,0 +1,85 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.automl.v1; + +import "google/cloud/automl/v1/geometry.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Annotation details for image object detection. +message ImageObjectDetectionAnnotation { + // Output only. The rectangle representing the object location. + BoundingPoly bounding_box = 1; + + // Output only. The confidence that this annotation is positive for the parent example, + // value in [0, 1], higher means higher positivity confidence. + float score = 2; +} + +// Bounding box matching model metrics for a single intersection-over-union +// threshold and multiple label match confidence thresholds. +message BoundingBoxMetricsEntry { + // Metrics for a single confidence threshold. + message ConfidenceMetricsEntry { + // Output only. The confidence threshold value used to compute the metrics. + float confidence_threshold = 1; + + // Output only. Recall under the given confidence threshold. + float recall = 2; + + // Output only. Precision under the given confidence threshold. + float precision = 3; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 4; + } + + // Output only. The intersection-over-union threshold value used to compute + // this metrics entry. + float iou_threshold = 1; + + // Output only. The mean average precision, most often close to au_prc. + float mean_average_precision = 2; + + // Output only. Metrics for each label-match confidence_threshold from + // 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is + // derived from them. + repeated ConfidenceMetricsEntry confidence_metrics_entries = 3; +} + +// Model evaluation metrics for image object detection problems. +// Evaluates prediction quality of labeled bounding boxes. +message ImageObjectDetectionEvaluationMetrics { + // Output only. The total number of bounding boxes (i.e. summed over all + // images) the ground truth used to create this evaluation had. + int32 evaluated_bounding_box_count = 1; + + // Output only. The bounding boxes match metrics for each + // Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + // and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + // pair. + repeated BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + + // Output only. The single metric for bounding boxes evaluation: + // the mean_average_precision averaged over all bounding_box_metrics_entries. + float bounding_box_mean_average_precision = 3; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/geometry.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/geometry.proto new file mode 100644 index 00000000000..a4261d5eb09 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/geometry.proto @@ -0,0 +1,45 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.automl.v1; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// A vertex represents a 2D point in the image. +// The normalized vertex coordinates are between 0 to 1 fractions relative to +// the original plane (image, video). E.g. if the plane (e.g. whole image) would +// have size 10 x 20 then a point with normalized coordinates (0.1, 0.3) would +// be at the position (1, 6) on that plane. +message NormalizedVertex { + // Required. Horizontal coordinate. + float x = 1; + + // Required. Vertical coordinate. + float y = 2; +} + +// A bounding polygon of a detected object on a plane. +// On output both vertices and normalized_vertices are provided. +// The polygon is formed by connecting vertices in the order they are listed. +message BoundingPoly { + // Output only . The bounding polygon normalized vertices. + repeated NormalizedVertex normalized_vertices = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/image.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/image.proto new file mode 100644 index 00000000000..5fdc101bc7f --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/image.proto @@ -0,0 +1,201 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.automl.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/automl/v1/classification.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "ImageProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Dataset metadata that is specific to image classification. +message ImageClassificationDatasetMetadata { + // Required. Type of the classification problem. + ClassificationType classification_type = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Dataset metadata specific to image object detection. +message ImageObjectDetectionDatasetMetadata { + +} + +// Model metadata for image classification. +message ImageClassificationModelMetadata { + // Optional. The ID of the `base` model. If it is specified, the new model + // will be created based on the `base` model. Otherwise, the new model will be + // created from scratch. The `base` model must be in the same + // `project` and `location` as the new model to create, and have the same + // `model_type`. + string base_model_id = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The train budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. The actual + // `train_cost` will be equal or less than this value. If further model + // training ceases to provide any improvements, it will stop without using + // full budget and the stop_reason will be `MODEL_CONVERGED`. + // Note, node_hour = actual_hour * number_of_nodes_invovled. + // For model type `cloud`(default), the train budget must be between 8,000 + // and 800,000 milli node hours, inclusive. The default value is 192, 000 + // which represents one day in wall time. For model type + // `mobile-low-latency-1`, `mobile-versatile-1`, `mobile-high-accuracy-1`, + // `mobile-core-ml-low-latency-1`, `mobile-core-ml-versatile-1`, + // `mobile-core-ml-high-accuracy-1`, the train budget must be between 1,000 + // and 100,000 milli node hours, inclusive. The default value is 24, 000 which + // represents one day in wall time. + int64 train_budget_milli_node_hours = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The actual train cost of creating this model, expressed in + // milli node hours, i.e. 1,000 value in this field means 1 node hour. + // Guaranteed to not exceed the train budget. + int64 train_cost_milli_node_hours = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The reason that this create model operation stopped, + // e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + string stop_reason = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Type of the model. The available values are: + // * `cloud` - Model to be used via prediction calls to AutoML API. + // This is the default value. + // * `mobile-low-latency-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. Expected to have low latency, but + // may have lower prediction quality than other models. + // * `mobile-versatile-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. + // * `mobile-high-accuracy-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. Expected to have a higher + // latency, but should also have a higher prediction quality + // than other models. + // * `mobile-core-ml-low-latency-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with Core + // ML afterwards. Expected to have low latency, but may have + // lower prediction quality than other models. + // * `mobile-core-ml-versatile-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with Core + // ML afterwards. + // * `mobile-core-ml-high-accuracy-1` - A model that, in addition to + // providing prediction via AutoML API, can also be exported + // (see [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with + // Core ML afterwards. Expected to have a higher latency, but + // should also have a higher prediction quality than other + // models. + string model_type = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. An approximate number of online prediction QPS that can + // be supported by this model per each node on which it is deployed. + double node_qps = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of nodes this model is deployed on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the node_qps field. + int64 node_count = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Model metadata specific to image object detection. +message ImageObjectDetectionModelMetadata { + // Optional. Type of the model. The available values are: + // * `cloud-high-accuracy-1` - (default) A model to be used via prediction + // calls to AutoML API. Expected to have a higher latency, but + // should also have a higher prediction quality than other + // models. + // * `cloud-low-latency-1` - A model to be used via prediction + // calls to AutoML API. Expected to have low latency, but may + // have lower prediction quality than other models. + // * `mobile-low-latency-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. Expected to have low latency, but + // may have lower prediction quality than other models. + // * `mobile-versatile-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. + // * `mobile-high-accuracy-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. Expected to have a higher + // latency, but should also have a higher prediction quality + // than other models. + string model_type = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The number of nodes this model is deployed on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the qps_per_node field. + int64 node_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. An approximate number of online prediction QPS that can + // be supported by this model per each node on which it is deployed. + double node_qps = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The reason that this create model operation stopped, + // e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + string stop_reason = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The train budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. The actual + // `train_cost` will be equal or less than this value. If further model + // training ceases to provide any improvements, it will stop without using + // full budget and the stop_reason will be `MODEL_CONVERGED`. + // Note, node_hour = actual_hour * number_of_nodes_invovled. + // For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, + // the train budget must be between 20,000 and 900,000 milli node hours, + // inclusive. The default value is 216, 000 which represents one day in + // wall time. + // For model type `mobile-low-latency-1`, `mobile-versatile-1`, + // `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`, + // `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train + // budget must be between 1,000 and 100,000 milli node hours, inclusive. + // The default value is 24, 000 which represents one day in wall time. + int64 train_budget_milli_node_hours = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The actual train cost of creating this model, expressed in + // milli node hours, i.e. 1,000 value in this field means 1 node hour. + // Guaranteed to not exceed the train budget. + int64 train_cost_milli_node_hours = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Model deployment metadata specific to Image Classification. +message ImageClassificationModelDeploymentMetadata { + // Input only. The number of nodes to deploy the model on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the model's + // [node_qps][google.cloud.automl.v1.ImageClassificationModelMetadata.node_qps]. + // Must be between 1 and 100, inclusive on both ends. + int64 node_count = 1 [(google.api.field_behavior) = INPUT_ONLY]; +} + +// Model deployment metadata specific to Image Object Detection. +message ImageObjectDetectionModelDeploymentMetadata { + // Input only. The number of nodes to deploy the model on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the model's + // [qps_per_node][google.cloud.automl.v1.ImageObjectDetectionModelMetadata.qps_per_node]. + // Must be between 1 and 100, inclusive on both ends. + int64 node_count = 1 [(google.api.field_behavior) = INPUT_ONLY]; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/io.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/io.proto new file mode 100644 index 00000000000..9c32cf8651e --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/io.proto @@ -0,0 +1,1331 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.automl.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Input configuration for [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] action. +// +// The format of input depends on dataset_metadata the Dataset into which +// the import is happening has. As input source the +// [gcs_source][google.cloud.automl.v1.InputConfig.gcs_source] +// is expected, unless specified otherwise. Additionally any input .CSV file +// by itself must be 100MB or smaller, unless specified otherwise. +// If an "example" file (that is, image, video etc.) with identical content +// (even if it had different `GCS_FILE_PATH`) is mentioned multiple times, then +// its label, bounding boxes etc. are appended. The same file should be always +// provided with the same `ML_USE` and `GCS_FILE_PATH`, if it is not, then +// these values are nondeterministically selected from the given ones. +// +// The formats are represented in EBNF with commas being literal and with +// non-terminal symbols defined near the end of this comment. The formats are: +// +//

AutoML Vision

+// +// +//
Classification
+// +// See [Preparing your training +// data](https://cloud.google.com/vision/automl/docs/prepare) for more +// information. +// +// CSV file(s) with each line in format: +// +// ML_USE,GCS_FILE_PATH,LABEL,LABEL,... +// +// * `ML_USE` - Identifies the data set that the current row (file) applies +// to. +// This value can be one of the following: +// * `TRAIN` - Rows in this file are used to train the model. +// * `TEST` - Rows in this file are used to test the model during training. +// * `UNASSIGNED` - Rows in this file are not categorized. They are +// Automatically divided into train and test data. 80% for training and +// 20% for testing. +// +// * `GCS_FILE_PATH` - The Google Cloud Storage location of an image of up to +// 30MB in size. Supported extensions: .JPEG, .GIF, .PNG, .WEBP, .BMP, +// .TIFF, .ICO. +// +// * `LABEL` - A label that identifies the object in the image. +// +// For the `MULTICLASS` classification type, at most one `LABEL` is allowed +// per image. If an image has not yet been labeled, then it should be +// mentioned just once with no `LABEL`. +// +// Some sample rows: +// +// TRAIN,gs://folder/image1.jpg,daisy +// TEST,gs://folder/image2.jpg,dandelion,tulip,rose +// UNASSIGNED,gs://folder/image3.jpg,daisy +// UNASSIGNED,gs://folder/image4.jpg +// +// +//
Object Detection
+// See [Preparing your training +// data](https://cloud.google.com/vision/automl/object-detection/docs/prepare) +// for more information. +// +// A CSV file(s) with each line in format: +// +// ML_USE,GCS_FILE_PATH,[LABEL],(BOUNDING_BOX | ,,,,,,,) +// +// * `ML_USE` - Identifies the data set that the current row (file) applies +// to. +// This value can be one of the following: +// * `TRAIN` - Rows in this file are used to train the model. +// * `TEST` - Rows in this file are used to test the model during training. +// * `UNASSIGNED` - Rows in this file are not categorized. They are +// Automatically divided into train and test data. 80% for training and +// 20% for testing. +// +// * `GCS_FILE_PATH` - The Google Cloud Storage location of an image of up to +// 30MB in size. Supported extensions: .JPEG, .GIF, .PNG. Each image +// is assumed to be exhaustively labeled. +// +// * `LABEL` - A label that identifies the object in the image specified by the +// `BOUNDING_BOX`. +// +// * `BOUNDING BOX` - The vertices of an object in the example image. +// The minimum allowed `BOUNDING_BOX` edge length is 0.01, and no more than +// 500 `BOUNDING_BOX` instances per image are allowed (one `BOUNDING_BOX` +// per line). If an image has no looked for objects then it should be +// mentioned just once with no LABEL and the ",,,,,,," in place of the +// `BOUNDING_BOX`. +// +// **Four sample rows:** +// +// TRAIN,gs://folder/image1.png,car,0.1,0.1,,,0.3,0.3,, +// TRAIN,gs://folder/image1.png,bike,.7,.6,,,.8,.9,, +// UNASSIGNED,gs://folder/im2.png,car,0.1,0.1,0.2,0.1,0.2,0.3,0.1,0.3 +// TEST,gs://folder/im3.png,,,,,,,,, +//
+//
+// +// +//

AutoML Video Intelligence

+// +// +//
Classification
+// +// See [Preparing your training +// data](https://cloud.google.com/video-intelligence/automl/docs/prepare) for +// more information. +// +// CSV file(s) with each line in format: +// +// ML_USE,GCS_FILE_PATH +// +// For `ML_USE`, do not use `VALIDATE`. +// +// `GCS_FILE_PATH` is the path to another .csv file that describes training +// example for a given `ML_USE`, using the following row format: +// +// GCS_FILE_PATH,(LABEL,TIME_SEGMENT_START,TIME_SEGMENT_END | ,,) +// +// Here `GCS_FILE_PATH` leads to a video of up to 50GB in size and up +// to 3h duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI. +// +// `TIME_SEGMENT_START` and `TIME_SEGMENT_END` must be within the +// length of the video, and the end time must be after the start time. Any +// segment of a video which has one or more labels on it, is considered a +// hard negative for all other labels. Any segment with no labels on +// it is considered to be unknown. If a whole video is unknown, then +// it should be mentioned just once with ",," in place of `LABEL, +// TIME_SEGMENT_START,TIME_SEGMENT_END`. +// +// Sample top level CSV file: +// +// TRAIN,gs://folder/train_videos.csv +// TEST,gs://folder/test_videos.csv +// UNASSIGNED,gs://folder/other_videos.csv +// +// Sample rows of a CSV file for a particular ML_USE: +// +// gs://folder/video1.avi,car,120,180.000021 +// gs://folder/video1.avi,bike,150,180.000021 +// gs://folder/vid2.avi,car,0,60.5 +// gs://folder/vid3.avi,,, +// +// +// +//
Object Tracking
+// +// See [Preparing your training +// data](/video-intelligence/automl/object-tracking/docs/prepare) for more +// information. +// +// CSV file(s) with each line in format: +// +// ML_USE,GCS_FILE_PATH +// +// For `ML_USE`, do not use `VALIDATE`. +// +// `GCS_FILE_PATH` is the path to another .csv file that describes training +// example for a given `ML_USE`, using the following row format: +// +// GCS_FILE_PATH,LABEL,[INSTANCE_ID],TIMESTAMP,BOUNDING_BOX +// +// or +// +// GCS_FILE_PATH,,,,,,,,,, +// +// Here `GCS_FILE_PATH` leads to a video of up to 50GB in size and up +// to 3h duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI. +// Providing `INSTANCE_ID`s can help to obtain a better model. When +// a specific labeled entity leaves the video frame, and shows up +// afterwards it is not required, albeit preferable, that the same +// `INSTANCE_ID` is given to it. +// +// `TIMESTAMP` must be within the length of the video, the +// `BOUNDING_BOX` is assumed to be drawn on the closest video's frame +// to the `TIMESTAMP`. Any mentioned by the `TIMESTAMP` frame is expected +// to be exhaustively labeled and no more than 500 `BOUNDING_BOX`-es per +// frame are allowed. If a whole video is unknown, then it should be +// mentioned just once with ",,,,,,,,,," in place of `LABEL, +// [INSTANCE_ID],TIMESTAMP,BOUNDING_BOX`. +// +// Sample top level CSV file: +// +// TRAIN,gs://folder/train_videos.csv +// TEST,gs://folder/test_videos.csv +// UNASSIGNED,gs://folder/other_videos.csv +// +// Seven sample rows of a CSV file for a particular ML_USE: +// +// gs://folder/video1.avi,car,1,12.10,0.8,0.8,0.9,0.8,0.9,0.9,0.8,0.9 +// gs://folder/video1.avi,car,1,12.90,0.4,0.8,0.5,0.8,0.5,0.9,0.4,0.9 +// gs://folder/video1.avi,car,2,12.10,.4,.2,.5,.2,.5,.3,.4,.3 +// gs://folder/video1.avi,car,2,12.90,.8,.2,,,.9,.3,, +// gs://folder/video1.avi,bike,,12.50,.45,.45,,,.55,.55,, +// gs://folder/video2.avi,car,1,0,.1,.9,,,.9,.1,, +// gs://folder/video2.avi,,,,,,,,,,, +//
+//
+// +// +//

AutoML Natural Language

+// +// +//
Entity Extraction
+// +// See [Preparing your training +// data](/natural-language/automl/entity-analysis/docs/prepare) for more +// information. +// +// One or more CSV file(s) with each line in the following format: +// +// ML_USE,GCS_FILE_PATH +// +// * `ML_USE` - Identifies the data set that the current row (file) applies +// to. +// This value can be one of the following: +// * `TRAIN` - Rows in this file are used to train the model. +// * `TEST` - Rows in this file are used to test the model during training. +// * `UNASSIGNED` - Rows in this file are not categorized. They are +// Automatically divided into train and test data. 80% for training and +// 20% for testing.. +// +// * `GCS_FILE_PATH` - a Identifies JSON Lines (.JSONL) file stored in +// Google Cloud Storage that contains in-line text in-line as documents +// for model training. +// +// After the training data set has been determined from the `TRAIN` and +// `UNASSIGNED` CSV files, the training data is divided into train and +// validation data sets. 70% for training and 30% for validation. +// +// For example: +// +// TRAIN,gs://folder/file1.jsonl +// VALIDATE,gs://folder/file2.jsonl +// TEST,gs://folder/file3.jsonl +// +// **In-line JSONL files** +// +// In-line .JSONL files contain, per line, a JSON document that wraps a +// [`text_snippet`][google.cloud.automl.v1.TextSnippet] field followed by +// one or more [`annotations`][google.cloud.automl.v1.AnnotationPayload] +// fields, which have `display_name` and `text_extraction` fields to describe +// the entity from the text snippet. Multiple JSON documents can be separated +// using line breaks (\n). +// +// The supplied text must be annotated exhaustively. For example, if you +// include the text "horse", but do not label it as "animal", +// then "horse" is assumed to not be an "animal". +// +// Any given text snippet content must have 30,000 characters or +// less, and also be UTF-8 NFC encoded. ASCII is accepted as it is +// UTF-8 NFC encoded. +// +// For example: +// +// { +// "text_snippet": { +// "content": "dog car cat" +// }, +// "annotations": [ +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 0, "end_offset": 2} +// } +// }, +// { +// "display_name": "vehicle", +// "text_extraction": { +// "text_segment": {"start_offset": 4, "end_offset": 6} +// } +// }, +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 8, "end_offset": 10} +// } +// } +// ] +// }\n +// { +// "text_snippet": { +// "content": "This dog is good." +// }, +// "annotations": [ +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 5, "end_offset": 7} +// } +// } +// ] +// } +// +// **JSONL files that reference documents** +// +// .JSONL files contain, per line, a JSON document that wraps a +// `input_config` that contains the path to a source document. +// Multiple JSON documents can be separated using line breaks (\n). +// +// Supported document extensions: .PDF, .TIF, .TIFF +// +// For example: +// +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] +// } +// } +// } +// }\n +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document2.tif" ] +// } +// } +// } +// } +// +// **In-line JSONL files with document layout information** +// +// **Note:** You can only annotate documents using the UI. The format described +// below applies to annotated documents exported using the UI or `exportData`. +// +// In-line .JSONL files for documents contain, per line, a JSON document +// that wraps a `document` field that provides the textual content of the +// document and the layout information. +// +// For example: +// +// { +// "document": { +// "document_text": { +// "content": "dog car cat" +// } +// "layout": [ +// { +// "text_segment": { +// "start_offset": 0, +// "end_offset": 11, +// }, +// "page_number": 1, +// "bounding_poly": { +// "normalized_vertices": [ +// {"x": 0.1, "y": 0.1}, +// {"x": 0.1, "y": 0.3}, +// {"x": 0.3, "y": 0.3}, +// {"x": 0.3, "y": 0.1}, +// ], +// }, +// "text_segment_type": TOKEN, +// } +// ], +// "document_dimensions": { +// "width": 8.27, +// "height": 11.69, +// "unit": INCH, +// } +// "page_count": 3, +// }, +// "annotations": [ +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 0, "end_offset": 3} +// } +// }, +// { +// "display_name": "vehicle", +// "text_extraction": { +// "text_segment": {"start_offset": 4, "end_offset": 7} +// } +// }, +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 8, "end_offset": 11} +// } +// }, +// ], +// +// +// +// +//
Classification
+// +// See [Preparing your training +// data](https://cloud.google.com/natural-language/automl/docs/prepare) for more +// information. +// +// One or more CSV file(s) with each line in the following format: +// +// ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),LABEL,LABEL,... +// +// * `ML_USE` - Identifies the data set that the current row (file) applies +// to. +// This value can be one of the following: +// * `TRAIN` - Rows in this file are used to train the model. +// * `TEST` - Rows in this file are used to test the model during training. +// * `UNASSIGNED` - Rows in this file are not categorized. They are +// Automatically divided into train and test data. 80% for training and +// 20% for testing. +// +// * `TEXT_SNIPPET` and `GCS_FILE_PATH` are distinguished by a pattern. If +// the column content is a valid Google Cloud Storage file path, that is, +// prefixed by "gs://", it is treated as a `GCS_FILE_PATH`. Otherwise, if +// the content is enclosed in double quotes (""), it is treated as a +// `TEXT_SNIPPET`. For `GCS_FILE_PATH`, the path must lead to a +// file with supported extension and UTF-8 encoding, for example, +// "gs://folder/content.txt" AutoML imports the file content +// as a text snippet. For `TEXT_SNIPPET`, AutoML imports the column content +// excluding quotes. In both cases, size of the content must be 10MB or +// less in size. For zip files, the size of each file inside the zip must be +// 10MB or less in size. +// +// For the `MULTICLASS` classification type, at most one `LABEL` is allowed. +// +// The `ML_USE` and `LABEL` columns are optional. +// Supported file extensions: .TXT, .PDF, .TIF, .TIFF, .ZIP +// +// A maximum of 100 unique labels are allowed per CSV row. +// +// Sample rows: +// +// TRAIN,"They have bad food and very rude",RudeService,BadFood +// gs://folder/content.txt,SlowService +// TEST,gs://folder/document.pdf +// VALIDATE,gs://folder/text_files.zip,BadFood +// +// +// +//
Sentiment Analysis
+// +// See [Preparing your training +// data](https://cloud.google.com/natural-language/automl/docs/prepare) for more +// information. +// +// CSV file(s) with each line in format: +// +// ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),SENTIMENT +// +// * `ML_USE` - Identifies the data set that the current row (file) applies +// to. +// This value can be one of the following: +// * `TRAIN` - Rows in this file are used to train the model. +// * `TEST` - Rows in this file are used to test the model during training. +// * `UNASSIGNED` - Rows in this file are not categorized. They are +// Automatically divided into train and test data. 80% for training and +// 20% for testing. +// +// * `TEXT_SNIPPET` and `GCS_FILE_PATH` are distinguished by a pattern. If +// the column content is a valid Google Cloud Storage file path, that is, +// prefixed by "gs://", it is treated as a `GCS_FILE_PATH`. Otherwise, if +// the content is enclosed in double quotes (""), it is treated as a +// `TEXT_SNIPPET`. For `GCS_FILE_PATH`, the path must lead to a +// file with supported extension and UTF-8 encoding, for example, +// "gs://folder/content.txt" AutoML imports the file content +// as a text snippet. For `TEXT_SNIPPET`, AutoML imports the column content +// excluding quotes. In both cases, size of the content must be 128kB or +// less in size. For zip files, the size of each file inside the zip must be +// 128kB or less in size. +// +// The `ML_USE` and `SENTIMENT` columns are optional. +// Supported file extensions: .TXT, .PDF, .TIF, .TIFF, .ZIP +// +// * `SENTIMENT` - An integer between 0 and +// Dataset.text_sentiment_dataset_metadata.sentiment_max +// (inclusive). Describes the ordinal of the sentiment - higher +// value means a more positive sentiment. All the values are +// completely relative, i.e. neither 0 needs to mean a negative or +// neutral sentiment nor sentiment_max needs to mean a positive one - +// it is just required that 0 is the least positive sentiment +// in the data, and sentiment_max is the most positive one. +// The SENTIMENT shouldn't be confused with "score" or "magnitude" +// from the previous Natural Language Sentiment Analysis API. +// All SENTIMENT values between 0 and sentiment_max must be +// represented in the imported data. On prediction the same 0 to +// sentiment_max range will be used. The difference between +// neighboring sentiment values needs not to be uniform, e.g. 1 and +// 2 may be similar whereas the difference between 2 and 3 may be +// large. +// +// Sample rows: +// +// TRAIN,"@freewrytin this is way too good for your product",2 +// gs://folder/content.txt,3 +// TEST,gs://folder/document.pdf +// VALIDATE,gs://folder/text_files.zip,2 +//
+//
+// +// +// +//

AutoML Tables

+// +// See [Preparing your training +// data](https://cloud.google.com/automl-tables/docs/prepare) for more +// information. +// +// You can use either +// [gcs_source][google.cloud.automl.v1.InputConfig.gcs_source] or +// [bigquery_source][google.cloud.automl.v1.InputConfig.bigquery_source]. +// All input is concatenated into a +// single +// [primary_table_spec_id][google.cloud.automl.v1.TablesDatasetMetadata.primary_table_spec_id] +// +// **For gcs_source:** +// +// CSV file(s), where the first row of the first file is the header, +// containing unique column names. If the first row of a subsequent +// file is the same as the header, then it is also treated as a +// header. All other rows contain values for the corresponding +// columns. +// +// Each .CSV file by itself must be 10GB or smaller, and their total +// size must be 100GB or smaller. +// +// First three sample rows of a CSV file: +//
+// "Id","First Name","Last Name","Dob","Addresses"
+// "1","John","Doe","1968-01-22","[{"status":"current","address":"123_First_Avenue","city":"Seattle","state":"WA","zip":"11111","numberOfYears":"1"},{"status":"previous","address":"456_Main_Street","city":"Portland","state":"OR","zip":"22222","numberOfYears":"5"}]"
+// "2","Jane","Doe","1980-10-16","[{"status":"current","address":"789_Any_Avenue","city":"Albany","state":"NY","zip":"33333","numberOfYears":"2"},{"status":"previous","address":"321_Main_Street","city":"Hoboken","state":"NJ","zip":"44444","numberOfYears":"3"}]}
+// 
+// **For bigquery_source:** +// +// An URI of a BigQuery table. The user data size of the BigQuery +// table must be 100GB or smaller. +// +// An imported table must have between 2 and 1,000 columns, inclusive, +// and between 1000 and 100,000,000 rows, inclusive. There are at most 5 +// import data running in parallel. +// +//
+//
+// +// +// **Input field definitions:** +// +// `ML_USE` +// : ("TRAIN" | "VALIDATE" | "TEST" | "UNASSIGNED") +// Describes how the given example (file) should be used for model +// training. "UNASSIGNED" can be used when user has no preference. +// +// `GCS_FILE_PATH` +// : The path to a file on Google Cloud Storage. For example, +// "gs://folder/image1.png". +// +// `LABEL` +// : A display name of an object on an image, video etc., e.g. "dog". +// Must be up to 32 characters long and can consist only of ASCII +// Latin letters A-Z and a-z, underscores(_), and ASCII digits 0-9. +// For each label an AnnotationSpec is created which display_name +// becomes the label; AnnotationSpecs are given back in predictions. +// +// `INSTANCE_ID` +// : A positive integer that identifies a specific instance of a +// labeled entity on an example. Used e.g. to track two cars on +// a video while being able to tell apart which one is which. +// +// `BOUNDING_BOX` +// : (`VERTEX,VERTEX,VERTEX,VERTEX` | `VERTEX,,,VERTEX,,`) +// A rectangle parallel to the frame of the example (image, +// video). If 4 vertices are given they are connected by edges +// in the order provided, if 2 are given they are recognized +// as diagonally opposite vertices of the rectangle. +// +// `VERTEX` +// : (`COORDINATE,COORDINATE`) +// First coordinate is horizontal (x), the second is vertical (y). +// +// `COORDINATE` +// : A float in 0 to 1 range, relative to total length of +// image or video in given dimension. For fractions the +// leading non-decimal 0 can be omitted (i.e. 0.3 = .3). +// Point 0,0 is in top left. +// +// `TIME_SEGMENT_START` +// : (`TIME_OFFSET`) +// Expresses a beginning, inclusive, of a time segment +// within an example that has a time dimension +// (e.g. video). +// +// `TIME_SEGMENT_END` +// : (`TIME_OFFSET`) +// Expresses an end, exclusive, of a time segment within +// n example that has a time dimension (e.g. video). +// +// `TIME_OFFSET` +// : A number of seconds as measured from the start of an +// example (e.g. video). Fractions are allowed, up to a +// microsecond precision. "inf" is allowed, and it means the end +// of the example. +// +// `TEXT_SNIPPET` +// : The content of a text snippet, UTF-8 encoded, enclosed within +// double quotes (""). +// +// `DOCUMENT` +// : A field that provides the textual content with document and the layout +// information. +// +// +// **Errors:** +// +// If any of the provided CSV files can't be parsed or if more than certain +// percent of CSV rows cannot be processed then the operation fails and +// nothing is imported. Regardless of overall success or failure the per-row +// failures, up to a certain count cap, is listed in +// Operation.metadata.partial_failures. +// +message InputConfig { + // The source of the input. + oneof source { + // The Google Cloud Storage location for the input content. + // For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData], `gcs_source` points to a CSV file with + // a structure described in [InputConfig][google.cloud.automl.v1.InputConfig]. + GcsSource gcs_source = 1; + } + + // Additional domain-specific parameters describing the semantic of the + // imported data, any string must be up to 25000 + // characters long. + // + //

AutoML Tables

+ // + // `schema_inference_version` + // : (integer) This value must be supplied. + // The version of the + // algorithm to use for the initial inference of the + // column data types of the imported table. Allowed values: "1". + map params = 2; +} + +// Input configuration for BatchPredict Action. +// +// The format of input depends on the ML problem of the model used for +// prediction. As input source the +// [gcs_source][google.cloud.automl.v1.InputConfig.gcs_source] +// is expected, unless specified otherwise. +// +// The formats are represented in EBNF with commas being literal and with +// non-terminal symbols defined near the end of this comment. The formats +// are: +// +//

AutoML Vision

+//
Classification
+// +// One or more CSV files where each line is a single column: +// +// GCS_FILE_PATH +// +// The Google Cloud Storage location of an image of up to +// 30MB in size. Supported extensions: .JPEG, .GIF, .PNG. +// This path is treated as the ID in the batch predict output. +// +// Sample rows: +// +// gs://folder/image1.jpeg +// gs://folder/image2.gif +// gs://folder/image3.png +// +//
Object Detection
+// +// One or more CSV files where each line is a single column: +// +// GCS_FILE_PATH +// +// The Google Cloud Storage location of an image of up to +// 30MB in size. Supported extensions: .JPEG, .GIF, .PNG. +// This path is treated as the ID in the batch predict output. +// +// Sample rows: +// +// gs://folder/image1.jpeg +// gs://folder/image2.gif +// gs://folder/image3.png +//
+//
+// +//

AutoML Video Intelligence

+//
Classification
+// +// One or more CSV files where each line is a single column: +// +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END +// +// `GCS_FILE_PATH` is the Google Cloud Storage location of video up to 50GB in +// size and up to 3h in duration duration. +// Supported extensions: .MOV, .MPEG4, .MP4, .AVI. +// +// `TIME_SEGMENT_START` and `TIME_SEGMENT_END` must be within the +// length of the video, and the end time must be after the start time. +// +// Sample rows: +// +// gs://folder/video1.mp4,10,40 +// gs://folder/video1.mp4,20,60 +// gs://folder/vid2.mov,0,inf +// +//
Object Tracking
+// +// One or more CSV files where each line is a single column: +// +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END +// +// `GCS_FILE_PATH` is the Google Cloud Storage location of video up to 50GB in +// size and up to 3h in duration duration. +// Supported extensions: .MOV, .MPEG4, .MP4, .AVI. +// +// `TIME_SEGMENT_START` and `TIME_SEGMENT_END` must be within the +// length of the video, and the end time must be after the start time. +// +// Sample rows: +// +// gs://folder/video1.mp4,10,40 +// gs://folder/video1.mp4,20,60 +// gs://folder/vid2.mov,0,inf +//
+//
+// +//

AutoML Natural Language

+//
Classification
+// +// One or more CSV files where each line is a single column: +// +// GCS_FILE_PATH +// +// `GCS_FILE_PATH` is the Google Cloud Storage location of a text file. +// Supported file extensions: .TXT, .PDF, .TIF, .TIFF +// +// Text files can be no larger than 10MB in size. +// +// Sample rows: +// +// gs://folder/text1.txt +// gs://folder/text2.pdf +// gs://folder/text3.tif +// +//
Sentiment Analysis
+// One or more CSV files where each line is a single column: +// +// GCS_FILE_PATH +// +// `GCS_FILE_PATH` is the Google Cloud Storage location of a text file. +// Supported file extensions: .TXT, .PDF, .TIF, .TIFF +// +// Text files can be no larger than 128kB in size. +// +// Sample rows: +// +// gs://folder/text1.txt +// gs://folder/text2.pdf +// gs://folder/text3.tif +// +//
Entity Extraction
+// +// One or more JSONL (JSON Lines) files that either provide inline text or +// documents. You can only use one format, either inline text or documents, +// for a single call to [AutoMl.BatchPredict]. +// +// Each JSONL file contains a per line a proto that +// wraps a temporary user-assigned TextSnippet ID (string up to 2000 +// characters long) called "id", a TextSnippet proto (in +// JSON representation) and zero or more TextFeature protos. Any given +// text snippet content must have 30,000 characters or less, and also +// be UTF-8 NFC encoded (ASCII already is). The IDs provided should be +// unique. +// +// Each document JSONL file contains, per line, a proto that wraps a Document +// proto with `input_config` set. Each document cannot exceed 2MB in size. +// +// Supported document extensions: .PDF, .TIF, .TIFF +// +// Each JSONL file must not exceed 100MB in size, and no more than 20 +// JSONL files may be passed. +// +// Sample inline JSONL file (Shown with artificial line +// breaks. Actual line breaks are denoted by "\n".): +// +// { +// "id": "my_first_id", +// "text_snippet": { "content": "dog car cat"}, +// "text_features": [ +// { +// "text_segment": {"start_offset": 4, "end_offset": 6}, +// "structural_type": PARAGRAPH, +// "bounding_poly": { +// "normalized_vertices": [ +// {"x": 0.1, "y": 0.1}, +// {"x": 0.1, "y": 0.3}, +// {"x": 0.3, "y": 0.3}, +// {"x": 0.3, "y": 0.1}, +// ] +// }, +// } +// ], +// }\n +// { +// "id": "2", +// "text_snippet": { +// "content": "Extended sample content", +// "mime_type": "text/plain" +// } +// } +// +// Sample document JSONL file (Shown with artificial line +// breaks. Actual line breaks are denoted by "\n".): +// +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] +// } +// } +// } +// }\n +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document2.tif" ] +// } +// } +// } +// } +//
+//
+// +//

AutoML Tables

+// +// See [Preparing your training +// data](https://cloud.google.com/automl-tables/docs/predict-batch) for more +// information. +// +// You can use either +// [gcs_source][google.cloud.automl.v1.BatchPredictInputConfig.gcs_source] +// or +// [bigquery_source][BatchPredictInputConfig.bigquery_source]. +// +// **For gcs_source:** +// +// CSV file(s), each by itself 10GB or smaller and total size must be +// 100GB or smaller, where first file must have a header containing +// column names. If the first row of a subsequent file is the same as +// the header, then it is also treated as a header. All other rows +// contain values for the corresponding columns. +// +// The column names must contain the model's +// [input_feature_column_specs'][google.cloud.automl.v1.TablesModelMetadata.input_feature_column_specs] +// [display_name-s][google.cloud.automl.v1.ColumnSpec.display_name] +// (order doesn't matter). The columns corresponding to the model's +// input feature column specs must contain values compatible with the +// column spec's data types. Prediction on all the rows, i.e. the CSV +// lines, will be attempted. +// +// +// Sample rows from a CSV file: +//
+// "First Name","Last Name","Dob","Addresses"
+// "John","Doe","1968-01-22","[{"status":"current","address":"123_First_Avenue","city":"Seattle","state":"WA","zip":"11111","numberOfYears":"1"},{"status":"previous","address":"456_Main_Street","city":"Portland","state":"OR","zip":"22222","numberOfYears":"5"}]"
+// "Jane","Doe","1980-10-16","[{"status":"current","address":"789_Any_Avenue","city":"Albany","state":"NY","zip":"33333","numberOfYears":"2"},{"status":"previous","address":"321_Main_Street","city":"Hoboken","state":"NJ","zip":"44444","numberOfYears":"3"}]}
+// 
+// **For bigquery_source:** +// +// The URI of a BigQuery table. The user data size of the BigQuery +// table must be 100GB or smaller. +// +// The column names must contain the model's +// [input_feature_column_specs'][google.cloud.automl.v1.TablesModelMetadata.input_feature_column_specs] +// [display_name-s][google.cloud.automl.v1.ColumnSpec.display_name] +// (order doesn't matter). The columns corresponding to the model's +// input feature column specs must contain values compatible with the +// column spec's data types. Prediction on all the rows of the table +// will be attempted. +//
+//
+// +// **Input field definitions:** +// +// `GCS_FILE_PATH` +// : The path to a file on Google Cloud Storage. For example, +// "gs://folder/video.avi". +// +// `TIME_SEGMENT_START` +// : (`TIME_OFFSET`) +// Expresses a beginning, inclusive, of a time segment +// within an example that has a time dimension +// (e.g. video). +// +// `TIME_SEGMENT_END` +// : (`TIME_OFFSET`) +// Expresses an end, exclusive, of a time segment within +// n example that has a time dimension (e.g. video). +// +// `TIME_OFFSET` +// : A number of seconds as measured from the start of an +// example (e.g. video). Fractions are allowed, up to a +// microsecond precision. "inf" is allowed, and it means the end +// of the example. +// +// **Errors:** +// +// If any of the provided CSV files can't be parsed or if more than certain +// percent of CSV rows cannot be processed then the operation fails and +// prediction does not happen. Regardless of overall success or failure the +// per-row failures, up to a certain count cap, will be listed in +// Operation.metadata.partial_failures. +message BatchPredictInputConfig { + // The source of the input. + oneof source { + // Required. The Google Cloud Storage location for the input content. + GcsSource gcs_source = 1 [(google.api.field_behavior) = REQUIRED]; + } +} + +// Input configuration of a [Document][google.cloud.automl.v1.Document]. +message DocumentInputConfig { + // The Google Cloud Storage location of the document file. Only a single path + // should be given. + // + // Max supported size: 512MB. + // + // Supported extensions: .PDF. + GcsSource gcs_source = 1; +} + +// * For Translation: +// CSV file `translation.csv`, with each line in format: +// ML_USE,GCS_FILE_PATH +// GCS_FILE_PATH leads to a .TSV file which describes examples that have +// given ML_USE, using the following row format per line: +// TEXT_SNIPPET (in source language) \t TEXT_SNIPPET (in target +// language) +// +// * For Tables: +// Output depends on whether the dataset was imported from Google Cloud +// Storage or BigQuery. +// Google Cloud Storage case: +// [gcs_destination][google.cloud.automl.v1p1beta.OutputConfig.gcs_destination] +// must be set. Exported are CSV file(s) `tables_1.csv`, +// `tables_2.csv`,...,`tables_N.csv` with each having as header line +// the table's column names, and all other lines contain values for +// the header columns. +// BigQuery case: +// [bigquery_destination][google.cloud.automl.v1p1beta.OutputConfig.bigquery_destination] +// pointing to a BigQuery project must be set. In the given project a +// new dataset will be created with name +// `export_data__` +// where will be made +// BigQuery-dataset-name compatible (e.g. most special characters will +// become underscores), and timestamp will be in +// YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In that +// dataset a new table called `primary_table` will be created, and +// filled with precisely the same data as this obtained on import. +message OutputConfig { + // The destination of the output. + oneof destination { + // Required. The Google Cloud Storage location where the output is to be written to. + // For Image Object Detection, Text Extraction, Video Classification and + // Tables, in the given directory a new directory will be created with name: + // export_data-- where + // timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export + // output will be written into that directory. + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; + } +} + +// Output configuration for BatchPredict Action. +// +// As destination the +// [gcs_destination][google.cloud.automl.v1.BatchPredictOutputConfig.gcs_destination] +// must be set unless specified otherwise for a domain. If gcs_destination is +// set then in the given directory a new directory is created. Its name +// will be +// "prediction--", +// where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. The contents +// of it depends on the ML problem the predictions are made for. +// +// * For Image Classification: +// In the created directory files `image_classification_1.jsonl`, +// `image_classification_2.jsonl`,...,`image_classification_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of the successfully predicted images and annotations. +// A single image will be listed only once with all its annotations, +// and its annotations will never be split across files. +// Each .JSONL file will contain, per line, a JSON representation of a +// proto that wraps image's "ID" : "" followed by a list of +// zero or more AnnotationPayload protos (called annotations), which +// have classification detail populated. +// If prediction for any image failed (partially or completely), then an +// additional `errors_1.jsonl`, `errors_2.jsonl`,..., `errors_N.jsonl` +// files will be created (N depends on total number of failed +// predictions). These files will have a JSON representation of a proto +// that wraps the same "ID" : "" but here followed by +// exactly one +// [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`fields. +// +// * For Image Object Detection: +// In the created directory files `image_object_detection_1.jsonl`, +// `image_object_detection_2.jsonl`,...,`image_object_detection_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of the successfully predicted images and annotations. +// Each .JSONL file will contain, per line, a JSON representation of a +// proto that wraps image's "ID" : "" followed by a list of +// zero or more AnnotationPayload protos (called annotations), which +// have image_object_detection detail populated. A single image will +// be listed only once with all its annotations, and its annotations +// will never be split across files. +// If prediction for any image failed (partially or completely), then +// additional `errors_1.jsonl`, `errors_2.jsonl`,..., `errors_N.jsonl` +// files will be created (N depends on total number of failed +// predictions). These files will have a JSON representation of a proto +// that wraps the same "ID" : "" but here followed by +// exactly one +// [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`fields. +// * For Video Classification: +// In the created directory a video_classification.csv file, and a .JSON +// file per each video classification requested in the input (i.e. each +// line in given CSV(s)), will be created. +// +// The format of video_classification.csv is: +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END,JSON_FILE_NAME,STATUS +// where: +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END = matches 1 to 1 +// the prediction input lines (i.e. video_classification.csv has +// precisely the same number of lines as the prediction input had.) +// JSON_FILE_NAME = Name of .JSON file in the output directory, which +// contains prediction responses for the video time segment. +// STATUS = "OK" if prediction completed successfully, or an error code +// with message otherwise. If STATUS is not "OK" then the .JSON file +// for that line may not exist or be empty. +// +// Each .JSON file, assuming STATUS is "OK", will contain a list of +// AnnotationPayload protos in JSON format, which are the predictions +// for the video time segment the file is assigned to in the +// video_classification.csv. All AnnotationPayload protos will have +// video_classification field set, and will be sorted by +// video_classification.type field (note that the returned types are +// governed by `classifaction_types` parameter in +// [PredictService.BatchPredictRequest.params][]). +// +// * For Video Object Tracking: +// In the created directory a video_object_tracking.csv file will be +// created, and multiple files video_object_trackinng_1.json, +// video_object_trackinng_2.json,..., video_object_trackinng_N.json, +// where N is the number of requests in the input (i.e. the number of +// lines in given CSV(s)). +// +// The format of video_object_tracking.csv is: +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END,JSON_FILE_NAME,STATUS +// where: +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END = matches 1 to 1 +// the prediction input lines (i.e. video_object_tracking.csv has +// precisely the same number of lines as the prediction input had.) +// JSON_FILE_NAME = Name of .JSON file in the output directory, which +// contains prediction responses for the video time segment. +// STATUS = "OK" if prediction completed successfully, or an error +// code with message otherwise. If STATUS is not "OK" then the .JSON +// file for that line may not exist or be empty. +// +// Each .JSON file, assuming STATUS is "OK", will contain a list of +// AnnotationPayload protos in JSON format, which are the predictions +// for each frame of the video time segment the file is assigned to in +// video_object_tracking.csv. All AnnotationPayload protos will have +// video_object_tracking field set. +// * For Text Classification: +// In the created directory files `text_classification_1.jsonl`, +// `text_classification_2.jsonl`,...,`text_classification_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of inputs and annotations found. +// +// Each .JSONL file will contain, per line, a JSON representation of a +// proto that wraps input text file (or document) in +// the text snippet (or document) proto and a list of +// zero or more AnnotationPayload protos (called annotations), which +// have classification detail populated. A single text file (or +// document) will be listed only once with all its annotations, and its +// annotations will never be split across files. +// +// If prediction for any input file (or document) failed (partially or +// completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,..., +// `errors_N.jsonl` files will be created (N depends on total number of +// failed predictions). These files will have a JSON representation of a +// proto that wraps input file followed by exactly one +// [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`. +// +// * For Text Sentiment: +// In the created directory files `text_sentiment_1.jsonl`, +// `text_sentiment_2.jsonl`,...,`text_sentiment_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of inputs and annotations found. +// +// Each .JSONL file will contain, per line, a JSON representation of a +// proto that wraps input text file (or document) in +// the text snippet (or document) proto and a list of +// zero or more AnnotationPayload protos (called annotations), which +// have text_sentiment detail populated. A single text file (or +// document) will be listed only once with all its annotations, and its +// annotations will never be split across files. +// +// If prediction for any input file (or document) failed (partially or +// completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,..., +// `errors_N.jsonl` files will be created (N depends on total number of +// failed predictions). These files will have a JSON representation of a +// proto that wraps input file followed by exactly one +// [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`. +// +// * For Text Extraction: +// In the created directory files `text_extraction_1.jsonl`, +// `text_extraction_2.jsonl`,...,`text_extraction_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of inputs and annotations found. +// The contents of these .JSONL file(s) depend on whether the input +// used inline text, or documents. +// If input was inline, then each .JSONL file will contain, per line, +// a JSON representation of a proto that wraps given in request text +// snippet's "id" (if specified), followed by input text snippet, +// and a list of zero or more +// AnnotationPayload protos (called annotations), which have +// text_extraction detail populated. A single text snippet will be +// listed only once with all its annotations, and its annotations will +// never be split across files. +// If input used documents, then each .JSONL file will contain, per +// line, a JSON representation of a proto that wraps given in request +// document proto, followed by its OCR-ed representation in the form +// of a text snippet, finally followed by a list of zero or more +// AnnotationPayload protos (called annotations), which have +// text_extraction detail populated and refer, via their indices, to +// the OCR-ed text snippet. A single document (and its text snippet) +// will be listed only once with all its annotations, and its +// annotations will never be split across files. +// If prediction for any text snippet failed (partially or completely), +// then additional `errors_1.jsonl`, `errors_2.jsonl`,..., +// `errors_N.jsonl` files will be created (N depends on total number of +// failed predictions). These files will have a JSON representation of a +// proto that wraps either the "id" : "" (in case of inline) +// or the document proto (in case of document) but here followed by +// exactly one +// [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`. +// +// * For Tables: +// Output depends on whether +// [gcs_destination][google.cloud.automl.v1p1beta.BatchPredictOutputConfig.gcs_destination] +// or +// [bigquery_destination][google.cloud.automl.v1p1beta.BatchPredictOutputConfig.bigquery_destination] +// is set (either is allowed). +// Google Cloud Storage case: +// In the created directory files `tables_1.csv`, `tables_2.csv`,..., +// `tables_N.csv` will be created, where N may be 1, and depends on +// the total number of the successfully predicted rows. +// For all CLASSIFICATION +// [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]: +// Each .csv file will contain a header, listing all columns' +// [display_name-s][google.cloud.automl.v1p1beta.ColumnSpec.display_name] +// given on input followed by M target column names in the format of +// "<[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec] +// [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]>__score" where M is the number of distinct target values, +// i.e. number of distinct values in the target column of the table +// used to train the model. Subsequent lines will contain the +// respective values of successfully predicted rows, with the last, +// i.e. the target, columns having the corresponding prediction +// [scores][google.cloud.automl.v1p1beta.TablesAnnotation.score]. +// For REGRESSION and FORECASTING +// [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]: +// Each .csv file will contain a header, listing all columns' +// [display_name-s][google.cloud.automl.v1p1beta.display_name] +// given on input followed by the predicted target column with name +// in the format of +// "predicted_<[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec] +// [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]>" +// Subsequent lines will contain the respective values of +// successfully predicted rows, with the last, i.e. the target, +// column having the predicted target value. +// If prediction for any rows failed, then an additional +// `errors_1.csv`, `errors_2.csv`,..., `errors_N.csv` will be +// created (N depends on total number of failed rows). These files +// will have analogous format as `tables_*.csv`, but always with a +// single target column having +// [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// represented as a JSON string, and containing only `code` and +// `message`. +// BigQuery case: +// [bigquery_destination][google.cloud.automl.v1p1beta.OutputConfig.bigquery_destination] +// pointing to a BigQuery project must be set. In the given project a +// new dataset will be created with name +// `prediction__` +// where will be made +// BigQuery-dataset-name compatible (e.g. most special characters will +// become underscores), and timestamp will be in +// YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In the dataset +// two tables will be created, `predictions`, and `errors`. +// The `predictions` table's column names will be the input columns' +// [display_name-s][google.cloud.automl.v1p1beta.ColumnSpec.display_name] +// followed by the target column with name in the format of +// "predicted_<[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec] +// [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]>" +// The input feature columns will contain the respective values of +// successfully predicted rows, with the target column having an +// ARRAY of +// [AnnotationPayloads][google.cloud.automl.v1p1beta.AnnotationPayload], +// represented as STRUCT-s, containing +// [TablesAnnotation][google.cloud.automl.v1p1beta.TablesAnnotation]. +// The `errors` table contains rows for which the prediction has +// failed, it has analogous input columns while the target column name +// is in the format of +// "errors_<[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec] +// [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]>", +// and as a value has +// [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// represented as a STRUCT, and containing only `code` and `message`. +message BatchPredictOutputConfig { + // The destination of the output. + oneof destination { + // Required. The Google Cloud Storage location of the directory where the output is to + // be written to. + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; + } +} + +// Output configuration for ModelExport Action. +message ModelExportOutputConfig { + // The destination of the output. + oneof destination { + // Required. The Google Cloud Storage location where the model is to be written to. + // This location may only be set for the following model formats: + // "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml". + // + // Under the directory given as the destination a new one with name + // "model-export--", + // where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format, + // will be created. Inside the model and any of its supporting files + // will be written. + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The format in which the model must be exported. The available, and default, + // formats depend on the problem and model type (if given problem and type + // combination doesn't have a format listed, it means its models are not + // exportable): + // + // * For Image Classification mobile-low-latency-1, mobile-versatile-1, + // mobile-high-accuracy-1: + // "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js", + // "docker". + // + // * For Image Classification mobile-core-ml-low-latency-1, + // mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1: + // "core_ml" (default). + // + // * For Image Object Detection mobile-low-latency-1, mobile-versatile-1, + // mobile-high-accuracy-1: + // "tflite", "tf_saved_model", "tf_js". + // Formats description: + // + // * tflite - Used for Android mobile devices. + // * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/) + // devices. + // * tf_saved_model - A tensorflow model in SavedModel format. + // * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can + // be used in the browser and in Node.js using JavaScript. + // * docker - Used for Docker containers. Use the params field to customize + // the container. The container is verified to work correctly on + // ubuntu 16.04 operating system. See more at + // [containers + // quickstart](https://cloud.google.com/vision/automl/docs/containers-gcs-quickstart) + // * core_ml - Used for iOS mobile devices. + string model_format = 4; + + // Additional model-type and format specific parameters describing the + // requirements for the to be exported model files, any string must be up to + // 25000 characters long. + // + // * For `docker` format: + // `cpu_architecture` - (string) "x86_64" (default). + // `gpu_architecture` - (string) "none" (default), "nvidia". + map params = 2; +} + +// The Google Cloud Storage location for the input content. +message GcsSource { + // Required. Google Cloud Storage URIs to input files, up to 2000 + // characters long. Accepted forms: + // * Full object path, e.g. gs://bucket/directory/object.csv + repeated string input_uris = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The Google Cloud Storage location where the output is to be written to. +message GcsDestination { + // Required. Google Cloud Storage URI to output directory, up to 2000 + // characters long. + // Accepted forms: + // * Prefix path: gs://bucket/directory + // The requesting user must have write permission to the bucket. + // The directory is created if it doesn't exist. + string output_uri_prefix = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/model.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/model.proto new file mode 100644 index 00000000000..3543f3d6a4e --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/model.proto @@ -0,0 +1,111 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.automl.v1; + +import "google/api/resource.proto"; +import "google/cloud/automl/v1/image.proto"; +import "google/cloud/automl/v1/text.proto"; +import "google/cloud/automl/v1/translation.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// API proto representing a trained machine learning model. +message Model { + option (google.api.resource) = { + type: "automl.googleapis.com/Model" + pattern: "projects/{project}/locations/{location}/models/{model}" + }; + + // Deployment state of the model. + enum DeploymentState { + // Should not be used, an un-set enum has this value by default. + DEPLOYMENT_STATE_UNSPECIFIED = 0; + + // Model is deployed. + DEPLOYED = 1; + + // Model is not deployed. + UNDEPLOYED = 2; + } + + // Required. + // The model metadata that is specific to the problem type. + // Must match the metadata type of the dataset used to train the model. + oneof model_metadata { + // Metadata for translation models. + TranslationModelMetadata translation_model_metadata = 15; + + // Metadata for image classification models. + ImageClassificationModelMetadata image_classification_model_metadata = 13; + + // Metadata for text classification models. + TextClassificationModelMetadata text_classification_model_metadata = 14; + + // Metadata for image object detection models. + ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + + // Metadata for text extraction models. + TextExtractionModelMetadata text_extraction_model_metadata = 19; + + // Metadata for text sentiment models. + TextSentimentModelMetadata text_sentiment_model_metadata = 22; + } + + // Output only. Resource name of the model. + // Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` + string name = 1; + + // Required. The name of the model to show in the interface. The name can be + // up to 32 characters long and can consist only of ASCII Latin letters A-Z + // and a-z, underscores + // (_), and ASCII digits 0-9. It must start with a letter. + string display_name = 2; + + // Required. The resource ID of the dataset used to create the model. The dataset must + // come from the same ancestor project and location. + string dataset_id = 3; + + // Output only. Timestamp when the model training finished and can be used for prediction. + google.protobuf.Timestamp create_time = 7; + + // Output only. Timestamp when this model was last updated. + google.protobuf.Timestamp update_time = 11; + + // Output only. Deployment state of the model. A model can only serve + // prediction requests after it gets deployed. + DeploymentState deployment_state = 8; + + // Used to perform a consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 10; + + // Optional. The labels with user-defined metadata to organize your model. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // Label values are optional. Label keys must start with a letter. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + map labels = 34; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/model_evaluation.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/model_evaluation.proto new file mode 100644 index 00000000000..5bedf4050c6 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/model_evaluation.proto @@ -0,0 +1,101 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.automl.v1; + +import "google/api/resource.proto"; +import "google/cloud/automl/v1/classification.proto"; +import "google/cloud/automl/v1/detection.proto"; +import "google/cloud/automl/v1/text_extraction.proto"; +import "google/cloud/automl/v1/text_sentiment.proto"; +import "google/cloud/automl/v1/translation.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Evaluation results of a model. +message ModelEvaluation { + option (google.api.resource) = { + type: "automl.googleapis.com/ModelEvaluation" + pattern: "projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}" + }; + + // Output only. Problem type specific evaluation metrics. + oneof metrics { + // Model evaluation metrics for image, text, video and tables + // classification. + // Tables problem is considered a classification when the target column + // is CATEGORY DataType. + ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + + // Model evaluation metrics for translation. + TranslationEvaluationMetrics translation_evaluation_metrics = 9; + + // Model evaluation metrics for image object detection. + ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + + // Evaluation metrics for text sentiment models. + TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + + // Evaluation metrics for text extraction models. + TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; + } + + // Output only. Resource name of the model evaluation. + // Format: + // `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}` + string name = 1; + + // Output only. The ID of the annotation spec that the model evaluation applies to. The + // The ID is empty for the overall model evaluation. + // For Tables annotation specs in the dataset do not exist and this ID is + // always not set, but for CLASSIFICATION + // [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] + // the + // [display_name][google.cloud.automl.v1.ModelEvaluation.display_name] + // field is used. + string annotation_spec_id = 2; + + // Output only. The value of + // [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + // at the moment when the model was trained. Because this field returns a + // value at model training time, for different models trained from the same + // dataset, the values may differ, since display names could had been changed + // between the two model's trainings. For Tables CLASSIFICATION + // [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] + // distinct values of the target column at the moment of the model evaluation + // are populated here. + // The display_name is empty for the overall model evaluation. + string display_name = 15; + + // Output only. Timestamp when this model evaluation was created. + google.protobuf.Timestamp create_time = 5; + + // Output only. The number of examples used for model evaluation, i.e. for + // which ground truth from time of model creation is compared against the + // predicted annotations created by the model. + // For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is + // the total number of all examples used for evaluation. + // Otherwise, this is the count of examples that according to the ground + // truth were annotated by the + // [annotation_spec_id][google.cloud.automl.v1.ModelEvaluation.annotation_spec_id]. + int32 evaluated_example_count = 6; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/operations.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/operations.proto new file mode 100644 index 00000000000..21801093f37 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/operations.proto @@ -0,0 +1,164 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.automl.v1; + +import "google/cloud/automl/v1/io.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Metadata used across all long running operations returned by AutoML API. +message OperationMetadata { + // Ouptut only. Details of specific operation. Even if this field is empty, + // the presence allows to distinguish different types of operations. + oneof details { + // Details of a Delete operation. + DeleteOperationMetadata delete_details = 8; + + // Details of a DeployModel operation. + DeployModelOperationMetadata deploy_model_details = 24; + + // Details of an UndeployModel operation. + UndeployModelOperationMetadata undeploy_model_details = 25; + + // Details of CreateModel operation. + CreateModelOperationMetadata create_model_details = 10; + + // Details of CreateDataset operation. + CreateDatasetOperationMetadata create_dataset_details = 30; + + // Details of ImportData operation. + ImportDataOperationMetadata import_data_details = 15; + + // Details of BatchPredict operation. + BatchPredictOperationMetadata batch_predict_details = 16; + + // Details of ExportData operation. + ExportDataOperationMetadata export_data_details = 21; + + // Details of ExportModel operation. + ExportModelOperationMetadata export_model_details = 22; + } + + // Output only. Progress of operation. Range: [0, 100]. + // Not used currently. + int32 progress_percent = 13; + + // Output only. Partial failures encountered. + // E.g. single files that couldn't be read. + // This field should never exceed 20 entries. + // Status details field will contain standard GCP error details. + repeated google.rpc.Status partial_failures = 2; + + // Output only. Time when the operation was created. + google.protobuf.Timestamp create_time = 3; + + // Output only. Time when the operation was updated for the last time. + google.protobuf.Timestamp update_time = 4; +} + +// Details of operations that perform deletes of any entities. +message DeleteOperationMetadata { + +} + +// Details of DeployModel operation. +message DeployModelOperationMetadata { + +} + +// Details of UndeployModel operation. +message UndeployModelOperationMetadata { + +} + +// Details of CreateDataset operation. +message CreateDatasetOperationMetadata { + +} + +// Details of CreateModel operation. +message CreateModelOperationMetadata { + +} + +// Details of ImportData operation. +message ImportDataOperationMetadata { + +} + +// Details of ExportData operation. +message ExportDataOperationMetadata { + // Further describes this export data's output. + // Supplements + // [OutputConfig][google.cloud.automl.v1.OutputConfig]. + message ExportDataOutputInfo { + // The output location to which the exported data is written. + oneof output_location { + // The full path of the Google Cloud Storage directory created, into which + // the exported data is written. + string gcs_output_directory = 1; + } + } + + // Output only. Information further describing this export data's output. + ExportDataOutputInfo output_info = 1; +} + +// Details of BatchPredict operation. +message BatchPredictOperationMetadata { + // Further describes this batch predict's output. + // Supplements + // [BatchPredictOutputConfig][google.cloud.automl.v1.BatchPredictOutputConfig]. + message BatchPredictOutputInfo { + // The output location into which prediction output is written. + oneof output_location { + // The full path of the Google Cloud Storage directory created, into which + // the prediction output is written. + string gcs_output_directory = 1; + } + } + + // Output only. The input config that was given upon starting this + // batch predict operation. + BatchPredictInputConfig input_config = 1; + + // Output only. Information further describing this batch predict's output. + BatchPredictOutputInfo output_info = 2; +} + +// Details of ExportModel operation. +message ExportModelOperationMetadata { + // Further describes the output of model export. + // Supplements + // [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]. + message ExportModelOutputInfo { + // The full path of the Google Cloud Storage directory created, into which + // the model will be exported. + string gcs_output_directory = 1; + } + + // Output only. Information further describing the output of this model + // export. + ExportModelOutputInfo output_info = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/prediction_service.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/prediction_service.proto new file mode 100644 index 00000000000..5d1d80c48cf --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/prediction_service.proto @@ -0,0 +1,321 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.automl.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/automl/v1/annotation_payload.proto"; +import "google/cloud/automl/v1/data_items.proto"; +import "google/cloud/automl/v1/io.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "PredictionServiceProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// AutoML Prediction API. +// +// On any input that is documented to expect a string parameter in +// snake_case or dash-case, either of those cases is accepted. +service PredictionService { + option (google.api.default_host) = "automl.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Perform an online prediction. The prediction result is directly + // returned in the response. + // Available for following ML scenarios, and their expected request payloads: + // + // AutoML Vision Classification + // + // * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. + // + // AutoML Vision Object Detection + // + // * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. + // + // AutoML Natural Language Classification + // + // * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in + // .PDF, .TIF or .TIFF format with size upto 2MB. + // + // AutoML Natural Language Entity Extraction + // + // * A TextSnippet up to 10,000 characters, UTF-8 NFC encoded or a document + // in .PDF, .TIF or .TIFF format with size upto 20MB. + // + // AutoML Natural Language Sentiment Analysis + // + // * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in + // .PDF, .TIF or .TIFF format with size upto 2MB. + // + // AutoML Translation + // + // * A TextSnippet up to 25,000 characters, UTF-8 encoded. + // + // AutoML Tables + // + // * A row with column values matching + // the columns of the model, up to 5MB. Not available for FORECASTING + // `prediction_type`. + rpc Predict(PredictRequest) returns (PredictResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/models/*}:predict" + body: "*" + }; + option (google.api.method_signature) = "name,payload,params"; + } + + // Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1.PredictionService.Predict], batch + // prediction result won't be immediately available in the response. Instead, + // a long running operation object is returned. User can poll the operation + // result via [GetOperation][google.longrunning.Operations.GetOperation] + // method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in + // the [response][google.longrunning.Operation.response] field. + // Available for following ML scenarios: + // + // * AutoML Vision Classification + // * AutoML Vision Object Detection + // * AutoML Video Intelligence Classification + // * AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification + // * AutoML Natural Language Entity Extraction + // * AutoML Natural Language Sentiment Analysis + // * AutoML Tables + rpc BatchPredict(BatchPredictRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/models/*}:batchPredict" + body: "*" + }; + option (google.api.method_signature) = "name,input_config,output_config,params"; + option (google.longrunning.operation_info) = { + response_type: "BatchPredictResult" + metadata_type: "OperationMetadata" + }; + } +} + +// Request message for [PredictionService.Predict][google.cloud.automl.v1.PredictionService.Predict]. +message PredictRequest { + // Required. Name of the model requested to serve the prediction. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; + + // Required. Payload to perform a prediction on. The payload must match the + // problem type that the model was trained to solve. + ExamplePayload payload = 2 [(google.api.field_behavior) = REQUIRED]; + + // Additional domain-specific parameters, any string must be up to 25000 + // characters long. + // + // AutoML Vision Classification + // + // `score_threshold` + // : (float) A value from 0.0 to 1.0. When the model + // makes predictions for an image, it will only produce results that have + // at least this confidence score. The default is 0.5. + // + // AutoML Vision Object Detection + // + // `score_threshold` + // : (float) When Model detects objects on the image, + // it will only produce bounding boxes which have at least this + // confidence score. Value in 0 to 1 range, default is 0.5. + // + // `max_bounding_box_count` + // : (int64) The maximum number of bounding + // boxes returned. The default is 100. The + // number of returned bounding boxes might be limited by the server. + // + // AutoML Tables + // + // `feature_importance` + // : (boolean) Whether + // [feature_importance][google.cloud.automl.v1.TablesModelColumnInfo.feature_importance] + // is populated in the returned list of + // [TablesAnnotation][google.cloud.automl.v1.TablesAnnotation] + // objects. The default is false. + map params = 3; +} + +// Response message for [PredictionService.Predict][google.cloud.automl.v1.PredictionService.Predict]. +message PredictResponse { + // Prediction result. + // AutoML Translation and AutoML Natural Language Sentiment Analysis + // return precisely one payload. + repeated AnnotationPayload payload = 1; + + // The preprocessed example that AutoML actually makes prediction on. + // Empty if AutoML does not preprocess the input example. + // + // For AutoML Natural Language (Classification, Entity Extraction, and + // Sentiment Analysis), if the input is a document, the recognized text is + // returned in the + // [document_text][google.cloud.automl.v1.Document.document_text] + // property. + ExamplePayload preprocessed_input = 3; + + // Additional domain-specific prediction response metadata. + // + // AutoML Vision Object Detection + // + // `max_bounding_box_count` + // : (int64) The maximum number of bounding boxes to return per image. + // + // AutoML Natural Language Sentiment Analysis + // + // `sentiment_score` + // : (float, deprecated) A value between -1 and 1, + // -1 maps to least positive sentiment, while 1 maps to the most positive + // one and the higher the score, the more positive the sentiment in the + // document is. Yet these values are relative to the training data, so + // e.g. if all data was positive then -1 is also positive (though + // the least). + // `sentiment_score` is not the same as "score" and "magnitude" + // from Sentiment Analysis in the Natural Language API. + map metadata = 2; +} + +// Request message for [PredictionService.BatchPredict][google.cloud.automl.v1.PredictionService.BatchPredict]. +message BatchPredictRequest { + // Required. Name of the model requested to serve the batch prediction. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; + + // Required. The input configuration for batch prediction. + BatchPredictInputConfig input_config = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Configuration specifying where output predictions should + // be written. + BatchPredictOutputConfig output_config = 4 [(google.api.field_behavior) = REQUIRED]; + + // Additional domain-specific parameters for the predictions, any string must + // be up to 25000 characters long. + // + // AutoML Natural Language Classification + // + // `score_threshold` + // : (float) A value from 0.0 to 1.0. When the model + // makes predictions for a text snippet, it will only produce results + // that have at least this confidence score. The default is 0.5. + // + // + // AutoML Vision Classification + // + // `score_threshold` + // : (float) A value from 0.0 to 1.0. When the model + // makes predictions for an image, it will only produce results that + // have at least this confidence score. The default is 0.5. + // + // AutoML Vision Object Detection + // + // `score_threshold` + // : (float) When Model detects objects on the image, + // it will only produce bounding boxes which have at least this + // confidence score. Value in 0 to 1 range, default is 0.5. + // + // `max_bounding_box_count` + // : (int64) The maximum number of bounding + // boxes returned per image. The default is 100, the + // number of bounding boxes returned might be limited by the server. + // AutoML Video Intelligence Classification + // + // `score_threshold` + // : (float) A value from 0.0 to 1.0. When the model + // makes predictions for a video, it will only produce results that + // have at least this confidence score. The default is 0.5. + // + // `segment_classification` + // : (boolean) Set to true to request + // segment-level classification. AutoML Video Intelligence returns + // labels and their confidence scores for the entire segment of the + // video that user specified in the request configuration. + // The default is true. + // + // `shot_classification` + // : (boolean) Set to true to request shot-level + // classification. AutoML Video Intelligence determines the boundaries + // for each camera shot in the entire segment of the video that user + // specified in the request configuration. AutoML Video Intelligence + // then returns labels and their confidence scores for each detected + // shot, along with the start and end time of the shot. + // The default is false. + // + // WARNING: Model evaluation is not done for this classification type, + // the quality of it depends on training data, but there are no metrics + // provided to describe that quality. + // + // `1s_interval_classification` + // : (boolean) Set to true to request + // classification for a video at one-second intervals. AutoML Video + // Intelligence returns labels and their confidence scores for each + // second of the entire segment of the video that user specified in the + // request configuration. The default is false. + // + // WARNING: Model evaluation is not done for this classification + // type, the quality of it depends on training data, but there are no + // metrics provided to describe that quality. + // + // AutoML Video Intelligence Object Tracking + // + // `score_threshold` + // : (float) When Model detects objects on video frames, + // it will only produce bounding boxes which have at least this + // confidence score. Value in 0 to 1 range, default is 0.5. + // + // `max_bounding_box_count` + // : (int64) The maximum number of bounding + // boxes returned per image. The default is 100, the + // number of bounding boxes returned might be limited by the server. + // + // `min_bounding_box_size` + // : (float) Only bounding boxes with shortest edge + // at least that long as a relative value of video frame size are + // returned. Value in 0 to 1 range. Default is 0. + // + map params = 5; +} + +// Result of the Batch Predict. This message is returned in +// [response][google.longrunning.Operation.response] of the operation returned +// by the [PredictionService.BatchPredict][google.cloud.automl.v1.PredictionService.BatchPredict]. +message BatchPredictResult { + // Additional domain-specific prediction response metadata. + // + // AutoML Vision Object Detection + // + // `max_bounding_box_count` + // : (int64) The maximum number of bounding boxes returned per image. + // + // AutoML Video Intelligence Object Tracking + // + // `max_bounding_box_count` + // : (int64) The maximum number of bounding boxes returned per frame. + map metadata = 1; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/service.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/service.proto new file mode 100644 index 00000000000..ea5dc36fbbc --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/service.proto @@ -0,0 +1,607 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.automl.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/automl/v1/annotation_payload.proto"; +import "google/cloud/automl/v1/annotation_spec.proto"; +import "google/cloud/automl/v1/dataset.proto"; +import "google/cloud/automl/v1/image.proto"; +import "google/cloud/automl/v1/io.proto"; +import "google/cloud/automl/v1/model.proto"; +import "google/cloud/automl/v1/model_evaluation.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "AutoMlProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// AutoML Server API. +// +// The resource names are assigned by the server. +// The server never reuses names that it has created after the resources with +// those names are deleted. +// +// An ID of a resource is the last element of the item's resource name. For +// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then +// the id for the item is `{dataset_id}`. +// +// Currently the only supported `location_id` is "us-central1". +// +// On any input that is documented to expect a string parameter in +// snake_case or dash-case, either of those cases is accepted. +service AutoMl { + option (google.api.default_host) = "automl.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a dataset. + rpc CreateDataset(CreateDatasetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/datasets" + body: "dataset" + }; + option (google.api.method_signature) = "parent,dataset"; + option (google.longrunning.operation_info) = { + response_type: "Dataset" + metadata_type: "OperationMetadata" + }; + } + + // Gets a dataset. + rpc GetDataset(GetDatasetRequest) returns (Dataset) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/datasets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists datasets in a project. + rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/datasets" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a dataset. + rpc UpdateDataset(UpdateDatasetRequest) returns (Dataset) { + option (google.api.http) = { + patch: "/v1/{dataset.name=projects/*/locations/*/datasets/*}" + body: "dataset" + }; + option (google.api.method_signature) = "dataset,update_mask"; + } + + // Deletes a dataset and all of its contents. + // Returns empty response in the + // [response][google.longrunning.Operation.response] field when it completes, + // and `delete_details` in the + // [metadata][google.longrunning.Operation.metadata] field. + rpc DeleteDataset(DeleteDatasetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/datasets/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Imports data into a dataset. + // For Tables this method can only be called on an empty Dataset. + // + // For Tables: + // * A + // [schema_inference_version][google.cloud.automl.v1.InputConfig.params] + // parameter must be explicitly set. + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc ImportData(ImportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/datasets/*}:importData" + body: "*" + }; + option (google.api.method_signature) = "name,input_config"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Exports dataset's data to the provided output location. + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc ExportData(ExportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/datasets/*}:exportData" + body: "*" + }; + option (google.api.method_signature) = "name,output_config"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Gets an annotation spec. + rpc GetAnnotationSpec(GetAnnotationSpecRequest) returns (AnnotationSpec) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a model. + // Returns a Model in the [response][google.longrunning.Operation.response] + // field when it completes. + // When you create a model, several model evaluations are created for it: + // a global evaluation, and one evaluation for each annotation spec. + rpc CreateModel(CreateModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/models" + body: "model" + }; + option (google.api.method_signature) = "parent,model"; + option (google.longrunning.operation_info) = { + response_type: "Model" + metadata_type: "OperationMetadata" + }; + } + + // Gets a model. + rpc GetModel(GetModelRequest) returns (Model) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/models/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists models. + rpc ListModels(ListModelsRequest) returns (ListModelsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/models" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a model. + // Returns `google.protobuf.Empty` in the + // [response][google.longrunning.Operation.response] field when it completes, + // and `delete_details` in the + // [metadata][google.longrunning.Operation.metadata] field. + rpc DeleteModel(DeleteModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/models/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Updates a model. + rpc UpdateModel(UpdateModelRequest) returns (Model) { + option (google.api.http) = { + patch: "/v1/{model.name=projects/*/locations/*/models/*}" + body: "model" + }; + option (google.api.method_signature) = "model,update_mask"; + } + + // Deploys a model. If a model is already deployed, deploying it with the + // same parameters has no effect. Deploying with different parametrs + // (as e.g. changing + // [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number]) + // will reset the deployment state without pausing the model's availability. + // + // Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage + // deployment automatically. + // + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc DeployModel(DeployModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/models/*}:deploy" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Undeploys a model. If the model is not deployed this method has no effect. + // + // Only applicable for Text Classification, Image Object Detection and Tables; + // all other domains manage deployment automatically. + // + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc UndeployModel(UndeployModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/models/*}:undeploy" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Exports a trained, "export-able", model to a user specified Google Cloud + // Storage location. A model is considered export-able if and only if it has + // an export format defined for it in + // [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]. + // + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc ExportModel(ExportModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/models/*}:export" + body: "*" + }; + option (google.api.method_signature) = "name,output_config"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Gets a model evaluation. + rpc GetModelEvaluation(GetModelEvaluationRequest) returns (ModelEvaluation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/models/*/modelEvaluations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists model evaluations. + rpc ListModelEvaluations(ListModelEvaluationsRequest) returns (ListModelEvaluationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/models/*}/modelEvaluations" + }; + option (google.api.method_signature) = "parent,filter"; + } +} + +// Request message for [AutoMl.CreateDataset][google.cloud.automl.v1.AutoMl.CreateDataset]. +message CreateDatasetRequest { + // Required. The resource name of the project to create the dataset for. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The dataset to create. + Dataset dataset = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.GetDataset][google.cloud.automl.v1.AutoMl.GetDataset]. +message GetDatasetRequest { + // Required. The resource name of the dataset to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + } + ]; +} + +// Request message for [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets]. +message ListDatasetsRequest { + // Required. The resource name of the project from which to list datasets. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // An expression for filtering the results of the request. + // + // * `dataset_metadata` - for existence of the case (e.g. + // `image_classification_dataset_metadata:*`). Some examples of using the filter are: + // + // * `translation_dataset_metadata:*` --> The dataset has + // `translation_dataset_metadata`. + string filter = 3; + + // Requested page size. Server may return fewer results than requested. + // If unspecified, server will pick a default size. + int32 page_size = 4; + + // A token identifying a page of results for the server to return + // Typically obtained via + // [ListDatasetsResponse.next_page_token][google.cloud.automl.v1.ListDatasetsResponse.next_page_token] of the previous + // [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets]. +message ListDatasetsResponse { + // The datasets read. + repeated Dataset datasets = 1; + + // A token to retrieve next page of results. + // Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [AutoMl.UpdateDataset][google.cloud.automl.v1.AutoMl.UpdateDataset] +message UpdateDatasetRequest { + // Required. The dataset which replaces the resource on the server. + Dataset dataset = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.DeleteDataset][google.cloud.automl.v1.AutoMl.DeleteDataset]. +message DeleteDatasetRequest { + // Required. The resource name of the dataset to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + } + ]; +} + +// Request message for [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData]. +message ImportDataRequest { + // Required. Dataset name. Dataset must already exist. All imported + // annotations and examples will be added. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + } + ]; + + // Required. The desired input location and its domain specific semantics, + // if any. + InputConfig input_config = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.ExportData][google.cloud.automl.v1.AutoMl.ExportData]. +message ExportDataRequest { + // Required. The resource name of the dataset. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + } + ]; + + // Required. The desired output location. + OutputConfig output_config = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.GetAnnotationSpec][google.cloud.automl.v1.AutoMl.GetAnnotationSpec]. +message GetAnnotationSpecRequest { + // Required. The resource name of the annotation spec to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/AnnotationSpec" + } + ]; +} + +// Request message for [AutoMl.CreateModel][google.cloud.automl.v1.AutoMl.CreateModel]. +message CreateModelRequest { + // Required. Resource name of the parent project where the model is being created. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The model to create. + Model model = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.GetModel][google.cloud.automl.v1.AutoMl.GetModel]. +message GetModelRequest { + // Required. Resource name of the model. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; +} + +// Request message for [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels]. +message ListModelsRequest { + // Required. Resource name of the project, from which to list the models. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // An expression for filtering the results of the request. + // + // * `model_metadata` - for existence of the case (e.g. + // `video_classification_model_metadata:*`). + // * `dataset_id` - for = or !=. Some examples of using the filter are: + // + // * `image_classification_model_metadata:*` --> The model has + // `image_classification_model_metadata`. + // * `dataset_id=5` --> The model was created from a dataset with ID 5. + string filter = 3; + + // Requested page size. + int32 page_size = 4; + + // A token identifying a page of results for the server to return + // Typically obtained via + // [ListModelsResponse.next_page_token][google.cloud.automl.v1.ListModelsResponse.next_page_token] of the previous + // [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels]. +message ListModelsResponse { + // List of models in the requested page. + repeated Model model = 1; + + // A token to retrieve next page of results. + // Pass to [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [AutoMl.DeleteModel][google.cloud.automl.v1.AutoMl.DeleteModel]. +message DeleteModelRequest { + // Required. Resource name of the model being deleted. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; +} + +// Request message for [AutoMl.UpdateModel][google.cloud.automl.v1.AutoMl.UpdateModel] +message UpdateModelRequest { + // Required. The model which replaces the resource on the server. + Model model = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.DeployModel][google.cloud.automl.v1.AutoMl.DeployModel]. +message DeployModelRequest { + // The per-domain specific deployment parameters. + oneof model_deployment_metadata { + // Model deployment metadata specific to Image Object Detection. + ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + + // Model deployment metadata specific to Image Classification. + ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + } + + // Required. Resource name of the model to deploy. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; +} + +// Request message for [AutoMl.UndeployModel][google.cloud.automl.v1.AutoMl.UndeployModel]. +message UndeployModelRequest { + // Required. Resource name of the model to undeploy. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; +} + +// Request message for [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]. +// Models need to be enabled for exporting, otherwise an error code will be +// returned. +message ExportModelRequest { + // Required. The resource name of the model to export. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; + + // Required. The desired output location and configuration. + ModelExportOutputConfig output_config = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.GetModelEvaluation][google.cloud.automl.v1.AutoMl.GetModelEvaluation]. +message GetModelEvaluationRequest { + // Required. Resource name for the model evaluation. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/ModelEvaluation" + } + ]; +} + +// Request message for [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations]. +message ListModelEvaluationsRequest { + // Required. Resource name of the model to list the model evaluations for. + // If modelId is set as "-", this will list model evaluations from across all + // models of the parent location. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; + + // Required. An expression for filtering the results of the request. + // + // * `annotation_spec_id` - for =, != or existence. See example below for + // the last. + // + // Some examples of using the filter are: + // + // * `annotation_spec_id!=4` --> The model evaluation was done for + // annotation spec with ID different than 4. + // * `NOT annotation_spec_id:*` --> The model evaluation was done for + // aggregate of all annotation specs. + string filter = 3 [(google.api.field_behavior) = REQUIRED]; + + // Requested page size. + int32 page_size = 4; + + // A token identifying a page of results for the server to return. + // Typically obtained via + // [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token] of the previous + // [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations]. +message ListModelEvaluationsResponse { + // List of model evaluations in the requested page. + repeated ModelEvaluation model_evaluation = 1; + + // A token to retrieve next page of results. + // Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1.ListModelEvaluationsRequest.page_token] field of a new + // [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] request to obtain that page. + string next_page_token = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/text.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text.proto new file mode 100644 index 00000000000..e227347f931 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text.proto @@ -0,0 +1,65 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.automl.v1; + +import "google/cloud/automl/v1/classification.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "TextProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Dataset metadata for classification. +message TextClassificationDatasetMetadata { + // Required. Type of the classification problem. + ClassificationType classification_type = 1; +} + +// Model metadata that is specific to text classification. +message TextClassificationModelMetadata { + // Output only. Classification type of the dataset used to train this model. + ClassificationType classification_type = 3; +} + +// Dataset metadata that is specific to text extraction +message TextExtractionDatasetMetadata { + +} + +// Model metadata that is specific to text extraction. +message TextExtractionModelMetadata { + +} + +// Dataset metadata for text sentiment. +message TextSentimentDatasetMetadata { + // Required. A sentiment is expressed as an integer ordinal, where higher value + // means a more positive sentiment. The range of sentiments that will be used + // is between 0 and sentiment_max (inclusive on both ends), and all the values + // in the range must be represented in the dataset before a model can be + // created. + // sentiment_max value must be between 1 and 10 (inclusive). + int32 sentiment_max = 1; +} + +// Model metadata that is specific to text sentiment. +message TextSentimentModelMetadata { + +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_extraction.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_extraction.proto new file mode 100644 index 00000000000..239299e8859 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_extraction.proto @@ -0,0 +1,68 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.automl.v1; + +import "google/cloud/automl/v1/text_segment.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Annotation for identifying spans of text. +message TextExtractionAnnotation { + // Required. Text extraction annotations can either be a text segment or a + // text relation. + oneof annotation { + // An entity annotation will set this, which is the part of the original + // text to which the annotation pertains. + TextSegment text_segment = 3; + } + + // Output only. A confidence estimate between 0.0 and 1.0. A higher value + // means greater confidence in correctness of the annotation. + float score = 1; +} + +// Model evaluation metrics for text extraction problems. +message TextExtractionEvaluationMetrics { + // Metrics for a single confidence threshold. + message ConfidenceMetricsEntry { + // Output only. The confidence threshold value used to compute the metrics. + // Only annotations with score of at least this threshold are considered to + // be ones the model would return. + float confidence_threshold = 1; + + // Output only. Recall under the given confidence threshold. + float recall = 3; + + // Output only. Precision under the given confidence threshold. + float precision = 4; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 5; + } + + // Output only. The Area under precision recall curve metric. + float au_prc = 1; + + // Output only. Metrics that have confidence thresholds. + // Precision-recall curve can be derived from it. + repeated ConfidenceMetricsEntry confidence_metrics_entries = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_segment.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_segment.proto new file mode 100644 index 00000000000..36bf4f34341 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_segment.proto @@ -0,0 +1,40 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.automl.v1; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "TextSegmentProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// A contiguous part of a text (string), assuming it has an UTF-8 NFC encoding. +message TextSegment { + // Output only. The content of the TextSegment. + string content = 3; + + // Required. Zero-based character index of the first character of the text + // segment (counting characters from the beginning of the text). + int64 start_offset = 1; + + // Required. Zero-based character index of the first character past the end of + // the text segment (counting character from the beginning of the text). + // The character at the end_offset is NOT included in the text segment. + int64 end_offset = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_sentiment.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_sentiment.proto new file mode 100644 index 00000000000..865459ea67c --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_sentiment.proto @@ -0,0 +1,77 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.automl.v1; + +import "google/cloud/automl/v1/classification.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "TextSentimentProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Contains annotation details specific to text sentiment. +message TextSentimentAnnotation { + // Output only. The sentiment with the semantic, as given to the + // [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when populating the dataset from which the model used + // for the prediction had been trained. + // The sentiment values are between 0 and + // Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive), + // with higher value meaning more positive sentiment. They are completely + // relative, i.e. 0 means least positive sentiment and sentiment_max means + // the most positive from the sentiments present in the train data. Therefore + // e.g. if train data had only negative sentiment, then sentiment_max, would + // be still negative (although least negative). + // The sentiment shouldn't be confused with "score" or "magnitude" + // from the previous Natural Language Sentiment Analysis API. + int32 sentiment = 1; +} + +// Model evaluation metrics for text sentiment problems. +message TextSentimentEvaluationMetrics { + // Output only. Precision. + float precision = 1; + + // Output only. Recall. + float recall = 2; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 3; + + // Output only. Mean absolute error. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float mean_absolute_error = 4; + + // Output only. Mean squared error. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float mean_squared_error = 5; + + // Output only. Linear weighted kappa. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float linear_kappa = 6; + + // Output only. Quadratic weighted kappa. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float quadratic_kappa = 7; + + // Output only. Confusion matrix of the evaluation. + // Only set for the overall model evaluation, not for evaluation of a single + // annotation spec. + ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/translation.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/translation.proto new file mode 100644 index 00000000000..05b37d62707 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/translation.proto @@ -0,0 +1,69 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.automl.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/automl/v1/data_items.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "TranslationProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Dataset metadata that is specific to translation. +message TranslationDatasetMetadata { + // Required. The BCP-47 language code of the source language. + string source_language_code = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The BCP-47 language code of the target language. + string target_language_code = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Evaluation metrics for the dataset. +message TranslationEvaluationMetrics { + // Output only. BLEU score. + double bleu_score = 1; + + // Output only. BLEU score for base model. + double base_bleu_score = 2; +} + +// Model metadata that is specific to translation. +message TranslationModelMetadata { + // The resource name of the model to use as a baseline to train the custom + // model. If unset, we use the default base model provided by Google + // Translate. Format: + // `projects/{project_id}/locations/{location_id}/models/{model_id}` + string base_model = 1; + + // Output only. Inferred from the dataset. + // The source language (The BCP-47 language code) that is used for training. + string source_language_code = 2; + + // Output only. The target language (The BCP-47 language code) that is used + // for training. + string target_language_code = 3; +} + +// Annotation details specific to translation. +message TranslationAnnotation { + // Output only . The translated content. + TextSnippet translated_content = 1; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/annotation_payload.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/annotation_payload.proto new file mode 100644 index 00000000000..5794c2391de --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/annotation_payload.proto @@ -0,0 +1,75 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + +import "google/cloud/automl/v1beta1/classification.proto"; +import "google/cloud/automl/v1beta1/detection.proto"; +import "google/cloud/automl/v1beta1/tables.proto"; +import "google/cloud/automl/v1beta1/text_extraction.proto"; +import "google/cloud/automl/v1beta1/text_sentiment.proto"; +import "google/cloud/automl/v1beta1/translation.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Contains annotation information that is relevant to AutoML. +message AnnotationPayload { + // Output only . Additional information about the annotation + // specific to the AutoML domain. + oneof detail { + // Annotation details for translation. + TranslationAnnotation translation = 2; + + // Annotation details for content or image classification. + ClassificationAnnotation classification = 3; + + // Annotation details for image object detection. + ImageObjectDetectionAnnotation image_object_detection = 4; + + // Annotation details for video classification. + // Returned for Video Classification predictions. + VideoClassificationAnnotation video_classification = 9; + + // Annotation details for video object tracking. + VideoObjectTrackingAnnotation video_object_tracking = 8; + + // Annotation details for text extraction. + TextExtractionAnnotation text_extraction = 6; + + // Annotation details for text sentiment. + TextSentimentAnnotation text_sentiment = 7; + + // Annotation details for Tables. + TablesAnnotation tables = 10; + } + + // Output only . The resource ID of the annotation spec that + // this annotation pertains to. The annotation spec comes from either an + // ancestor dataset, or the dataset that was used to train the model in use. + string annotation_spec_id = 1; + + // Output only. The value of + // [display_name][google.cloud.automl.v1beta1.AnnotationSpec.display_name] + // when the model was trained. Because this field returns a value at model + // training time, for different models trained using the same dataset, the + // returned value could be different as model owner could update the + // `display_name` between any two model training. + string display_name = 5; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/annotation_spec.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/annotation_spec.proto new file mode 100644 index 00000000000..4072ddde458 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/annotation_spec.proto @@ -0,0 +1,47 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// A definition of an annotation spec. +message AnnotationSpec { + option (google.api.resource) = { + type: "automl.googleapis.com/AnnotationSpec" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}" + }; + + // Output only. Resource name of the annotation spec. + // Form: + // + // 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}' + string name = 1; + + // Required. The name of the annotation spec to show in the interface. The name can be + // up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`. + string display_name = 2; + + // Output only. The number of examples in the parent dataset + // labeled by the annotation spec. + int32 example_count = 9; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/classification.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/classification.proto new file mode 100644 index 00000000000..7a1b83a286c --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/classification.proto @@ -0,0 +1,215 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + +import "google/cloud/automl/v1beta1/temporal.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_outer_classname = "ClassificationProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Type of the classification problem. +enum ClassificationType { + // An un-set value of this enum. + CLASSIFICATION_TYPE_UNSPECIFIED = 0; + + // At most one label is allowed per example. + MULTICLASS = 1; + + // Multiple labels are allowed for one example. + MULTILABEL = 2; +} + +// Contains annotation details specific to classification. +message ClassificationAnnotation { + // Output only. A confidence estimate between 0.0 and 1.0. A higher value + // means greater confidence that the annotation is positive. If a user + // approves an annotation as negative or positive, the score value remains + // unchanged. If a user creates an annotation, the score is 0 for negative or + // 1 for positive. + float score = 1; +} + +// Contains annotation details specific to video classification. +message VideoClassificationAnnotation { + // Output only. Expresses the type of video classification. Possible values: + // + // * `segment` - Classification done on a specified by user + // time segment of a video. AnnotationSpec is answered to be present + // in that time segment, if it is present in any part of it. The video + // ML model evaluations are done only for this type of classification. + // + // * `shot`- Shot-level classification. + // AutoML Video Intelligence determines the boundaries + // for each camera shot in the entire segment of the video that user + // specified in the request configuration. AutoML Video Intelligence + // then returns labels and their confidence scores for each detected + // shot, along with the start and end time of the shot. + // WARNING: Model evaluation is not done for this classification type, + // the quality of it depends on training data, but there are no + // metrics provided to describe that quality. + // + // * `1s_interval` - AutoML Video Intelligence returns labels and their + // confidence scores for each second of the entire segment of the video + // that user specified in the request configuration. + // WARNING: Model evaluation is not done for this classification type, + // the quality of it depends on training data, but there are no + // metrics provided to describe that quality. + string type = 1; + + // Output only . The classification details of this annotation. + ClassificationAnnotation classification_annotation = 2; + + // Output only . The time segment of the video to which the + // annotation applies. + TimeSegment time_segment = 3; +} + +// Model evaluation metrics for classification problems. +// Note: For Video Classification this metrics only describe quality of the +// Video Classification predictions of "segment_classification" type. +message ClassificationEvaluationMetrics { + // Metrics for a single confidence threshold. + message ConfidenceMetricsEntry { + // Output only. Metrics are computed with an assumption that the model + // never returns predictions with score lower than this value. + float confidence_threshold = 1; + + // Output only. Metrics are computed with an assumption that the model + // always returns at most this many predictions (ordered by their score, + // descendingly), but they all still need to meet the confidence_threshold. + int32 position_threshold = 14; + + // Output only. Recall (True Positive Rate) for the given confidence + // threshold. + float recall = 2; + + // Output only. Precision for the given confidence threshold. + float precision = 3; + + // Output only. False Positive Rate for the given confidence threshold. + float false_positive_rate = 8; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 4; + + // Output only. The Recall (True Positive Rate) when only considering the + // label that has the highest prediction score and not below the confidence + // threshold for each example. + float recall_at1 = 5; + + // Output only. The precision when only considering the label that has the + // highest prediction score and not below the confidence threshold for each + // example. + float precision_at1 = 6; + + // Output only. The False Positive Rate when only considering the label that + // has the highest prediction score and not below the confidence threshold + // for each example. + float false_positive_rate_at1 = 9; + + // Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1]. + float f1_score_at1 = 7; + + // Output only. The number of model created labels that match a ground truth + // label. + int64 true_positive_count = 10; + + // Output only. The number of model created labels that do not match a + // ground truth label. + int64 false_positive_count = 11; + + // Output only. The number of ground truth labels that are not matched + // by a model created label. + int64 false_negative_count = 12; + + // Output only. The number of labels that were not created by the model, + // but if they would, they would not match a ground truth label. + int64 true_negative_count = 13; + } + + // Confusion matrix of the model running the classification. + message ConfusionMatrix { + // Output only. A row in the confusion matrix. + message Row { + // Output only. Value of the specific cell in the confusion matrix. + // The number of values each row has (i.e. the length of the row) is equal + // to the length of the `annotation_spec_id` field or, if that one is not + // populated, length of the [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + repeated int32 example_count = 1; + } + + // Output only. IDs of the annotation specs used in the confusion matrix. + // For Tables CLASSIFICATION + // + // [prediction_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type] + // only list of [annotation_spec_display_name-s][] is populated. + repeated string annotation_spec_id = 1; + + // Output only. Display name of the annotation specs used in the confusion + // matrix, as they were at the moment of the evaluation. For Tables + // CLASSIFICATION + // + // [prediction_type-s][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type], + // distinct values of the target column at the moment of the model + // evaluation are populated here. + repeated string display_name = 3; + + // Output only. Rows in the confusion matrix. The number of rows is equal to + // the size of `annotation_spec_id`. + // `row[i].example_count[j]` is the number of examples that have ground + // truth of the `annotation_spec_id[i]` and are predicted as + // `annotation_spec_id[j]` by the model being evaluated. + repeated Row row = 2; + } + + // Output only. The Area Under Precision-Recall Curve metric. Micro-averaged + // for the overall evaluation. + float au_prc = 1; + + // Output only. The Area Under Precision-Recall Curve metric based on priors. + // Micro-averaged for the overall evaluation. + // Deprecated. + float base_au_prc = 2 [deprecated = true]; + + // Output only. The Area Under Receiver Operating Characteristic curve metric. + // Micro-averaged for the overall evaluation. + float au_roc = 6; + + // Output only. The Log Loss metric. + float log_loss = 7; + + // Output only. Metrics for each confidence_threshold in + // 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and + // position_threshold = INT32_MAX_VALUE. + // ROC and precision-recall curves, and other aggregated metrics are derived + // from them. The confidence metrics entries may also be supplied for + // additional values of position_threshold, but from these no aggregated + // metrics are computed. + repeated ConfidenceMetricsEntry confidence_metrics_entry = 3; + + // Output only. Confusion matrix of the evaluation. + // Only set for MULTICLASS classification problems where number + // of labels is no more than 10. + // Only set for model level evaluation, not for evaluation per label. + ConfusionMatrix confusion_matrix = 4; + + // Output only. The annotation spec ids used for this evaluation. + repeated string annotation_spec_id = 5; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/column_spec.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/column_spec.proto new file mode 100644 index 00000000000..3d15fb51f84 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/column_spec.proto @@ -0,0 +1,77 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + +import "google/api/resource.proto"; +import "google/cloud/automl/v1beta1/data_stats.proto"; +import "google/cloud/automl/v1beta1/data_types.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// A representation of a column in a relational table. When listing them, column specs are returned in the same order in which they were +// given on import . +// Used by: +// * Tables +message ColumnSpec { + option (google.api.resource) = { + type: "automl.googleapis.com/ColumnSpec" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}/columnSpecs/{column_spec}" + }; + + // Identifies the table's column, and its correlation with the column this + // ColumnSpec describes. + message CorrelatedColumn { + // The column_spec_id of the correlated column, which belongs to the same + // table as the in-context column. + string column_spec_id = 1; + + // Correlation between this and the in-context column. + CorrelationStats correlation_stats = 2; + } + + // Output only. The resource name of the column specs. + // Form: + // + // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/tableSpecs/{table_spec_id}/columnSpecs/{column_spec_id}` + string name = 1; + + // The data type of elements stored in the column. + DataType data_type = 2; + + // Output only. The name of the column to show in the interface. The name can + // be up to 100 characters long and can consist only of ASCII Latin letters + // A-Z and a-z, ASCII digits 0-9, underscores(_), and forward slashes(/), and + // must start with a letter or a digit. + string display_name = 3; + + // Output only. Stats of the series of values in the column. + // This field may be stale, see the ancestor's + // Dataset.tables_dataset_metadata.stats_update_time field + // for the timestamp at which these stats were last updated. + DataStats data_stats = 4; + + // Deprecated. + repeated CorrelatedColumn top_correlated_columns = 5; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 6; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_items.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_items.proto new file mode 100644 index 00000000000..2eb45f2d5ff --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_items.proto @@ -0,0 +1,218 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + +import "google/cloud/automl/v1beta1/geometry.proto"; +import "google/cloud/automl/v1beta1/io.proto"; +import "google/cloud/automl/v1beta1/temporal.proto"; +import "google/cloud/automl/v1beta1/text_segment.proto"; +import "google/protobuf/struct.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// A representation of an image. +// Only images up to 30MB in size are supported. +message Image { + // Input only. The data representing the image. + // For Predict calls [image_bytes][google.cloud.automl.v1beta1.Image.image_bytes] must be set, as other options are not + // currently supported by prediction API. You can read the contents of an + // uploaded image by using the [content_uri][google.cloud.automl.v1beta1.Image.content_uri] field. + oneof data { + // Image content represented as a stream of bytes. + // Note: As with all `bytes` fields, protobuffers use a pure binary + // representation, whereas JSON representations use base64. + bytes image_bytes = 1; + + // An input config specifying the content of the image. + InputConfig input_config = 6; + } + + // Output only. HTTP URI to the thumbnail image. + string thumbnail_uri = 4; +} + +// A representation of a text snippet. +message TextSnippet { + // Required. The content of the text snippet as a string. Up to 250000 + // characters long. + string content = 1; + + // Optional. The format of [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the only two allowed + // values are "text/html" and "text/plain". If left blank, the format is + // automatically determined from the type of the uploaded [content][google.cloud.automl.v1beta1.TextSnippet.content]. + string mime_type = 2; + + // Output only. HTTP URI where you can download the content. + string content_uri = 4; +} + +// Message that describes dimension of a document. +message DocumentDimensions { + // Unit of the document dimension. + enum DocumentDimensionUnit { + // Should not be used. + DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0; + + // Document dimension is measured in inches. + INCH = 1; + + // Document dimension is measured in centimeters. + CENTIMETER = 2; + + // Document dimension is measured in points. 72 points = 1 inch. + POINT = 3; + } + + // Unit of the dimension. + DocumentDimensionUnit unit = 1; + + // Width value of the document, works together with the unit. + float width = 2; + + // Height value of the document, works together with the unit. + float height = 3; +} + +// A structured text document e.g. a PDF. +message Document { + // Describes the layout information of a [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment] in the document. + message Layout { + // The type of TextSegment in the context of the original document. + enum TextSegmentType { + // Should not be used. + TEXT_SEGMENT_TYPE_UNSPECIFIED = 0; + + // The text segment is a token. e.g. word. + TOKEN = 1; + + // The text segment is a paragraph. + PARAGRAPH = 2; + + // The text segment is a form field. + FORM_FIELD = 3; + + // The text segment is the name part of a form field. It will be treated + // as child of another FORM_FIELD TextSegment if its span is subspan of + // another TextSegment with type FORM_FIELD. + FORM_FIELD_NAME = 4; + + // The text segment is the text content part of a form field. It will be + // treated as child of another FORM_FIELD TextSegment if its span is + // subspan of another TextSegment with type FORM_FIELD. + FORM_FIELD_CONTENTS = 5; + + // The text segment is a whole table, including headers, and all rows. + TABLE = 6; + + // The text segment is a table's headers. It will be treated as child of + // another TABLE TextSegment if its span is subspan of another TextSegment + // with type TABLE. + TABLE_HEADER = 7; + + // The text segment is a row in table. It will be treated as child of + // another TABLE TextSegment if its span is subspan of another TextSegment + // with type TABLE. + TABLE_ROW = 8; + + // The text segment is a cell in table. It will be treated as child of + // another TABLE_ROW TextSegment if its span is subspan of another + // TextSegment with type TABLE_ROW. + TABLE_CELL = 9; + } + + // Text Segment that represents a segment in + // [document_text][google.cloud.automl.v1beta1.Document.document_text]. + TextSegment text_segment = 1; + + // Page number of the [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment] in the original document, starts + // from 1. + int32 page_number = 2; + + // The position of the [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment] in the page. + // Contains exactly 4 + // + // [normalized_vertices][google.cloud.automl.v1beta1.BoundingPoly.normalized_vertices] + // and they are connected by edges in the order provided, which will + // represent a rectangle parallel to the frame. The + // [NormalizedVertex-s][google.cloud.automl.v1beta1.NormalizedVertex] are + // relative to the page. + // Coordinates are based on top-left as point (0,0). + BoundingPoly bounding_poly = 3; + + // The type of the [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment] in document. + TextSegmentType text_segment_type = 4; + } + + // An input config specifying the content of the document. + DocumentInputConfig input_config = 1; + + // The plain text version of this document. + TextSnippet document_text = 2; + + // Describes the layout of the document. + // Sorted by [page_number][]. + repeated Layout layout = 3; + + // The dimensions of the page in the document. + DocumentDimensions document_dimensions = 4; + + // Number of pages in the document. + int32 page_count = 5; +} + +// A representation of a row in a relational table. +message Row { + // The resource IDs of the column specs describing the columns of the row. + // If set must contain, but possibly in a different order, all input + // feature + // + // [column_spec_ids][google.cloud.automl.v1beta1.TablesModelMetadata.input_feature_column_specs] + // of the Model this row is being passed to. + // Note: The below `values` field must match order of this field, if this + // field is set. + repeated string column_spec_ids = 2; + + // Required. The values of the row cells, given in the same order as the + // column_spec_ids, or, if not set, then in the same order as input + // feature + // + // [column_specs][google.cloud.automl.v1beta1.TablesModelMetadata.input_feature_column_specs] + // of the Model this row is being passed to. + repeated google.protobuf.Value values = 3; +} + +// Example data used for training or prediction. +message ExamplePayload { + // Required. Input only. The example data. + oneof payload { + // Example image. + Image image = 1; + + // Example text. + TextSnippet text_snippet = 2; + + // Example document. + Document document = 4; + + // Example relational table row. + Row row = 3; + } +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_stats.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_stats.proto new file mode 100644 index 00000000000..8c2c2fe2a22 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_stats.proto @@ -0,0 +1,165 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// The data statistics of a series of values that share the same DataType. +message DataStats { + // The data statistics specific to a DataType. + oneof stats { + // The statistics for FLOAT64 DataType. + Float64Stats float64_stats = 3; + + // The statistics for STRING DataType. + StringStats string_stats = 4; + + // The statistics for TIMESTAMP DataType. + TimestampStats timestamp_stats = 5; + + // The statistics for ARRAY DataType. + ArrayStats array_stats = 6; + + // The statistics for STRUCT DataType. + StructStats struct_stats = 7; + + // The statistics for CATEGORY DataType. + CategoryStats category_stats = 8; + } + + // The number of distinct values. + int64 distinct_value_count = 1; + + // The number of values that are null. + int64 null_value_count = 2; + + // The number of values that are valid. + int64 valid_value_count = 9; +} + +// The data statistics of a series of FLOAT64 values. +message Float64Stats { + // A bucket of a histogram. + message HistogramBucket { + // The minimum value of the bucket, inclusive. + double min = 1; + + // The maximum value of the bucket, exclusive unless max = `"Infinity"`, in + // which case it's inclusive. + double max = 2; + + // The number of data values that are in the bucket, i.e. are between + // min and max values. + int64 count = 3; + } + + // The mean of the series. + double mean = 1; + + // The standard deviation of the series. + double standard_deviation = 2; + + // Ordered from 0 to k k-quantile values of the data series of n values. + // The value at index i is, approximately, the i*n/k-th smallest value in the + // series; for i = 0 and i = k these are, respectively, the min and max + // values. + repeated double quantiles = 3; + + // Histogram buckets of the data series. Sorted by the min value of the + // bucket, ascendingly, and the number of the buckets is dynamically + // generated. The buckets are non-overlapping and completely cover whole + // FLOAT64 range with min of first bucket being `"-Infinity"`, and max of + // the last one being `"Infinity"`. + repeated HistogramBucket histogram_buckets = 4; +} + +// The data statistics of a series of STRING values. +message StringStats { + // The statistics of a unigram. + message UnigramStats { + // The unigram. + string value = 1; + + // The number of occurrences of this unigram in the series. + int64 count = 2; + } + + // The statistics of the top 20 unigrams, ordered by + // [count][google.cloud.automl.v1beta1.StringStats.UnigramStats.count]. + repeated UnigramStats top_unigram_stats = 1; +} + +// The data statistics of a series of TIMESTAMP values. +message TimestampStats { + // Stats split by a defined in context granularity. + message GranularStats { + // A map from granularity key to example count for that key. + // E.g. for hour_of_day `13` means 1pm, or for month_of_year `5` means May). + map buckets = 1; + } + + // The string key is the pre-defined granularity. Currently supported: + // hour_of_day, day_of_week, month_of_year. + // Granularities finer that the granularity of timestamp data are not + // populated (e.g. if timestamps are at day granularity, then hour_of_day + // is not populated). + map granular_stats = 1; +} + +// The data statistics of a series of ARRAY values. +message ArrayStats { + // Stats of all the values of all arrays, as if they were a single long + // series of data. The type depends on the element type of the array. + DataStats member_stats = 2; +} + +// The data statistics of a series of STRUCT values. +message StructStats { + // Map from a field name of the struct to data stats aggregated over series + // of all data in that field across all the structs. + map field_stats = 1; +} + +// The data statistics of a series of CATEGORY values. +message CategoryStats { + // The statistics of a single CATEGORY value. + message SingleCategoryStats { + // The CATEGORY value. + string value = 1; + + // The number of occurrences of this value in the series. + int64 count = 2; + } + + // The statistics of the top 20 CATEGORY values, ordered by + // + // [count][google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.count]. + repeated SingleCategoryStats top_category_stats = 1; +} + +// A correlation statistics between two series of DataType values. The series +// may have differing DataType-s, but within a single series the DataType must +// be the same. +message CorrelationStats { + // The correlation value using the Cramer's V measure. + double cramers_v = 1; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_types.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_types.proto new file mode 100644 index 00000000000..72ac65dd340 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_types.proto @@ -0,0 +1,104 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// `TypeCode` is used as a part of +// [DataType][google.cloud.automl.v1beta1.DataType]. +enum TypeCode { + // Not specified. Should not be used. + TYPE_CODE_UNSPECIFIED = 0; + + // Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or + // `"-Infinity"`. + FLOAT64 = 3; + + // Must be between 0AD and 9999AD. Encoded as `string` according to + // [time_format][google.cloud.automl.v1beta1.DataType.time_format], or, if + // that format is not set, then in RFC 3339 `date-time` format, where + // `time-offset` = `"Z"` (e.g. 1985-04-12T23:20:50.52Z). + TIMESTAMP = 4; + + // Encoded as `string`. + STRING = 6; + + // Encoded as `list`, where the list elements are represented according to + // + // [list_element_type][google.cloud.automl.v1beta1.DataType.list_element_type]. + ARRAY = 8; + + // Encoded as `struct`, where field values are represented according to + // [struct_type][google.cloud.automl.v1beta1.DataType.struct_type]. + STRUCT = 9; + + // Values of this type are not further understood by AutoML, + // e.g. AutoML is unable to tell the order of values (as it could with + // FLOAT64), or is unable to say if one value contains another (as it + // could with STRING). + // Encoded as `string` (bytes should be base64-encoded, as described in RFC + // 4648, section 4). + CATEGORY = 10; +} + +// Indicated the type of data that can be stored in a structured data entity +// (e.g. a table). +message DataType { + // Details of DataType-s that need additional specification. + oneof details { + // If [type_code][google.cloud.automl.v1beta1.DataType.type_code] == [ARRAY][google.cloud.automl.v1beta1.TypeCode.ARRAY], + // then `list_element_type` is the type of the elements. + DataType list_element_type = 2; + + // If [type_code][google.cloud.automl.v1beta1.DataType.type_code] == [STRUCT][google.cloud.automl.v1beta1.TypeCode.STRUCT], then `struct_type` + // provides type information for the struct's fields. + StructType struct_type = 3; + + // If [type_code][google.cloud.automl.v1beta1.DataType.type_code] == [TIMESTAMP][google.cloud.automl.v1beta1.TypeCode.TIMESTAMP] + // then `time_format` provides the format in which that time field is + // expressed. The time_format must either be one of: + // * `UNIX_SECONDS` + // * `UNIX_MILLISECONDS` + // * `UNIX_MICROSECONDS` + // * `UNIX_NANOSECONDS` + // (for respectively number of seconds, milliseconds, microseconds and + // nanoseconds since start of the Unix epoch); + // or be written in `strftime` syntax. If time_format is not set, then the + // default format as described on the type_code is used. + string time_format = 5; + } + + // Required. The [TypeCode][google.cloud.automl.v1beta1.TypeCode] for this type. + TypeCode type_code = 1; + + // If true, this DataType can also be `NULL`. In .CSV files `NULL` value is + // expressed as an empty string. + bool nullable = 4; +} + +// `StructType` defines the DataType-s of a [STRUCT][google.cloud.automl.v1beta1.TypeCode.STRUCT] type. +message StructType { + // Unordered map of struct field names to their data types. + // Fields cannot be added or removed via Update. Their names and + // data types are still mutable. + map fields = 1; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/dataset.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/dataset.proto new file mode 100644 index 00000000000..22d7f9a6adc --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/dataset.proto @@ -0,0 +1,95 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + +import "google/api/resource.proto"; +import "google/cloud/automl/v1beta1/image.proto"; +import "google/cloud/automl/v1beta1/tables.proto"; +import "google/cloud/automl/v1beta1/text.proto"; +import "google/cloud/automl/v1beta1/translation.proto"; +import "google/cloud/automl/v1beta1/video.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// A workspace for solving a single, particular machine learning (ML) problem. +// A workspace contains examples that may be annotated. +message Dataset { + option (google.api.resource) = { + type: "automl.googleapis.com/Dataset" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}" + }; + + // Required. + // The dataset metadata that is specific to the problem type. + oneof dataset_metadata { + // Metadata for a dataset used for translation. + TranslationDatasetMetadata translation_dataset_metadata = 23; + + // Metadata for a dataset used for image classification. + ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + + // Metadata for a dataset used for text classification. + TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + + // Metadata for a dataset used for image object detection. + ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + + // Metadata for a dataset used for video classification. + VideoClassificationDatasetMetadata video_classification_dataset_metadata = 31; + + // Metadata for a dataset used for video object tracking. + VideoObjectTrackingDatasetMetadata video_object_tracking_dataset_metadata = 29; + + // Metadata for a dataset used for text extraction. + TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + + // Metadata for a dataset used for text sentiment. + TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + + // Metadata for a dataset used for Tables. + TablesDatasetMetadata tables_dataset_metadata = 33; + } + + // Output only. The resource name of the dataset. + // Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}` + string name = 1; + + // Required. The name of the dataset to show in the interface. The name can be + // up to 32 characters long and can consist only of ASCII Latin letters A-Z + // and a-z, underscores + // (_), and ASCII digits 0-9. + string display_name = 2; + + // User-provided description of the dataset. The description can be up to + // 25000 characters long. + string description = 3; + + // Output only. The number of examples in the dataset. + int32 example_count = 21; + + // Output only. Timestamp when this dataset was created. + google.protobuf.Timestamp create_time = 14; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 17; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/detection.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/detection.proto new file mode 100644 index 00000000000..38240dd6e92 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/detection.proto @@ -0,0 +1,134 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + +import "google/cloud/automl/v1beta1/geometry.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Annotation details for image object detection. +message ImageObjectDetectionAnnotation { + // Output only. The rectangle representing the object location. + BoundingPoly bounding_box = 1; + + // Output only. The confidence that this annotation is positive for the parent example, + // value in [0, 1], higher means higher positivity confidence. + float score = 2; +} + +// Annotation details for video object tracking. +message VideoObjectTrackingAnnotation { + // Optional. The instance of the object, expressed as a positive integer. Used to tell + // apart objects of the same type (i.e. AnnotationSpec) when multiple are + // present on a single example. + // NOTE: Instance ID prediction quality is not a part of model evaluation and + // is done as best effort. Especially in cases when an entity goes + // off-screen for a longer time (minutes), when it comes back it may be given + // a new instance ID. + string instance_id = 1; + + // Required. A time (frame) of a video to which this annotation pertains. + // Represented as the duration since the video's start. + google.protobuf.Duration time_offset = 2; + + // Required. The rectangle representing the object location on the frame (i.e. + // at the time_offset of the video). + BoundingPoly bounding_box = 3; + + // Output only. The confidence that this annotation is positive for the video at + // the time_offset, value in [0, 1], higher means higher positivity + // confidence. For annotations created by the user the score is 1. When + // user approves an annotation, the original float score is kept (and not + // changed to 1). + float score = 4; +} + +// Bounding box matching model metrics for a single intersection-over-union +// threshold and multiple label match confidence thresholds. +message BoundingBoxMetricsEntry { + // Metrics for a single confidence threshold. + message ConfidenceMetricsEntry { + // Output only. The confidence threshold value used to compute the metrics. + float confidence_threshold = 1; + + // Output only. Recall under the given confidence threshold. + float recall = 2; + + // Output only. Precision under the given confidence threshold. + float precision = 3; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 4; + } + + // Output only. The intersection-over-union threshold value used to compute + // this metrics entry. + float iou_threshold = 1; + + // Output only. The mean average precision, most often close to au_prc. + float mean_average_precision = 2; + + // Output only. Metrics for each label-match confidence_threshold from + // 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is + // derived from them. + repeated ConfidenceMetricsEntry confidence_metrics_entries = 3; +} + +// Model evaluation metrics for image object detection problems. +// Evaluates prediction quality of labeled bounding boxes. +message ImageObjectDetectionEvaluationMetrics { + // Output only. The total number of bounding boxes (i.e. summed over all + // images) the ground truth used to create this evaluation had. + int32 evaluated_bounding_box_count = 1; + + // Output only. The bounding boxes match metrics for each + // Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + // and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + // pair. + repeated BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + + // Output only. The single metric for bounding boxes evaluation: + // the mean_average_precision averaged over all bounding_box_metrics_entries. + float bounding_box_mean_average_precision = 3; +} + +// Model evaluation metrics for video object tracking problems. +// Evaluates prediction quality of both labeled bounding boxes and labeled +// tracks (i.e. series of bounding boxes sharing same label and instance ID). +message VideoObjectTrackingEvaluationMetrics { + // Output only. The number of video frames used to create this evaluation. + int32 evaluated_frame_count = 1; + + // Output only. The total number of bounding boxes (i.e. summed over all + // frames) the ground truth used to create this evaluation had. + int32 evaluated_bounding_box_count = 2; + + // Output only. The bounding boxes match metrics for each + // Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + // and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + // pair. + repeated BoundingBoxMetricsEntry bounding_box_metrics_entries = 4; + + // Output only. The single metric for bounding boxes evaluation: + // the mean_average_precision averaged over all bounding_box_metrics_entries. + float bounding_box_mean_average_precision = 6; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/geometry.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/geometry.proto new file mode 100644 index 00000000000..067ac00aaad --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/geometry.proto @@ -0,0 +1,45 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// A vertex represents a 2D point in the image. +// The normalized vertex coordinates are between 0 to 1 fractions relative to +// the original plane (image, video). E.g. if the plane (e.g. whole image) would +// have size 10 x 20 then a point with normalized coordinates (0.1, 0.3) would +// be at the position (1, 6) on that plane. +message NormalizedVertex { + // Required. Horizontal coordinate. + float x = 1; + + // Required. Vertical coordinate. + float y = 2; +} + +// A bounding polygon of a detected object on a plane. +// On output both vertices and normalized_vertices are provided. +// The polygon is formed by connecting vertices in the order they are listed. +message BoundingPoly { + // Output only . The bounding polygon normalized vertices. + repeated NormalizedVertex normalized_vertices = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/image.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/image.proto new file mode 100644 index 00000000000..56401228e85 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/image.proto @@ -0,0 +1,190 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + +import "google/cloud/automl/v1beta1/annotation_spec.proto"; +import "google/cloud/automl/v1beta1/classification.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "ImageProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Dataset metadata that is specific to image classification. +message ImageClassificationDatasetMetadata { + // Required. Type of the classification problem. + ClassificationType classification_type = 1; +} + +// Dataset metadata specific to image object detection. +message ImageObjectDetectionDatasetMetadata { + +} + +// Model metadata for image classification. +message ImageClassificationModelMetadata { + // Optional. The ID of the `base` model. If it is specified, the new model + // will be created based on the `base` model. Otherwise, the new model will be + // created from scratch. The `base` model must be in the same + // `project` and `location` as the new model to create, and have the same + // `model_type`. + string base_model_id = 1; + + // Required. The train budget of creating this model, expressed in hours. The + // actual `train_cost` will be equal or less than this value. + int64 train_budget = 2; + + // Output only. The actual train cost of creating this model, expressed in + // hours. If this model is created from a `base` model, the train cost used + // to create the `base` model are not included. + int64 train_cost = 3; + + // Output only. The reason that this create model operation stopped, + // e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + string stop_reason = 5; + + // Optional. Type of the model. The available values are: + // * `cloud` - Model to be used via prediction calls to AutoML API. + // This is the default value. + // * `mobile-low-latency-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. Expected to have low latency, but + // may have lower prediction quality than other models. + // * `mobile-versatile-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. + // * `mobile-high-accuracy-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. Expected to have a higher + // latency, but should also have a higher prediction quality + // than other models. + // * `mobile-core-ml-low-latency-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile device with Core + // ML afterwards. Expected to have low latency, but may have + // lower prediction quality than other models. + // * `mobile-core-ml-versatile-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile device with Core + // ML afterwards. + // * `mobile-core-ml-high-accuracy-1` - A model that, in addition to + // providing prediction via AutoML API, can also be exported + // (see [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile device with + // Core ML afterwards. Expected to have a higher latency, but + // should also have a higher prediction quality than other + // models. + string model_type = 7; + + // Output only. An approximate number of online prediction QPS that can + // be supported by this model per each node on which it is deployed. + double node_qps = 13; + + // Output only. The number of nodes this model is deployed on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the node_qps field. + int64 node_count = 14; +} + +// Model metadata specific to image object detection. +message ImageObjectDetectionModelMetadata { + // Optional. Type of the model. The available values are: + // * `cloud-high-accuracy-1` - (default) A model to be used via prediction + // calls to AutoML API. Expected to have a higher latency, but + // should also have a higher prediction quality than other + // models. + // * `cloud-low-latency-1` - A model to be used via prediction + // calls to AutoML API. Expected to have low latency, but may + // have lower prediction quality than other models. + // * `mobile-low-latency-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. Expected to have low latency, but + // may have lower prediction quality than other models. + // * `mobile-versatile-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. + // * `mobile-high-accuracy-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. Expected to have a higher + // latency, but should also have a higher prediction quality + // than other models. + string model_type = 1; + + // Output only. The number of nodes this model is deployed on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the qps_per_node field. + int64 node_count = 3; + + // Output only. An approximate number of online prediction QPS that can + // be supported by this model per each node on which it is deployed. + double node_qps = 4; + + // Output only. The reason that this create model operation stopped, + // e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + string stop_reason = 5; + + // The train budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. The actual + // `train_cost` will be equal or less than this value. If further model + // training ceases to provide any improvements, it will stop without using + // full budget and the stop_reason will be `MODEL_CONVERGED`. + // Note, node_hour = actual_hour * number_of_nodes_invovled. + // For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, + // the train budget must be between 20,000 and 900,000 milli node hours, + // inclusive. The default value is 216, 000 which represents one day in + // wall time. + // For model type `mobile-low-latency-1`, `mobile-versatile-1`, + // `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`, + // `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train + // budget must be between 1,000 and 100,000 milli node hours, inclusive. + // The default value is 24, 000 which represents one day in wall time. + int64 train_budget_milli_node_hours = 6; + + // Output only. The actual train cost of creating this model, expressed in + // milli node hours, i.e. 1,000 value in this field means 1 node hour. + // Guaranteed to not exceed the train budget. + int64 train_cost_milli_node_hours = 7; +} + +// Model deployment metadata specific to Image Classification. +message ImageClassificationModelDeploymentMetadata { + // Input only. The number of nodes to deploy the model on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the model's + // + // [node_qps][google.cloud.automl.v1beta1.ImageClassificationModelMetadata.node_qps]. + // Must be between 1 and 100, inclusive on both ends. + int64 node_count = 1; +} + +// Model deployment metadata specific to Image Object Detection. +message ImageObjectDetectionModelDeploymentMetadata { + // Input only. The number of nodes to deploy the model on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the model's + // + // [qps_per_node][google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.qps_per_node]. + // Must be between 1 and 100, inclusive on both ends. + int64 node_count = 1; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/io.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/io.proto new file mode 100644 index 00000000000..04808d74acb --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/io.proto @@ -0,0 +1,1157 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Input configuration for ImportData Action. +// +// The format of input depends on dataset_metadata the Dataset into which +// the import is happening has. As input source the +// [gcs_source][google.cloud.automl.v1beta1.InputConfig.gcs_source] +// is expected, unless specified otherwise. Additionally any input .CSV file +// by itself must be 100MB or smaller, unless specified otherwise. +// If an "example" file (that is, image, video etc.) with identical content +// (even if it had different GCS_FILE_PATH) is mentioned multiple times, then +// its label, bounding boxes etc. are appended. The same file should be always +// provided with the same ML_USE and GCS_FILE_PATH, if it is not, then +// these values are nondeterministically selected from the given ones. +// +// The formats are represented in EBNF with commas being literal and with +// non-terminal symbols defined near the end of this comment. The formats are: +// +// * For Image Classification: +// CSV file(s) with each line in format: +// ML_USE,GCS_FILE_PATH,LABEL,LABEL,... +// GCS_FILE_PATH leads to image of up to 30MB in size. Supported +// extensions: .JPEG, .GIF, .PNG, .WEBP, .BMP, .TIFF, .ICO +// For MULTICLASS classification type, at most one LABEL is allowed +// per image. If an image has not yet been labeled, then it should be +// mentioned just once with no LABEL. +// Some sample rows: +// TRAIN,gs://folder/image1.jpg,daisy +// TEST,gs://folder/image2.jpg,dandelion,tulip,rose +// UNASSIGNED,gs://folder/image3.jpg,daisy +// UNASSIGNED,gs://folder/image4.jpg +// +// * For Image Object Detection: +// CSV file(s) with each line in format: +// ML_USE,GCS_FILE_PATH,(LABEL,BOUNDING_BOX | ,,,,,,,) +// GCS_FILE_PATH leads to image of up to 30MB in size. Supported +// extensions: .JPEG, .GIF, .PNG. +// Each image is assumed to be exhaustively labeled. The minimum +// allowed BOUNDING_BOX edge length is 0.01, and no more than 500 +// BOUNDING_BOX-es per image are allowed (one BOUNDING_BOX is defined +// per line). If an image has not yet been labeled, then it should be +// mentioned just once with no LABEL and the ",,,,,,," in place of the +// BOUNDING_BOX. For images which are known to not contain any +// bounding boxes, they should be labelled explictly as +// "NEGATIVE_IMAGE", followed by ",,,,,,," in place of the +// BOUNDING_BOX. +// Sample rows: +// TRAIN,gs://folder/image1.png,car,0.1,0.1,,,0.3,0.3,, +// TRAIN,gs://folder/image1.png,bike,.7,.6,,,.8,.9,, +// UNASSIGNED,gs://folder/im2.png,car,0.1,0.1,0.2,0.1,0.2,0.3,0.1,0.3 +// TEST,gs://folder/im3.png,,,,,,,,, +// TRAIN,gs://folder/im4.png,NEGATIVE_IMAGE,,,,,,,,, +// +// * For Video Classification: +// CSV file(s) with each line in format: +// ML_USE,GCS_FILE_PATH +// where ML_USE VALIDATE value should not be used. The GCS_FILE_PATH +// should lead to another .csv file which describes examples that have +// given ML_USE, using the following row format: +// GCS_FILE_PATH,(LABEL,TIME_SEGMENT_START,TIME_SEGMENT_END | ,,) +// Here GCS_FILE_PATH leads to a video of up to 50GB in size and up +// to 3h duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI. +// TIME_SEGMENT_START and TIME_SEGMENT_END must be within the +// length of the video, and end has to be after the start. Any segment +// of a video which has one or more labels on it, is considered a +// hard negative for all other labels. Any segment with no labels on +// it is considered to be unknown. If a whole video is unknown, then +// it shuold be mentioned just once with ",," in place of LABEL, +// TIME_SEGMENT_START,TIME_SEGMENT_END. +// Sample top level CSV file: +// TRAIN,gs://folder/train_videos.csv +// TEST,gs://folder/test_videos.csv +// UNASSIGNED,gs://folder/other_videos.csv +// Sample rows of a CSV file for a particular ML_USE: +// gs://folder/video1.avi,car,120,180.000021 +// gs://folder/video1.avi,bike,150,180.000021 +// gs://folder/vid2.avi,car,0,60.5 +// gs://folder/vid3.avi,,, +// +// * For Video Object Tracking: +// CSV file(s) with each line in format: +// ML_USE,GCS_FILE_PATH +// where ML_USE VALIDATE value should not be used. The GCS_FILE_PATH +// should lead to another .csv file which describes examples that have +// given ML_USE, using one of the following row format: +// GCS_FILE_PATH,LABEL,[INSTANCE_ID],TIMESTAMP,BOUNDING_BOX +// or +// GCS_FILE_PATH,,,,,,,,,, +// Here GCS_FILE_PATH leads to a video of up to 50GB in size and up +// to 3h duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI. +// Providing INSTANCE_IDs can help to obtain a better model. When +// a specific labeled entity leaves the video frame, and shows up +// afterwards it is not required, albeit preferable, that the same +// INSTANCE_ID is given to it. +// TIMESTAMP must be within the length of the video, the +// BOUNDING_BOX is assumed to be drawn on the closest video's frame +// to the TIMESTAMP. Any mentioned by the TIMESTAMP frame is expected +// to be exhaustively labeled and no more than 500 BOUNDING_BOX-es per +// frame are allowed. If a whole video is unknown, then it should be +// mentioned just once with ",,,,,,,,,," in place of LABEL, +// [INSTANCE_ID],TIMESTAMP,BOUNDING_BOX. +// Sample top level CSV file: +// TRAIN,gs://folder/train_videos.csv +// TEST,gs://folder/test_videos.csv +// UNASSIGNED,gs://folder/other_videos.csv +// Seven sample rows of a CSV file for a particular ML_USE: +// gs://folder/video1.avi,car,1,12.10,0.8,0.8,0.9,0.8,0.9,0.9,0.8,0.9 +// gs://folder/video1.avi,car,1,12.90,0.4,0.8,0.5,0.8,0.5,0.9,0.4,0.9 +// gs://folder/video1.avi,car,2,12.10,.4,.2,.5,.2,.5,.3,.4,.3 +// gs://folder/video1.avi,car,2,12.90,.8,.2,,,.9,.3,, +// gs://folder/video1.avi,bike,,12.50,.45,.45,,,.55,.55,, +// gs://folder/video2.avi,car,1,0,.1,.9,,,.9,.1,, +// gs://folder/video2.avi,,,,,,,,,,, +// * For Text Extraction: +// CSV file(s) with each line in format: +// ML_USE,GCS_FILE_PATH +// GCS_FILE_PATH leads to a .JSONL (that is, JSON Lines) file which +// either imports text in-line or as documents. Any given +// .JSONL file must be 100MB or smaller. +// The in-line .JSONL file contains, per line, a proto that wraps a +// TextSnippet proto (in json representation) followed by one or more +// AnnotationPayload protos (called annotations), which have +// display_name and text_extraction detail populated. The given text +// is expected to be annotated exhaustively, for example, if you look +// for animals and text contains "dolphin" that is not labeled, then +// "dolphin" is assumed to not be an animal. Any given text snippet +// content must be 10KB or smaller, and also be UTF-8 NFC encoded +// (ASCII already is). +// The document .JSONL file contains, per line, a proto that wraps a +// Document proto. The Document proto must have either document_text +// or input_config set. In document_text case, the Document proto may +// also contain the spatial information of the document, including +// layout, document dimension and page number. In input_config case, +// only PDF documents are supported now, and each document may be up +// to 2MB large. Currently, annotations on documents cannot be +// specified at import. +// Three sample CSV rows: +// TRAIN,gs://folder/file1.jsonl +// VALIDATE,gs://folder/file2.jsonl +// TEST,gs://folder/file3.jsonl +// Sample in-line JSON Lines file for entity extraction (presented here +// with artificial line breaks, but the only actual line break is +// denoted by \n).: +// { +// "document": { +// "document_text": {"content": "dog cat"} +// "layout": [ +// { +// "text_segment": { +// "start_offset": 0, +// "end_offset": 3, +// }, +// "page_number": 1, +// "bounding_poly": { +// "normalized_vertices": [ +// {"x": 0.1, "y": 0.1}, +// {"x": 0.1, "y": 0.3}, +// {"x": 0.3, "y": 0.3}, +// {"x": 0.3, "y": 0.1}, +// ], +// }, +// "text_segment_type": TOKEN, +// }, +// { +// "text_segment": { +// "start_offset": 4, +// "end_offset": 7, +// }, +// "page_number": 1, +// "bounding_poly": { +// "normalized_vertices": [ +// {"x": 0.4, "y": 0.1}, +// {"x": 0.4, "y": 0.3}, +// {"x": 0.8, "y": 0.3}, +// {"x": 0.8, "y": 0.1}, +// ], +// }, +// "text_segment_type": TOKEN, +// } +// +// ], +// "document_dimensions": { +// "width": 8.27, +// "height": 11.69, +// "unit": INCH, +// } +// "page_count": 1, +// }, +// "annotations": [ +// { +// "display_name": "animal", +// "text_extraction": {"text_segment": {"start_offset": 0, +// "end_offset": 3}} +// }, +// { +// "display_name": "animal", +// "text_extraction": {"text_segment": {"start_offset": 4, +// "end_offset": 7}} +// } +// ], +// }\n +// { +// "text_snippet": { +// "content": "This dog is good." +// }, +// "annotations": [ +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 5, "end_offset": 8} +// } +// } +// ] +// } +// Sample document JSON Lines file (presented here with artificial line +// breaks, but the only actual line break is denoted by \n).: +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] +// } +// } +// } +// }\n +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ] +// } +// } +// } +// } +// +// * For Text Classification: +// CSV file(s) with each line in format: +// ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),LABEL,LABEL,... +// TEXT_SNIPPET and GCS_FILE_PATH are distinguished by a pattern. If +// the column content is a valid gcs file path, i.e. prefixed by +// "gs://", it will be treated as a GCS_FILE_PATH, else if the content +// is enclosed within double quotes (""), it is +// treated as a TEXT_SNIPPET. In the GCS_FILE_PATH case, the path +// must lead to a .txt file with UTF-8 encoding, for example, +// "gs://folder/content.txt", and the content in it is extracted +// as a text snippet. In TEXT_SNIPPET case, the column content +// excluding quotes is treated as to be imported text snippet. In +// both cases, the text snippet/file size must be within 128kB. +// Maximum 100 unique labels are allowed per CSV row. +// Sample rows: +// TRAIN,"They have bad food and very rude",RudeService,BadFood +// TRAIN,gs://folder/content.txt,SlowService +// TEST,"Typically always bad service there.",RudeService +// VALIDATE,"Stomach ache to go.",BadFood +// +// * For Text Sentiment: +// CSV file(s) with each line in format: +// ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),SENTIMENT +// TEXT_SNIPPET and GCS_FILE_PATH are distinguished by a pattern. If +// the column content is a valid gcs file path, that is, prefixed by +// "gs://", it is treated as a GCS_FILE_PATH, otherwise it is treated +// as a TEXT_SNIPPET. In the GCS_FILE_PATH case, the path +// must lead to a .txt file with UTF-8 encoding, for example, +// "gs://folder/content.txt", and the content in it is extracted +// as a text snippet. In TEXT_SNIPPET case, the column content itself +// is treated as to be imported text snippet. In both cases, the +// text snippet must be up to 500 characters long. +// Sample rows: +// TRAIN,"@freewrytin this is way too good for your product",2 +// TRAIN,"I need this product so bad",3 +// TEST,"Thank you for this product.",4 +// VALIDATE,gs://folder/content.txt,2 +// +// * For Tables: +// Either +// [gcs_source][google.cloud.automl.v1beta1.InputConfig.gcs_source] or +// +// [bigquery_source][google.cloud.automl.v1beta1.InputConfig.bigquery_source] +// can be used. All inputs is concatenated into a single +// +// [primary_table][google.cloud.automl.v1beta1.TablesDatasetMetadata.primary_table_name] +// For gcs_source: +// CSV file(s), where the first row of the first file is the header, +// containing unique column names. If the first row of a subsequent +// file is the same as the header, then it is also treated as a +// header. All other rows contain values for the corresponding +// columns. +// Each .CSV file by itself must be 10GB or smaller, and their total +// size must be 100GB or smaller. +// First three sample rows of a CSV file: +// "Id","First Name","Last Name","Dob","Addresses" +// +// "1","John","Doe","1968-01-22","[{"status":"current","address":"123_First_Avenue","city":"Seattle","state":"WA","zip":"11111","numberOfYears":"1"},{"status":"previous","address":"456_Main_Street","city":"Portland","state":"OR","zip":"22222","numberOfYears":"5"}]" +// +// "2","Jane","Doe","1980-10-16","[{"status":"current","address":"789_Any_Avenue","city":"Albany","state":"NY","zip":"33333","numberOfYears":"2"},{"status":"previous","address":"321_Main_Street","city":"Hoboken","state":"NJ","zip":"44444","numberOfYears":"3"}]} +// For bigquery_source: +// An URI of a BigQuery table. The user data size of the BigQuery +// table must be 100GB or smaller. +// An imported table must have between 2 and 1,000 columns, inclusive, +// and between 1000 and 100,000,000 rows, inclusive. There are at most 5 +// import data running in parallel. +// Definitions: +// ML_USE = "TRAIN" | "VALIDATE" | "TEST" | "UNASSIGNED" +// Describes how the given example (file) should be used for model +// training. "UNASSIGNED" can be used when user has no preference. +// GCS_FILE_PATH = A path to file on GCS, e.g. "gs://folder/image1.png". +// LABEL = A display name of an object on an image, video etc., e.g. "dog". +// Must be up to 32 characters long and can consist only of ASCII +// Latin letters A-Z and a-z, underscores(_), and ASCII digits 0-9. +// For each label an AnnotationSpec is created which display_name +// becomes the label; AnnotationSpecs are given back in predictions. +// INSTANCE_ID = A positive integer that identifies a specific instance of a +// labeled entity on an example. Used e.g. to track two cars on +// a video while being able to tell apart which one is which. +// BOUNDING_BOX = VERTEX,VERTEX,VERTEX,VERTEX | VERTEX,,,VERTEX,, +// A rectangle parallel to the frame of the example (image, +// video). If 4 vertices are given they are connected by edges +// in the order provided, if 2 are given they are recognized +// as diagonally opposite vertices of the rectangle. +// VERTEX = COORDINATE,COORDINATE +// First coordinate is horizontal (x), the second is vertical (y). +// COORDINATE = A float in 0 to 1 range, relative to total length of +// image or video in given dimension. For fractions the +// leading non-decimal 0 can be omitted (i.e. 0.3 = .3). +// Point 0,0 is in top left. +// TIME_SEGMENT_START = TIME_OFFSET +// Expresses a beginning, inclusive, of a time segment +// within an example that has a time dimension +// (e.g. video). +// TIME_SEGMENT_END = TIME_OFFSET +// Expresses an end, exclusive, of a time segment within +// an example that has a time dimension (e.g. video). +// TIME_OFFSET = A number of seconds as measured from the start of an +// example (e.g. video). Fractions are allowed, up to a +// microsecond precision. "inf" is allowed, and it means the end +// of the example. +// TEXT_SNIPPET = A content of a text snippet, UTF-8 encoded, enclosed within +// double quotes (""). +// SENTIMENT = An integer between 0 and +// Dataset.text_sentiment_dataset_metadata.sentiment_max +// (inclusive). Describes the ordinal of the sentiment - higher +// value means a more positive sentiment. All the values are +// completely relative, i.e. neither 0 needs to mean a negative or +// neutral sentiment nor sentiment_max needs to mean a positive one +// - it is just required that 0 is the least positive sentiment +// in the data, and sentiment_max is the most positive one. +// The SENTIMENT shouldn't be confused with "score" or "magnitude" +// from the previous Natural Language Sentiment Analysis API. +// All SENTIMENT values between 0 and sentiment_max must be +// represented in the imported data. On prediction the same 0 to +// sentiment_max range will be used. The difference between +// neighboring sentiment values needs not to be uniform, e.g. 1 and +// 2 may be similar whereas the difference between 2 and 3 may be +// huge. +// +// Errors: +// If any of the provided CSV files can't be parsed or if more than certain +// percent of CSV rows cannot be processed then the operation fails and +// nothing is imported. Regardless of overall success or failure the per-row +// failures, up to a certain count cap, is listed in +// Operation.metadata.partial_failures. +// +message InputConfig { + // The source of the input. + oneof source { + // The Google Cloud Storage location for the input content. + // In ImportData, the gcs_source points to a csv with structure described in + // the comment. + GcsSource gcs_source = 1; + + // The BigQuery location for the input content. + BigQuerySource bigquery_source = 3; + } + + // Additional domain-specific parameters describing the semantic of the + // imported data, any string must be up to 25000 + // characters long. + // + // * For Tables: + // `schema_inference_version` - (integer) Required. The version of the + // algorithm that should be used for the initial inference of the + // schema (columns' DataTypes) of the table the data is being imported + // into. Allowed values: "1". + map params = 2; +} + +// Input configuration for BatchPredict Action. +// +// The format of input depends on the ML problem of the model used for +// prediction. As input source the +// [gcs_source][google.cloud.automl.v1beta1.InputConfig.gcs_source] +// is expected, unless specified otherwise. +// +// The formats are represented in EBNF with commas being literal and with +// non-terminal symbols defined near the end of this comment. The formats +// are: +// +// * For Image Classification: +// CSV file(s) with each line having just a single column: +// GCS_FILE_PATH +// which leads to image of up to 30MB in size. Supported +// extensions: .JPEG, .GIF, .PNG. This path is treated as the ID in +// the Batch predict output. +// Three sample rows: +// gs://folder/image1.jpeg +// gs://folder/image2.gif +// gs://folder/image3.png +// +// * For Image Object Detection: +// CSV file(s) with each line having just a single column: +// GCS_FILE_PATH +// which leads to image of up to 30MB in size. Supported +// extensions: .JPEG, .GIF, .PNG. This path is treated as the ID in +// the Batch predict output. +// Three sample rows: +// gs://folder/image1.jpeg +// gs://folder/image2.gif +// gs://folder/image3.png +// * For Video Classification: +// CSV file(s) with each line in format: +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END +// GCS_FILE_PATH leads to video of up to 50GB in size and up to 3h +// duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI. +// TIME_SEGMENT_START and TIME_SEGMENT_END must be within the +// length of the video, and end has to be after the start. +// Three sample rows: +// gs://folder/video1.mp4,10,40 +// gs://folder/video1.mp4,20,60 +// gs://folder/vid2.mov,0,inf +// +// * For Video Object Tracking: +// CSV file(s) with each line in format: +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END +// GCS_FILE_PATH leads to video of up to 50GB in size and up to 3h +// duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI. +// TIME_SEGMENT_START and TIME_SEGMENT_END must be within the +// length of the video, and end has to be after the start. +// Three sample rows: +// gs://folder/video1.mp4,10,240 +// gs://folder/video1.mp4,300,360 +// gs://folder/vid2.mov,0,inf +// * For Text Classification: +// CSV file(s) with each line having just a single column: +// GCS_FILE_PATH | TEXT_SNIPPET +// Any given text file can have size upto 128kB. +// Any given text snippet content must have 60,000 characters or less. +// Three sample rows: +// gs://folder/text1.txt +// "Some text content to predict" +// gs://folder/text3.pdf +// Supported file extensions: .txt, .pdf +// +// * For Text Sentiment: +// CSV file(s) with each line having just a single column: +// GCS_FILE_PATH | TEXT_SNIPPET +// Any given text file can have size upto 128kB. +// Any given text snippet content must have 500 characters or less. +// Three sample rows: +// gs://folder/text1.txt +// "Some text content to predict" +// gs://folder/text3.pdf +// Supported file extensions: .txt, .pdf +// +// * For Text Extraction +// .JSONL (i.e. JSON Lines) file(s) which either provide text in-line or +// as documents (for a single BatchPredict call only one of the these +// formats may be used). +// The in-line .JSONL file(s) contain per line a proto that +// wraps a temporary user-assigned TextSnippet ID (string up to 2000 +// characters long) called "id", a TextSnippet proto (in +// json representation) and zero or more TextFeature protos. Any given +// text snippet content must have 30,000 characters or less, and also +// be UTF-8 NFC encoded (ASCII already is). The IDs provided should be +// unique. +// The document .JSONL file(s) contain, per line, a proto that wraps a +// Document proto with input_config set. Only PDF documents are +// supported now, and each document must be up to 2MB large. +// Any given .JSONL file must be 100MB or smaller, and no more than 20 +// files may be given. +// Sample in-line JSON Lines file (presented here with artificial line +// breaks, but the only actual line break is denoted by \n): +// { +// "id": "my_first_id", +// "text_snippet": { "content": "dog car cat"}, +// "text_features": [ +// { +// "text_segment": {"start_offset": 4, "end_offset": 6}, +// "structural_type": PARAGRAPH, +// "bounding_poly": { +// "normalized_vertices": [ +// {"x": 0.1, "y": 0.1}, +// {"x": 0.1, "y": 0.3}, +// {"x": 0.3, "y": 0.3}, +// {"x": 0.3, "y": 0.1}, +// ] +// }, +// } +// ], +// }\n +// { +// "id": "2", +// "text_snippet": { +// "content": "An elaborate content", +// "mime_type": "text/plain" +// } +// } +// Sample document JSON Lines file (presented here with artificial line +// breaks, but the only actual line break is denoted by \n).: +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] +// } +// } +// } +// }\n +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ] +// } +// } +// } +// } +// +// * For Tables: +// Either +// [gcs_source][google.cloud.automl.v1beta1.InputConfig.gcs_source] or +// +// [bigquery_source][google.cloud.automl.v1beta1.InputConfig.bigquery_source]. +// GCS case: +// CSV file(s), each by itself 10GB or smaller and total size must be +// 100GB or smaller, where first file must have a header containing +// column names. If the first row of a subsequent file is the same as +// the header, then it is also treated as a header. All other rows +// contain values for the corresponding columns. +// The column names must contain the model's +// +// [input_feature_column_specs'][google.cloud.automl.v1beta1.TablesModelMetadata.input_feature_column_specs] +// +// [display_name-s][google.cloud.automl.v1beta1.ColumnSpec.display_name] +// (order doesn't matter). The columns corresponding to the model's +// input feature column specs must contain values compatible with the +// column spec's data types. Prediction on all the rows, i.e. the CSV +// lines, will be attempted. For FORECASTING +// +// [prediction_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]: +// all columns having +// +// [TIME_SERIES_AVAILABLE_PAST_ONLY][google.cloud.automl.v1beta1.ColumnSpec.ForecastingMetadata.ColumnType] +// type will be ignored. +// First three sample rows of a CSV file: +// "First Name","Last Name","Dob","Addresses" +// +// "John","Doe","1968-01-22","[{"status":"current","address":"123_First_Avenue","city":"Seattle","state":"WA","zip":"11111","numberOfYears":"1"},{"status":"previous","address":"456_Main_Street","city":"Portland","state":"OR","zip":"22222","numberOfYears":"5"}]" +// +// "Jane","Doe","1980-10-16","[{"status":"current","address":"789_Any_Avenue","city":"Albany","state":"NY","zip":"33333","numberOfYears":"2"},{"status":"previous","address":"321_Main_Street","city":"Hoboken","state":"NJ","zip":"44444","numberOfYears":"3"}]} +// BigQuery case: +// An URI of a BigQuery table. The user data size of the BigQuery +// table must be 100GB or smaller. +// The column names must contain the model's +// +// [input_feature_column_specs'][google.cloud.automl.v1beta1.TablesModelMetadata.input_feature_column_specs] +// +// [display_name-s][google.cloud.automl.v1beta1.ColumnSpec.display_name] +// (order doesn't matter). The columns corresponding to the model's +// input feature column specs must contain values compatible with the +// column spec's data types. Prediction on all the rows of the table +// will be attempted. For FORECASTING +// +// [prediction_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]: +// all columns having +// +// [TIME_SERIES_AVAILABLE_PAST_ONLY][google.cloud.automl.v1beta1.ColumnSpec.ForecastingMetadata.ColumnType] +// type will be ignored. +// +// Definitions: +// GCS_FILE_PATH = A path to file on GCS, e.g. "gs://folder/video.avi". +// TEXT_SNIPPET = A content of a text snippet, UTF-8 encoded, enclosed within +// double quotes ("") +// TIME_SEGMENT_START = TIME_OFFSET +// Expresses a beginning, inclusive, of a time segment +// within an +// example that has a time dimension (e.g. video). +// TIME_SEGMENT_END = TIME_OFFSET +// Expresses an end, exclusive, of a time segment within +// an example that has a time dimension (e.g. video). +// TIME_OFFSET = A number of seconds as measured from the start of an +// example (e.g. video). Fractions are allowed, up to a +// microsecond precision. "inf" is allowed and it means the end +// of the example. +// +// Errors: +// If any of the provided CSV files can't be parsed or if more than certain +// percent of CSV rows cannot be processed then the operation fails and +// prediction does not happen. Regardless of overall success or failure the +// per-row failures, up to a certain count cap, will be listed in +// Operation.metadata.partial_failures. +message BatchPredictInputConfig { + // Required. The source of the input. + oneof source { + // The Google Cloud Storage location for the input content. + GcsSource gcs_source = 1; + + // The BigQuery location for the input content. + BigQuerySource bigquery_source = 2; + } +} + +// Input configuration of a [Document][google.cloud.automl.v1beta1.Document]. +message DocumentInputConfig { + // The Google Cloud Storage location of the document file. Only a single path + // should be given. + // Max supported size: 512MB. + // Supported extensions: .PDF. + GcsSource gcs_source = 1; +} + +// * For Translation: +// CSV file `translation.csv`, with each line in format: +// ML_USE,GCS_FILE_PATH +// GCS_FILE_PATH leads to a .TSV file which describes examples that have +// given ML_USE, using the following row format per line: +// TEXT_SNIPPET (in source language) \t TEXT_SNIPPET (in target +// language) +// +// * For Tables: +// Output depends on whether the dataset was imported from GCS or +// BigQuery. +// GCS case: +// +// [gcs_destination][google.cloud.automl.v1beta1.OutputConfig.gcs_destination] +// must be set. Exported are CSV file(s) `tables_1.csv`, +// `tables_2.csv`,...,`tables_N.csv` with each having as header line +// the table's column names, and all other lines contain values for +// the header columns. +// BigQuery case: +// +// [bigquery_destination][google.cloud.automl.v1beta1.OutputConfig.bigquery_destination] +// pointing to a BigQuery project must be set. In the given project a +// new dataset will be created with name +// +// `export_data__` +// where will be made +// BigQuery-dataset-name compatible (e.g. most special characters will +// become underscores), and timestamp will be in +// YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In that +// dataset a new table called `primary_table` will be created, and +// filled with precisely the same data as this obtained on import. +message OutputConfig { + // Required. The destination of the output. + oneof destination { + // The Google Cloud Storage location where the output is to be written to. + // For Image Object Detection, Text Extraction, Video Classification and + // Tables, in the given directory a new directory will be created with name: + // export_data-- where + // timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export + // output will be written into that directory. + GcsDestination gcs_destination = 1; + + // The BigQuery location where the output is to be written to. + BigQueryDestination bigquery_destination = 2; + } +} + +// Output configuration for BatchPredict Action. +// +// As destination the +// +// [gcs_destination][google.cloud.automl.v1beta1.BatchPredictOutputConfig.gcs_destination] +// must be set unless specified otherwise for a domain. If gcs_destination is +// set then in the given directory a new directory is created. Its name +// will be +// "prediction--", +// where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. The contents +// of it depends on the ML problem the predictions are made for. +// +// * For Image Classification: +// In the created directory files `image_classification_1.jsonl`, +// `image_classification_2.jsonl`,...,`image_classification_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of the successfully predicted images and annotations. +// A single image will be listed only once with all its annotations, +// and its annotations will never be split across files. +// Each .JSONL file will contain, per line, a JSON representation of a +// proto that wraps image's "ID" : "" followed by a list of +// zero or more AnnotationPayload protos (called annotations), which +// have classification detail populated. +// If prediction for any image failed (partially or completely), then an +// additional `errors_1.jsonl`, `errors_2.jsonl`,..., `errors_N.jsonl` +// files will be created (N depends on total number of failed +// predictions). These files will have a JSON representation of a proto +// that wraps the same "ID" : "" but here followed by +// exactly one +// +// [`google.rpc.Status`](https: +// //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`fields. +// +// * For Image Object Detection: +// In the created directory files `image_object_detection_1.jsonl`, +// `image_object_detection_2.jsonl`,...,`image_object_detection_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of the successfully predicted images and annotations. +// Each .JSONL file will contain, per line, a JSON representation of a +// proto that wraps image's "ID" : "" followed by a list of +// zero or more AnnotationPayload protos (called annotations), which +// have image_object_detection detail populated. A single image will +// be listed only once with all its annotations, and its annotations +// will never be split across files. +// If prediction for any image failed (partially or completely), then +// additional `errors_1.jsonl`, `errors_2.jsonl`,..., `errors_N.jsonl` +// files will be created (N depends on total number of failed +// predictions). These files will have a JSON representation of a proto +// that wraps the same "ID" : "" but here followed by +// exactly one +// +// [`google.rpc.Status`](https: +// //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`fields. +// * For Video Classification: +// In the created directory a video_classification.csv file, and a .JSON +// file per each video classification requested in the input (i.e. each +// line in given CSV(s)), will be created. +// +// The format of video_classification.csv is: +// +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END,JSON_FILE_NAME,STATUS +// where: +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END = matches 1 to 1 +// the prediction input lines (i.e. video_classification.csv has +// precisely the same number of lines as the prediction input had.) +// JSON_FILE_NAME = Name of .JSON file in the output directory, which +// contains prediction responses for the video time segment. +// STATUS = "OK" if prediction completed successfully, or an error code +// with message otherwise. If STATUS is not "OK" then the .JSON file +// for that line may not exist or be empty. +// +// Each .JSON file, assuming STATUS is "OK", will contain a list of +// AnnotationPayload protos in JSON format, which are the predictions +// for the video time segment the file is assigned to in the +// video_classification.csv. All AnnotationPayload protos will have +// video_classification field set, and will be sorted by +// video_classification.type field (note that the returned types are +// governed by `classifaction_types` parameter in +// [PredictService.BatchPredictRequest.params][]). +// +// * For Video Object Tracking: +// In the created directory a video_object_tracking.csv file will be +// created, and multiple files video_object_trackinng_1.json, +// video_object_trackinng_2.json,..., video_object_trackinng_N.json, +// where N is the number of requests in the input (i.e. the number of +// lines in given CSV(s)). +// +// The format of video_object_tracking.csv is: +// +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END,JSON_FILE_NAME,STATUS +// where: +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END = matches 1 to 1 +// the prediction input lines (i.e. video_object_tracking.csv has +// precisely the same number of lines as the prediction input had.) +// JSON_FILE_NAME = Name of .JSON file in the output directory, which +// contains prediction responses for the video time segment. +// STATUS = "OK" if prediction completed successfully, or an error +// code with message otherwise. If STATUS is not "OK" then the .JSON +// file for that line may not exist or be empty. +// +// Each .JSON file, assuming STATUS is "OK", will contain a list of +// AnnotationPayload protos in JSON format, which are the predictions +// for each frame of the video time segment the file is assigned to in +// video_object_tracking.csv. All AnnotationPayload protos will have +// video_object_tracking field set. +// * For Text Classification: +// In the created directory files `text_classification_1.jsonl`, +// `text_classification_2.jsonl`,...,`text_classification_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of inputs and annotations found. +// +// Each .JSONL file will contain, per line, a JSON representation of a +// proto that wraps input text snippet or input text file and a list of +// zero or more AnnotationPayload protos (called annotations), which +// have classification detail populated. A single text snippet or file +// will be listed only once with all its annotations, and its +// annotations will never be split across files. +// +// If prediction for any text snippet or file failed (partially or +// completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,..., +// `errors_N.jsonl` files will be created (N depends on total number of +// failed predictions). These files will have a JSON representation of a +// proto that wraps input text snippet or input text file followed by +// exactly one +// +// [`google.rpc.Status`](https: +// //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`. +// +// * For Text Sentiment: +// In the created directory files `text_sentiment_1.jsonl`, +// `text_sentiment_2.jsonl`,...,`text_sentiment_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of inputs and annotations found. +// +// Each .JSONL file will contain, per line, a JSON representation of a +// proto that wraps input text snippet or input text file and a list of +// zero or more AnnotationPayload protos (called annotations), which +// have text_sentiment detail populated. A single text snippet or file +// will be listed only once with all its annotations, and its +// annotations will never be split across files. +// +// If prediction for any text snippet or file failed (partially or +// completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,..., +// `errors_N.jsonl` files will be created (N depends on total number of +// failed predictions). These files will have a JSON representation of a +// proto that wraps input text snippet or input text file followed by +// exactly one +// +// [`google.rpc.Status`](https: +// //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`. +// +// * For Text Extraction: +// In the created directory files `text_extraction_1.jsonl`, +// `text_extraction_2.jsonl`,...,`text_extraction_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of inputs and annotations found. +// The contents of these .JSONL file(s) depend on whether the input +// used inline text, or documents. +// If input was inline, then each .JSONL file will contain, per line, +// a JSON representation of a proto that wraps given in request text +// snippet's "id" (if specified), followed by input text snippet, +// and a list of zero or more +// AnnotationPayload protos (called annotations), which have +// text_extraction detail populated. A single text snippet will be +// listed only once with all its annotations, and its annotations will +// never be split across files. +// If input used documents, then each .JSONL file will contain, per +// line, a JSON representation of a proto that wraps given in request +// document proto, followed by its OCR-ed representation in the form +// of a text snippet, finally followed by a list of zero or more +// AnnotationPayload protos (called annotations), which have +// text_extraction detail populated and refer, via their indices, to +// the OCR-ed text snippet. A single document (and its text snippet) +// will be listed only once with all its annotations, and its +// annotations will never be split across files. +// If prediction for any text snippet failed (partially or completely), +// then additional `errors_1.jsonl`, `errors_2.jsonl`,..., +// `errors_N.jsonl` files will be created (N depends on total number of +// failed predictions). These files will have a JSON representation of a +// proto that wraps either the "id" : "" (in case of inline) +// or the document proto (in case of document) but here followed by +// exactly one +// +// [`google.rpc.Status`](https: +// //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`. +// +// * For Tables: +// Output depends on whether +// +// [gcs_destination][google.cloud.automl.v1beta1.BatchPredictOutputConfig.gcs_destination] +// or +// +// [bigquery_destination][google.cloud.automl.v1beta1.BatchPredictOutputConfig.bigquery_destination] +// is set (either is allowed). +// GCS case: +// In the created directory files `tables_1.csv`, `tables_2.csv`,..., +// `tables_N.csv` will be created, where N may be 1, and depends on +// the total number of the successfully predicted rows. +// For all CLASSIFICATION +// +// [prediction_type-s][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]: +// Each .csv file will contain a header, listing all columns' +// +// [display_name-s][google.cloud.automl.v1beta1.ColumnSpec.display_name] +// given on input followed by M target column names in the format of +// +// "<[target_column_specs][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec] +// +// [display_name][google.cloud.automl.v1beta1.ColumnSpec.display_name]>__score" where M is the number of distinct target values, +// i.e. number of distinct values in the target column of the table +// used to train the model. Subsequent lines will contain the +// respective values of successfully predicted rows, with the last, +// i.e. the target, columns having the corresponding prediction +// [scores][google.cloud.automl.v1beta1.TablesAnnotation.score]. +// For REGRESSION and FORECASTING +// +// [prediction_type-s][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]: +// Each .csv file will contain a header, listing all columns' +// [display_name-s][google.cloud.automl.v1beta1.display_name] given +// on input followed by the predicted target column with name in the +// format of +// +// "predicted_<[target_column_specs][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec] +// +// [display_name][google.cloud.automl.v1beta1.ColumnSpec.display_name]>" +// Subsequent lines will contain the respective values of +// successfully predicted rows, with the last, i.e. the target, +// column having the predicted target value. +// If prediction for any rows failed, then an additional +// `errors_1.csv`, `errors_2.csv`,..., `errors_N.csv` will be +// created (N depends on total number of failed rows). These files +// will have analogous format as `tables_*.csv`, but always with a +// single target column having +// +// [`google.rpc.Status`](https: +// //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// represented as a JSON string, and containing only `code` and +// `message`. +// BigQuery case: +// +// [bigquery_destination][google.cloud.automl.v1beta1.OutputConfig.bigquery_destination] +// pointing to a BigQuery project must be set. In the given project a +// new dataset will be created with name +// `prediction__` +// where will be made +// BigQuery-dataset-name compatible (e.g. most special characters will +// become underscores), and timestamp will be in +// YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In the dataset +// two tables will be created, `predictions`, and `errors`. +// The `predictions` table's column names will be the input columns' +// +// [display_name-s][google.cloud.automl.v1beta1.ColumnSpec.display_name] +// followed by the target column with name in the format of +// +// "predicted_<[target_column_specs][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec] +// +// [display_name][google.cloud.automl.v1beta1.ColumnSpec.display_name]>" +// The input feature columns will contain the respective values of +// successfully predicted rows, with the target column having an +// ARRAY of +// +// [AnnotationPayloads][google.cloud.automl.v1beta1.AnnotationPayload], +// represented as STRUCT-s, containing +// [TablesAnnotation][google.cloud.automl.v1beta1.TablesAnnotation]. +// The `errors` table contains rows for which the prediction has +// failed, it has analogous input columns while the target column name +// is in the format of +// +// "errors_<[target_column_specs][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec] +// +// [display_name][google.cloud.automl.v1beta1.ColumnSpec.display_name]>", +// and as a value has +// +// [`google.rpc.Status`](https: +// //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// represented as a STRUCT, and containing only `code` and `message`. +message BatchPredictOutputConfig { + // Required. The destination of the output. + oneof destination { + // The Google Cloud Storage location of the directory where the output is to + // be written to. + GcsDestination gcs_destination = 1; + + // The BigQuery location where the output is to be written to. + BigQueryDestination bigquery_destination = 2; + } +} + +// Output configuration for ModelExport Action. +message ModelExportOutputConfig { + // Required. The destination of the output. + oneof destination { + // The Google Cloud Storage location where the model is to be written to. + // This location may only be set for the following model formats: + // "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml". + // + // Under the directory given as the destination a new one with name + // "model-export--", + // where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format, + // will be created. Inside the model and any of its supporting files + // will be written. + GcsDestination gcs_destination = 1; + + // The GCR location where model image is to be pushed to. This location + // may only be set for the following model formats: + // "docker". + // + // The model image will be created under the given URI. + GcrDestination gcr_destination = 3; + } + + // The format in which the model must be exported. The available, and default, + // formats depend on the problem and model type (if given problem and type + // combination doesn't have a format listed, it means its models are not + // exportable): + // + // * For Image Classification mobile-low-latency-1, mobile-versatile-1, + // mobile-high-accuracy-1: + // "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js", + // "docker". + // + // * For Image Classification mobile-core-ml-low-latency-1, + // mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1: + // "core_ml" (default). + // + // * For Image Object Detection mobile-low-latency-1, mobile-versatile-1, + // mobile-high-accuracy-1: + // "tflite", "tf_saved_model", "tf_js". + // + // * For Video Classification cloud, + // "tf_saved_model". + // + // * For Video Object Tracking cloud, + // "tf_saved_model". + // + // * For Video Object Tracking mobile-versatile-1: + // "tflite", "edgetpu_tflite", "tf_saved_model", "docker". + // + // * For Video Object Tracking mobile-coral-versatile-1: + // "tflite", "edgetpu_tflite", "docker". + // + // * For Video Object Tracking mobile-coral-low-latency-1: + // "tflite", "edgetpu_tflite", "docker". + // + // * For Video Object Tracking mobile-jetson-versatile-1: + // "tf_saved_model", "docker". + // + // * For Tables: + // "docker". + // + // Formats description: + // + // * tflite - Used for Android mobile devices. + // * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/) + // devices. + // * tf_saved_model - A tensorflow model in SavedModel format. + // * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can + // be used in the browser and in Node.js using JavaScript. + // * docker - Used for Docker containers. Use the params field to customize + // the container. The container is verified to work correctly on + // ubuntu 16.04 operating system. See more at + // [containers + // + // quickstart](https: + // //cloud.google.com/vision/automl/docs/containers-gcs-quickstart) + // * core_ml - Used for iOS mobile devices. + string model_format = 4; + + // Additional model-type and format specific parameters describing the + // requirements for the to be exported model files, any string must be up to + // 25000 characters long. + // + // * For `docker` format: + // `cpu_architecture` - (string) "x86_64" (default). + // `gpu_architecture` - (string) "none" (default), "nvidia". + map params = 2; +} + +// Output configuration for ExportEvaluatedExamples Action. Note that this call +// is available only for 30 days since the moment the model was evaluated. +// The output depends on the domain, as follows (note that only examples from +// the TEST set are exported): +// +// * For Tables: +// +// [bigquery_destination][google.cloud.automl.v1beta1.OutputConfig.bigquery_destination] +// pointing to a BigQuery project must be set. In the given project a +// new dataset will be created with name +// +// `export_evaluated_examples__` +// where will be made BigQuery-dataset-name +// compatible (e.g. most special characters will become underscores), +// and timestamp will be in YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" +// format. In the dataset an `evaluated_examples` table will be +// created. It will have all the same columns as the +// +// [primary_table][google.cloud.automl.v1beta1.TablesDatasetMetadata.primary_table_spec_id] +// of the +// [dataset][google.cloud.automl.v1beta1.Model.dataset_id] from which +// the model was created, as they were at the moment of model's +// evaluation (this includes the target column with its ground +// truth), followed by a column called "predicted_". That +// last column will contain the model's prediction result for each +// respective row, given as ARRAY of +// [AnnotationPayloads][google.cloud.automl.v1beta1.AnnotationPayload], +// represented as STRUCT-s, containing +// [TablesAnnotation][google.cloud.automl.v1beta1.TablesAnnotation]. +message ExportEvaluatedExamplesOutputConfig { + // Required. The destination of the output. + oneof destination { + // The BigQuery location where the output is to be written to. + BigQueryDestination bigquery_destination = 2; + } +} + +// The Google Cloud Storage location for the input content. +message GcsSource { + // Required. Google Cloud Storage URIs to input files, up to 2000 characters + // long. Accepted forms: + // * Full object path, e.g. gs://bucket/directory/object.csv + repeated string input_uris = 1; +} + +// The BigQuery location for the input content. +message BigQuerySource { + // Required. BigQuery URI to a table, up to 2000 characters long. + // Accepted forms: + // * BigQuery path e.g. bq://projectId.bqDatasetId.bqTableId + string input_uri = 1; +} + +// The Google Cloud Storage location where the output is to be written to. +message GcsDestination { + // Required. Google Cloud Storage URI to output directory, up to 2000 + // characters long. + // Accepted forms: + // * Prefix path: gs://bucket/directory + // The requesting user must have write permission to the bucket. + // The directory is created if it doesn't exist. + string output_uri_prefix = 1; +} + +// The BigQuery location for the output content. +message BigQueryDestination { + // Required. BigQuery URI to a project, up to 2000 characters long. + // Accepted forms: + // * BigQuery path e.g. bq://projectId + string output_uri = 1; +} + +// The GCR location where the image must be pushed to. +message GcrDestination { + // Required. Google Contained Registry URI of the new image, up to 2000 + // characters long. See + // + // https: + // //cloud.google.com/container-registry/do + // // cs/pushing-and-pulling#pushing_an_image_to_a_registry + // Accepted forms: + // * [HOSTNAME]/[PROJECT-ID]/[IMAGE] + // * [HOSTNAME]/[PROJECT-ID]/[IMAGE]:[TAG] + // + // The requesting user must have permission to push images the project. + string output_uri = 1; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/model.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/model.proto new file mode 100644 index 00000000000..9db5e4866e7 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/model.proto @@ -0,0 +1,107 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + +import "google/api/resource.proto"; +import "google/cloud/automl/v1beta1/image.proto"; +import "google/cloud/automl/v1beta1/tables.proto"; +import "google/cloud/automl/v1beta1/text.proto"; +import "google/cloud/automl/v1beta1/translation.proto"; +import "google/cloud/automl/v1beta1/video.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// API proto representing a trained machine learning model. +message Model { + option (google.api.resource) = { + type: "automl.googleapis.com/Model" + pattern: "projects/{project}/locations/{location}/models/{model}" + }; + + // Deployment state of the model. + enum DeploymentState { + // Should not be used, an un-set enum has this value by default. + DEPLOYMENT_STATE_UNSPECIFIED = 0; + + // Model is deployed. + DEPLOYED = 1; + + // Model is not deployed. + UNDEPLOYED = 2; + } + + // Required. + // The model metadata that is specific to the problem type. + // Must match the metadata type of the dataset used to train the model. + oneof model_metadata { + // Metadata for translation models. + TranslationModelMetadata translation_model_metadata = 15; + + // Metadata for image classification models. + ImageClassificationModelMetadata image_classification_model_metadata = 13; + + // Metadata for text classification models. + TextClassificationModelMetadata text_classification_model_metadata = 14; + + // Metadata for image object detection models. + ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + + // Metadata for video classification models. + VideoClassificationModelMetadata video_classification_model_metadata = 23; + + // Metadata for video object tracking models. + VideoObjectTrackingModelMetadata video_object_tracking_model_metadata = 21; + + // Metadata for text extraction models. + TextExtractionModelMetadata text_extraction_model_metadata = 19; + + // Metadata for Tables models. + TablesModelMetadata tables_model_metadata = 24; + + // Metadata for text sentiment models. + TextSentimentModelMetadata text_sentiment_model_metadata = 22; + } + + // Output only. Resource name of the model. + // Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` + string name = 1; + + // Required. The name of the model to show in the interface. The name can be + // up to 32 characters long and can consist only of ASCII Latin letters A-Z + // and a-z, underscores + // (_), and ASCII digits 0-9. It must start with a letter. + string display_name = 2; + + // Required. The resource ID of the dataset used to create the model. The dataset must + // come from the same ancestor project and location. + string dataset_id = 3; + + // Output only. Timestamp when the model training finished and can be used for prediction. + google.protobuf.Timestamp create_time = 7; + + // Output only. Timestamp when this model was last updated. + google.protobuf.Timestamp update_time = 11; + + // Output only. Deployment state of the model. A model can only serve + // prediction requests after it gets deployed. + DeploymentState deployment_state = 8; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/model_evaluation.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/model_evaluation.proto new file mode 100644 index 00000000000..91801bd36fb --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/model_evaluation.proto @@ -0,0 +1,115 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + +import "google/api/resource.proto"; +import "google/cloud/automl/v1beta1/classification.proto"; +import "google/cloud/automl/v1beta1/detection.proto"; +import "google/cloud/automl/v1beta1/regression.proto"; +import "google/cloud/automl/v1beta1/tables.proto"; +import "google/cloud/automl/v1beta1/text_extraction.proto"; +import "google/cloud/automl/v1beta1/text_sentiment.proto"; +import "google/cloud/automl/v1beta1/translation.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Evaluation results of a model. +message ModelEvaluation { + option (google.api.resource) = { + type: "automl.googleapis.com/ModelEvaluation" + pattern: "projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}" + }; + + // Output only. Problem type specific evaluation metrics. + oneof metrics { + // Model evaluation metrics for image, text, video and tables + // classification. + // Tables problem is considered a classification when the target column + // is CATEGORY DataType. + ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + + // Model evaluation metrics for Tables regression. + // Tables problem is considered a regression when the target column + // has FLOAT64 DataType. + RegressionEvaluationMetrics regression_evaluation_metrics = 24; + + // Model evaluation metrics for translation. + TranslationEvaluationMetrics translation_evaluation_metrics = 9; + + // Model evaluation metrics for image object detection. + ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + + // Model evaluation metrics for video object tracking. + VideoObjectTrackingEvaluationMetrics video_object_tracking_evaluation_metrics = 14; + + // Evaluation metrics for text sentiment models. + TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + + // Evaluation metrics for text extraction models. + TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; + } + + // Output only. Resource name of the model evaluation. + // Format: + // + // `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}` + string name = 1; + + // Output only. The ID of the annotation spec that the model evaluation applies to. The + // The ID is empty for the overall model evaluation. + // For Tables annotation specs in the dataset do not exist and this ID is + // always not set, but for CLASSIFICATION + // + // [prediction_type-s][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type] + // the + // [display_name][google.cloud.automl.v1beta1.ModelEvaluation.display_name] + // field is used. + string annotation_spec_id = 2; + + // Output only. The value of + // [display_name][google.cloud.automl.v1beta1.AnnotationSpec.display_name] at + // the moment when the model was trained. Because this field returns a value + // at model training time, for different models trained from the same dataset, + // the values may differ, since display names could had been changed between + // the two model's trainings. + // For Tables CLASSIFICATION + // + // [prediction_type-s][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type] + // distinct values of the target column at the moment of the model evaluation + // are populated here. + // The display_name is empty for the overall model evaluation. + string display_name = 15; + + // Output only. Timestamp when this model evaluation was created. + google.protobuf.Timestamp create_time = 5; + + // Output only. The number of examples used for model evaluation, i.e. for + // which ground truth from time of model creation is compared against the + // predicted annotations created by the model. + // For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is + // the total number of all examples used for evaluation. + // Otherwise, this is the count of examples that according to the ground + // truth were annotated by the + // + // [annotation_spec_id][google.cloud.automl.v1beta1.ModelEvaluation.annotation_spec_id]. + int32 evaluated_example_count = 6; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/operations.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/operations.proto new file mode 100644 index 00000000000..f75e48d14c7 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/operations.proto @@ -0,0 +1,187 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + +import "google/cloud/automl/v1beta1/io.proto"; +import "google/cloud/automl/v1beta1/model.proto"; +import "google/cloud/automl/v1beta1/model_evaluation.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Metadata used across all long running operations returned by AutoML API. +message OperationMetadata { + // Ouptut only. Details of specific operation. Even if this field is empty, + // the presence allows to distinguish different types of operations. + oneof details { + // Details of a Delete operation. + DeleteOperationMetadata delete_details = 8; + + // Details of a DeployModel operation. + DeployModelOperationMetadata deploy_model_details = 24; + + // Details of an UndeployModel operation. + UndeployModelOperationMetadata undeploy_model_details = 25; + + // Details of CreateModel operation. + CreateModelOperationMetadata create_model_details = 10; + + // Details of ImportData operation. + ImportDataOperationMetadata import_data_details = 15; + + // Details of BatchPredict operation. + BatchPredictOperationMetadata batch_predict_details = 16; + + // Details of ExportData operation. + ExportDataOperationMetadata export_data_details = 21; + + // Details of ExportModel operation. + ExportModelOperationMetadata export_model_details = 22; + + // Details of ExportEvaluatedExamples operation. + ExportEvaluatedExamplesOperationMetadata export_evaluated_examples_details = 26; + } + + // Output only. Progress of operation. Range: [0, 100]. + // Not used currently. + int32 progress_percent = 13; + + // Output only. Partial failures encountered. + // E.g. single files that couldn't be read. + // This field should never exceed 20 entries. + // Status details field will contain standard GCP error details. + repeated google.rpc.Status partial_failures = 2; + + // Output only. Time when the operation was created. + google.protobuf.Timestamp create_time = 3; + + // Output only. Time when the operation was updated for the last time. + google.protobuf.Timestamp update_time = 4; +} + +// Details of operations that perform deletes of any entities. +message DeleteOperationMetadata { + +} + +// Details of DeployModel operation. +message DeployModelOperationMetadata { + +} + +// Details of UndeployModel operation. +message UndeployModelOperationMetadata { + +} + +// Details of CreateModel operation. +message CreateModelOperationMetadata { + +} + +// Details of ImportData operation. +message ImportDataOperationMetadata { + +} + +// Details of ExportData operation. +message ExportDataOperationMetadata { + // Further describes this export data's output. + // Supplements + // [OutputConfig][google.cloud.automl.v1beta1.OutputConfig]. + message ExportDataOutputInfo { + // The output location to which the exported data is written. + oneof output_location { + // The full path of the Google Cloud Storage directory created, into which + // the exported data is written. + string gcs_output_directory = 1; + + // The path of the BigQuery dataset created, in bq://projectId.bqDatasetId + // format, into which the exported data is written. + string bigquery_output_dataset = 2; + } + } + + // Output only. Information further describing this export data's output. + ExportDataOutputInfo output_info = 1; +} + +// Details of BatchPredict operation. +message BatchPredictOperationMetadata { + // Further describes this batch predict's output. + // Supplements + // + // [BatchPredictOutputConfig][google.cloud.automl.v1beta1.BatchPredictOutputConfig]. + message BatchPredictOutputInfo { + // The output location into which prediction output is written. + oneof output_location { + // The full path of the Google Cloud Storage directory created, into which + // the prediction output is written. + string gcs_output_directory = 1; + + // The path of the BigQuery dataset created, in bq://projectId.bqDatasetId + // format, into which the prediction output is written. + string bigquery_output_dataset = 2; + } + } + + // Output only. The input config that was given upon starting this + // batch predict operation. + BatchPredictInputConfig input_config = 1; + + // Output only. Information further describing this batch predict's output. + BatchPredictOutputInfo output_info = 2; +} + +// Details of ExportModel operation. +message ExportModelOperationMetadata { + // Further describes the output of model export. + // Supplements + // + // [ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. + message ExportModelOutputInfo { + // The full path of the Google Cloud Storage directory created, into which + // the model will be exported. + string gcs_output_directory = 1; + } + + // Output only. Information further describing the output of this model + // export. + ExportModelOutputInfo output_info = 2; +} + +// Details of EvaluatedExamples operation. +message ExportEvaluatedExamplesOperationMetadata { + // Further describes the output of the evaluated examples export. + // Supplements + // + // [ExportEvaluatedExamplesOutputConfig][google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig]. + message ExportEvaluatedExamplesOutputInfo { + // The path of the BigQuery dataset created, in bq://projectId.bqDatasetId + // format, into which the output of export evaluated examples is written. + string bigquery_output_dataset = 2; + } + + // Output only. Information further describing the output of this evaluated + // examples export. + ExportEvaluatedExamplesOutputInfo output_info = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/prediction_service.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/prediction_service.proto new file mode 100644 index 00000000000..28148a576e3 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/prediction_service.proto @@ -0,0 +1,268 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.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/automl/v1beta1/annotation_payload.proto"; +import "google/cloud/automl/v1beta1/data_items.proto"; +import "google/cloud/automl/v1beta1/io.proto"; +import "google/cloud/automl/v1beta1/operations.proto"; +import "google/longrunning/operations.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "PredictionServiceProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// AutoML Prediction API. +// +// On any input that is documented to expect a string parameter in +// snake_case or kebab-case, either of those cases is accepted. +service PredictionService { + option (google.api.default_host) = "automl.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Perform an online prediction. The prediction result will be directly + // returned in the response. + // Available for following ML problems, and their expected request payloads: + // * Image Classification - Image in .JPEG, .GIF or .PNG format, image_bytes + // up to 30MB. + // * Image Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes + // up to 30MB. + // * Text Classification - TextSnippet, content up to 60,000 characters, + // UTF-8 encoded. + // * Text Extraction - TextSnippet, content up to 30,000 characters, + // UTF-8 NFC encoded. + // * Translation - TextSnippet, content up to 25,000 characters, UTF-8 + // encoded. + // * Tables - Row, with column values matching the columns of the model, + // up to 5MB. Not available for FORECASTING + // + // [prediction_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]. + // * Text Sentiment - TextSnippet, content up 500 characters, UTF-8 + // encoded. + rpc Predict(PredictRequest) returns (PredictResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/models/*}:predict" + body: "*" + }; + option (google.api.method_signature) = "name,payload,params"; + } + + // Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1beta1.PredictionService.Predict], batch + // prediction result won't be immediately available in the response. Instead, + // a long running operation object is returned. User can poll the operation + // result via [GetOperation][google.longrunning.Operations.GetOperation] + // method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1beta1.BatchPredictResult] is returned in + // the [response][google.longrunning.Operation.response] field. + // Available for following ML problems: + // * Image Classification + // * Image Object Detection + // * Video Classification + // * Video Object Tracking * Text Extraction + // * Tables + rpc BatchPredict(BatchPredictRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/models/*}:batchPredict" + body: "*" + }; + option (google.api.method_signature) = "name,input_config,output_config,params"; + option (google.longrunning.operation_info) = { + response_type: "BatchPredictResult" + metadata_type: "OperationMetadata" + }; + } +} + +// Request message for [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict]. +message PredictRequest { + // Required. Name of the model requested to serve the prediction. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; + + // Required. Payload to perform a prediction on. The payload must match the + // problem type that the model was trained to solve. + ExamplePayload payload = 2 [(google.api.field_behavior) = REQUIRED]; + + // Additional domain-specific parameters, any string must be up to 25000 + // characters long. + // + // * For Image Classification: + // + // `score_threshold` - (float) A value from 0.0 to 1.0. When the model + // makes predictions for an image, it will only produce results that have + // at least this confidence score. The default is 0.5. + // + // * For Image Object Detection: + // `score_threshold` - (float) When Model detects objects on the image, + // it will only produce bounding boxes which have at least this + // confidence score. Value in 0 to 1 range, default is 0.5. + // `max_bounding_box_count` - (int64) No more than this number of bounding + // boxes will be returned in the response. Default is 100, the + // requested value may be limited by server. + // * For Tables: + // feature_importance - (boolean) Whether feature importance + // should be populated in the returned TablesAnnotation. + // The default is false. + map params = 3; +} + +// Response message for [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict]. +message PredictResponse { + // Prediction result. + // Translation and Text Sentiment will return precisely one payload. + repeated AnnotationPayload payload = 1; + + // The preprocessed example that AutoML actually makes prediction on. + // Empty if AutoML does not preprocess the input example. + // * For Text Extraction: + // If the input is a .pdf file, the OCR'ed text will be provided in + // [document_text][google.cloud.automl.v1beta1.Document.document_text]. + ExamplePayload preprocessed_input = 3; + + // Additional domain-specific prediction response metadata. + // + // * For Image Object Detection: + // `max_bounding_box_count` - (int64) At most that many bounding boxes per + // image could have been returned. + // + // * For Text Sentiment: + // `sentiment_score` - (float, deprecated) A value between -1 and 1, + // -1 maps to least positive sentiment, while 1 maps to the most positive + // one and the higher the score, the more positive the sentiment in the + // document is. Yet these values are relative to the training data, so + // e.g. if all data was positive then -1 will be also positive (though + // the least). + // The sentiment_score shouldn't be confused with "score" or "magnitude" + // from the previous Natural Language Sentiment Analysis API. + map metadata = 2; +} + +// Request message for [PredictionService.BatchPredict][google.cloud.automl.v1beta1.PredictionService.BatchPredict]. +message BatchPredictRequest { + // Required. Name of the model requested to serve the batch prediction. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; + + // Required. The input configuration for batch prediction. + BatchPredictInputConfig input_config = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Configuration specifying where output predictions should + // be written. + BatchPredictOutputConfig output_config = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. Additional domain-specific parameters for the predictions, any string must + // be up to 25000 characters long. + // + // * For Text Classification: + // + // `score_threshold` - (float) A value from 0.0 to 1.0. When the model + // makes predictions for a text snippet, it will only produce results + // that have at least this confidence score. The default is 0.5. + // + // * For Image Classification: + // + // `score_threshold` - (float) A value from 0.0 to 1.0. When the model + // makes predictions for an image, it will only produce results that + // have at least this confidence score. The default is 0.5. + // + // * For Image Object Detection: + // + // `score_threshold` - (float) When Model detects objects on the image, + // it will only produce bounding boxes which have at least this + // confidence score. Value in 0 to 1 range, default is 0.5. + // `max_bounding_box_count` - (int64) No more than this number of bounding + // boxes will be produced per image. Default is 100, the + // requested value may be limited by server. + // + // * For Video Classification : + // + // `score_threshold` - (float) A value from 0.0 to 1.0. When the model + // makes predictions for a video, it will only produce results that + // have at least this confidence score. The default is 0.5. + // `segment_classification` - (boolean) Set to true to request + // segment-level classification. AutoML Video Intelligence returns + // labels and their confidence scores for the entire segment of the + // video that user specified in the request configuration. + // The default is "true". + // `shot_classification` - (boolean) Set to true to request shot-level + // classification. AutoML Video Intelligence determines the boundaries + // for each camera shot in the entire segment of the video that user + // specified in the request configuration. AutoML Video Intelligence + // then returns labels and their confidence scores for each detected + // shot, along with the start and end time of the shot. + // WARNING: Model evaluation is not done for this classification type, + // the quality of it depends on training data, but there are no metrics + // provided to describe that quality. The default is "false". + // `1s_interval_classification` - (boolean) Set to true to request + // classification for a video at one-second intervals. AutoML Video + // Intelligence returns labels and their confidence scores for each + // second of the entire segment of the video that user specified in the + // request configuration. + // WARNING: Model evaluation is not done for this classification + // type, the quality of it depends on training data, but there are no + // metrics provided to describe that quality. The default is + // "false". + // + // * For Tables: + // + // feature_importance - (boolean) Whether feature importance + // should be populated in the returned TablesAnnotations. The + // default is false. + // + // * For Video Object Tracking: + // + // `score_threshold` - (float) When Model detects objects on video frames, + // it will only produce bounding boxes which have at least this + // confidence score. Value in 0 to 1 range, default is 0.5. + // `max_bounding_box_count` - (int64) No more than this number of bounding + // boxes will be returned per frame. Default is 100, the requested + // value may be limited by server. + // `min_bounding_box_size` - (float) Only bounding boxes with shortest edge + // at least that long as a relative value of video frame size will be + // returned. Value in 0 to 1 range. Default is 0. + map params = 5 [(google.api.field_behavior) = REQUIRED]; +} + +// Result of the Batch Predict. This message is returned in +// [response][google.longrunning.Operation.response] of the operation returned +// by the [PredictionService.BatchPredict][google.cloud.automl.v1beta1.PredictionService.BatchPredict]. +message BatchPredictResult { + // Additional domain-specific prediction response metadata. + // + // * For Image Object Detection: + // `max_bounding_box_count` - (int64) At most that many bounding boxes per + // image could have been returned. + // + // * For Video Object Tracking: + // `max_bounding_box_count` - (int64) At most that many bounding boxes per + // frame could have been returned. + map metadata = 1; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/ranges.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/ranges.proto new file mode 100644 index 00000000000..35ebb569a11 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/ranges.proto @@ -0,0 +1,34 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "RangesProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// A range between two double numbers. +message DoubleRange { + // Start of the range, inclusive. + double start = 1; + + // End of the range, exclusive. + double end = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/regression.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/regression.proto new file mode 100644 index 00000000000..3c6b269a6be --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/regression.proto @@ -0,0 +1,43 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_outer_classname = "RegressionProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Metrics for regression problems. +message RegressionEvaluationMetrics { + // Output only. Root Mean Squared Error (RMSE). + float root_mean_squared_error = 1; + + // Output only. Mean Absolute Error (MAE). + float mean_absolute_error = 2; + + // Output only. Mean absolute percentage error. Only set if all ground truth + // values are are positive. + float mean_absolute_percentage_error = 3; + + // Output only. R squared. + float r_squared = 4; + + // Output only. Root mean squared log error. + float root_mean_squared_log_error = 5; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/service.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/service.proto new file mode 100644 index 00000000000..f4ac32315f9 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/service.proto @@ -0,0 +1,801 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.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/automl/v1beta1/annotation_payload.proto"; +import "google/cloud/automl/v1beta1/annotation_spec.proto"; +import "google/cloud/automl/v1beta1/column_spec.proto"; +import "google/cloud/automl/v1beta1/dataset.proto"; +import "google/cloud/automl/v1beta1/image.proto"; +import "google/cloud/automl/v1beta1/io.proto"; +import "google/cloud/automl/v1beta1/model.proto"; +import "google/cloud/automl/v1beta1/model_evaluation.proto"; +import "google/cloud/automl/v1beta1/operations.proto"; +import "google/cloud/automl/v1beta1/table_spec.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "AutoMlProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// AutoML Server API. +// +// The resource names are assigned by the server. +// The server never reuses names that it has created after the resources with +// those names are deleted. +// +// An ID of a resource is the last element of the item's resource name. For +// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then +// the id for the item is `{dataset_id}`. +// +// Currently the only supported `location_id` is "us-central1". +// +// On any input that is documented to expect a string parameter in +// snake_case or kebab-case, either of those cases is accepted. +service AutoMl { + option (google.api.default_host) = "automl.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a dataset. + rpc CreateDataset(CreateDatasetRequest) returns (Dataset) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/datasets" + body: "dataset" + }; + option (google.api.method_signature) = "parent,dataset"; + } + + // Gets a dataset. + rpc GetDataset(GetDatasetRequest) returns (Dataset) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/datasets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists datasets in a project. + rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/datasets" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a dataset. + rpc UpdateDataset(UpdateDatasetRequest) returns (Dataset) { + option (google.api.http) = { + patch: "/v1beta1/{dataset.name=projects/*/locations/*/datasets/*}" + body: "dataset" + }; + option (google.api.method_signature) = "dataset"; + } + + // Deletes a dataset and all of its contents. + // Returns empty response in the + // [response][google.longrunning.Operation.response] field when it completes, + // and `delete_details` in the + // [metadata][google.longrunning.Operation.metadata] field. + rpc DeleteDataset(DeleteDatasetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/datasets/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Imports data into a dataset. + // For Tables this method can only be called on an empty Dataset. + // + // For Tables: + // * A + // [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] + // parameter must be explicitly set. + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc ImportData(ImportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/datasets/*}:importData" + body: "*" + }; + option (google.api.method_signature) = "name,input_config"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Exports dataset's data to the provided output location. + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc ExportData(ExportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/datasets/*}:exportData" + body: "*" + }; + option (google.api.method_signature) = "name,output_config"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Gets an annotation spec. + rpc GetAnnotationSpec(GetAnnotationSpecRequest) returns (AnnotationSpec) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a table spec. + rpc GetTableSpec(GetTableSpecRequest) returns (TableSpec) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/datasets/*/tableSpecs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists table specs in a dataset. + rpc ListTableSpecs(ListTableSpecsRequest) returns (ListTableSpecsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/datasets/*}/tableSpecs" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a table spec. + rpc UpdateTableSpec(UpdateTableSpecRequest) returns (TableSpec) { + option (google.api.http) = { + patch: "/v1beta1/{table_spec.name=projects/*/locations/*/datasets/*/tableSpecs/*}" + body: "table_spec" + }; + option (google.api.method_signature) = "table_spec"; + } + + // Gets a column spec. + rpc GetColumnSpec(GetColumnSpecRequest) returns (ColumnSpec) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/datasets/*/tableSpecs/*/columnSpecs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists column specs in a table spec. + rpc ListColumnSpecs(ListColumnSpecsRequest) returns (ListColumnSpecsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/datasets/*/tableSpecs/*}/columnSpecs" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a column spec. + rpc UpdateColumnSpec(UpdateColumnSpecRequest) returns (ColumnSpec) { + option (google.api.http) = { + patch: "/v1beta1/{column_spec.name=projects/*/locations/*/datasets/*/tableSpecs/*/columnSpecs/*}" + body: "column_spec" + }; + option (google.api.method_signature) = "column_spec"; + } + + // Creates a model. + // Returns a Model in the [response][google.longrunning.Operation.response] + // field when it completes. + // When you create a model, several model evaluations are created for it: + // a global evaluation, and one evaluation for each annotation spec. + rpc CreateModel(CreateModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/models" + body: "model" + }; + option (google.api.method_signature) = "parent,model"; + option (google.longrunning.operation_info) = { + response_type: "Model" + metadata_type: "OperationMetadata" + }; + } + + // Gets a model. + rpc GetModel(GetModelRequest) returns (Model) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/models/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists models. + rpc ListModels(ListModelsRequest) returns (ListModelsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/models" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a model. + // Returns `google.protobuf.Empty` in the + // [response][google.longrunning.Operation.response] field when it completes, + // and `delete_details` in the + // [metadata][google.longrunning.Operation.metadata] field. + rpc DeleteModel(DeleteModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/models/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Deploys a model. If a model is already deployed, deploying it with the + // same parameters has no effect. Deploying with different parametrs + // (as e.g. changing + // + // [node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) + // will reset the deployment state without pausing the model's availability. + // + // Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage + // deployment automatically. + // + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc DeployModel(DeployModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/models/*}:deploy" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Undeploys a model. If the model is not deployed this method has no effect. + // + // Only applicable for Text Classification, Image Object Detection and Tables; + // all other domains manage deployment automatically. + // + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc UndeployModel(UndeployModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/models/*}:undeploy" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Exports a trained, "export-able", model to a user specified Google Cloud + // Storage location. A model is considered export-able if and only if it has + // an export format defined for it in + // + // [ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. + // + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc ExportModel(ExportModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/models/*}:export" + body: "*" + }; + option (google.api.method_signature) = "name,output_config"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Exports examples on which the model was evaluated (i.e. which were in the + // TEST set of the dataset the model was created from), together with their + // ground truth annotations and the annotations created (predicted) by the + // model. + // The examples, ground truth and predictions are exported in the state + // they were at the moment the model was evaluated. + // + // This export is available only for 30 days since the model evaluation is + // created. + // + // Currently only available for Tables. + // + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc ExportEvaluatedExamples(ExportEvaluatedExamplesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/models/*}:exportEvaluatedExamples" + body: "*" + }; + option (google.api.method_signature) = "name,output_config"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Gets a model evaluation. + rpc GetModelEvaluation(GetModelEvaluationRequest) returns (ModelEvaluation) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/models/*/modelEvaluations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists model evaluations. + rpc ListModelEvaluations(ListModelEvaluationsRequest) returns (ListModelEvaluationsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/models/*}/modelEvaluations" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request message for [AutoMl.CreateDataset][google.cloud.automl.v1beta1.AutoMl.CreateDataset]. +message CreateDatasetRequest { + // Required. The resource name of the project to create the dataset for. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The dataset to create. + Dataset dataset = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.GetDataset][google.cloud.automl.v1beta1.AutoMl.GetDataset]. +message GetDatasetRequest { + // Required. The resource name of the dataset to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + } + ]; +} + +// Request message for [AutoMl.ListDatasets][google.cloud.automl.v1beta1.AutoMl.ListDatasets]. +message ListDatasetsRequest { + // Required. The resource name of the project from which to list datasets. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // An expression for filtering the results of the request. + // + // * `dataset_metadata` - for existence of the case (e.g. + // `image_classification_dataset_metadata:*`). Some examples of + // using the filter are: + // + // * `translation_dataset_metadata:*` --> The dataset has + // `translation_dataset_metadata`. + string filter = 3; + + // Requested page size. Server may return fewer results than requested. + // If unspecified, server will pick a default size. + int32 page_size = 4; + + // A token identifying a page of results for the server to return + // Typically obtained via + // [ListDatasetsResponse.next_page_token][google.cloud.automl.v1beta1.ListDatasetsResponse.next_page_token] of the previous + // [AutoMl.ListDatasets][google.cloud.automl.v1beta1.AutoMl.ListDatasets] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListDatasets][google.cloud.automl.v1beta1.AutoMl.ListDatasets]. +message ListDatasetsResponse { + // The datasets read. + repeated Dataset datasets = 1; + + // A token to retrieve next page of results. + // Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1beta1.ListDatasetsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [AutoMl.UpdateDataset][google.cloud.automl.v1beta1.AutoMl.UpdateDataset] +message UpdateDatasetRequest { + // Required. The dataset which replaces the resource on the server. + Dataset dataset = 1 [(google.api.field_behavior) = REQUIRED]; + + // The update mask applies to the resource. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for [AutoMl.DeleteDataset][google.cloud.automl.v1beta1.AutoMl.DeleteDataset]. +message DeleteDatasetRequest { + // Required. The resource name of the dataset to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + } + ]; +} + +// Request message for [AutoMl.ImportData][google.cloud.automl.v1beta1.AutoMl.ImportData]. +message ImportDataRequest { + // Required. Dataset name. Dataset must already exist. All imported + // annotations and examples will be added. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + } + ]; + + // Required. The desired input location and its domain specific semantics, + // if any. + InputConfig input_config = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.ExportData][google.cloud.automl.v1beta1.AutoMl.ExportData]. +message ExportDataRequest { + // Required. The resource name of the dataset. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + } + ]; + + // Required. The desired output location. + OutputConfig output_config = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.GetAnnotationSpec][google.cloud.automl.v1beta1.AutoMl.GetAnnotationSpec]. +message GetAnnotationSpecRequest { + // Required. The resource name of the annotation spec to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/AnnotationSpec" + } + ]; +} + +// Request message for [AutoMl.GetTableSpec][google.cloud.automl.v1beta1.AutoMl.GetTableSpec]. +message GetTableSpecRequest { + // Required. The resource name of the table spec to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/TableSpec" + } + ]; + + // Mask specifying which fields to read. + google.protobuf.FieldMask field_mask = 2; +} + +// Request message for [AutoMl.ListTableSpecs][google.cloud.automl.v1beta1.AutoMl.ListTableSpecs]. +message ListTableSpecsRequest { + // Required. The resource name of the dataset to list table specs from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + } + ]; + + // Mask specifying which fields to read. + google.protobuf.FieldMask field_mask = 2; + + // Filter expression, see go/filtering. + string filter = 3; + + // Requested page size. The server can return fewer results than requested. + // If unspecified, the server will pick a default size. + int32 page_size = 4; + + // A token identifying a page of results for the server to return. + // Typically obtained from the + // [ListTableSpecsResponse.next_page_token][google.cloud.automl.v1beta1.ListTableSpecsResponse.next_page_token] field of the previous + // [AutoMl.ListTableSpecs][google.cloud.automl.v1beta1.AutoMl.ListTableSpecs] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListTableSpecs][google.cloud.automl.v1beta1.AutoMl.ListTableSpecs]. +message ListTableSpecsResponse { + // The table specs read. + repeated TableSpec table_specs = 1; + + // A token to retrieve next page of results. + // Pass to [ListTableSpecsRequest.page_token][google.cloud.automl.v1beta1.ListTableSpecsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [AutoMl.UpdateTableSpec][google.cloud.automl.v1beta1.AutoMl.UpdateTableSpec] +message UpdateTableSpecRequest { + // Required. The table spec which replaces the resource on the server. + TableSpec table_spec = 1 [(google.api.field_behavior) = REQUIRED]; + + // The update mask applies to the resource. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for [AutoMl.GetColumnSpec][google.cloud.automl.v1beta1.AutoMl.GetColumnSpec]. +message GetColumnSpecRequest { + // Required. The resource name of the column spec to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/ColumnSpec" + } + ]; + + // Mask specifying which fields to read. + google.protobuf.FieldMask field_mask = 2; +} + +// Request message for [AutoMl.ListColumnSpecs][google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs]. +message ListColumnSpecsRequest { + // Required. The resource name of the table spec to list column specs from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/TableSpec" + } + ]; + + // Mask specifying which fields to read. + google.protobuf.FieldMask field_mask = 2; + + // Filter expression, see go/filtering. + string filter = 3; + + // Requested page size. The server can return fewer results than requested. + // If unspecified, the server will pick a default size. + int32 page_size = 4; + + // A token identifying a page of results for the server to return. + // Typically obtained from the + // [ListColumnSpecsResponse.next_page_token][google.cloud.automl.v1beta1.ListColumnSpecsResponse.next_page_token] field of the previous + // [AutoMl.ListColumnSpecs][google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListColumnSpecs][google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs]. +message ListColumnSpecsResponse { + // The column specs read. + repeated ColumnSpec column_specs = 1; + + // A token to retrieve next page of results. + // Pass to [ListColumnSpecsRequest.page_token][google.cloud.automl.v1beta1.ListColumnSpecsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [AutoMl.UpdateColumnSpec][google.cloud.automl.v1beta1.AutoMl.UpdateColumnSpec] +message UpdateColumnSpecRequest { + // Required. The column spec which replaces the resource on the server. + ColumnSpec column_spec = 1 [(google.api.field_behavior) = REQUIRED]; + + // The update mask applies to the resource. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for [AutoMl.CreateModel][google.cloud.automl.v1beta1.AutoMl.CreateModel]. +message CreateModelRequest { + // Required. Resource name of the parent project where the model is being created. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The model to create. + Model model = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.GetModel][google.cloud.automl.v1beta1.AutoMl.GetModel]. +message GetModelRequest { + // Required. Resource name of the model. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; +} + +// Request message for [AutoMl.ListModels][google.cloud.automl.v1beta1.AutoMl.ListModels]. +message ListModelsRequest { + // Required. Resource name of the project, from which to list the models. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // An expression for filtering the results of the request. + // + // * `model_metadata` - for existence of the case (e.g. + // `video_classification_model_metadata:*`). + // * `dataset_id` - for = or !=. Some examples of using the filter are: + // + // * `image_classification_model_metadata:*` --> The model has + // `image_classification_model_metadata`. + // * `dataset_id=5` --> The model was created from a dataset with ID 5. + string filter = 3; + + // Requested page size. + int32 page_size = 4; + + // A token identifying a page of results for the server to return + // Typically obtained via + // [ListModelsResponse.next_page_token][google.cloud.automl.v1beta1.ListModelsResponse.next_page_token] of the previous + // [AutoMl.ListModels][google.cloud.automl.v1beta1.AutoMl.ListModels] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListModels][google.cloud.automl.v1beta1.AutoMl.ListModels]. +message ListModelsResponse { + // List of models in the requested page. + repeated Model model = 1; + + // A token to retrieve next page of results. + // Pass to [ListModelsRequest.page_token][google.cloud.automl.v1beta1.ListModelsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [AutoMl.DeleteModel][google.cloud.automl.v1beta1.AutoMl.DeleteModel]. +message DeleteModelRequest { + // Required. Resource name of the model being deleted. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; +} + +// Request message for [AutoMl.DeployModel][google.cloud.automl.v1beta1.AutoMl.DeployModel]. +message DeployModelRequest { + // The per-domain specific deployment parameters. + oneof model_deployment_metadata { + // Model deployment metadata specific to Image Object Detection. + ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + + // Model deployment metadata specific to Image Classification. + ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + } + + // Required. Resource name of the model to deploy. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; +} + +// Request message for [AutoMl.UndeployModel][google.cloud.automl.v1beta1.AutoMl.UndeployModel]. +message UndeployModelRequest { + // Required. Resource name of the model to undeploy. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; +} + +// Request message for [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]. +// Models need to be enabled for exporting, otherwise an error code will be +// returned. +message ExportModelRequest { + // Required. The resource name of the model to export. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; + + // Required. The desired output location and configuration. + ModelExportOutputConfig output_config = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.ExportEvaluatedExamples][google.cloud.automl.v1beta1.AutoMl.ExportEvaluatedExamples]. +message ExportEvaluatedExamplesRequest { + // Required. The resource name of the model whose evaluated examples are to + // be exported. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; + + // Required. The desired output location and configuration. + ExportEvaluatedExamplesOutputConfig output_config = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.GetModelEvaluation][google.cloud.automl.v1beta1.AutoMl.GetModelEvaluation]. +message GetModelEvaluationRequest { + // Required. Resource name for the model evaluation. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/ModelEvaluation" + } + ]; +} + +// Request message for [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations]. +message ListModelEvaluationsRequest { + // Required. Resource name of the model to list the model evaluations for. + // If modelId is set as "-", this will list model evaluations from across all + // models of the parent location. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; + + // An expression for filtering the results of the request. + // + // * `annotation_spec_id` - for =, != or existence. See example below for + // the last. + // + // Some examples of using the filter are: + // + // * `annotation_spec_id!=4` --> The model evaluation was done for + // annotation spec with ID different than 4. + // * `NOT annotation_spec_id:*` --> The model evaluation was done for + // aggregate of all annotation specs. + string filter = 3; + + // Requested page size. + int32 page_size = 4; + + // A token identifying a page of results for the server to return. + // Typically obtained via + // [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1beta1.ListModelEvaluationsResponse.next_page_token] of the previous + // [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations]. +message ListModelEvaluationsResponse { + // List of model evaluations in the requested page. + repeated ModelEvaluation model_evaluation = 1; + + // A token to retrieve next page of results. + // Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1beta1.ListModelEvaluationsRequest.page_token] field of a new + // [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations] request to obtain that page. + string next_page_token = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/table_spec.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/table_spec.proto new file mode 100644 index 00000000000..de1f7a09c13 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/table_spec.proto @@ -0,0 +1,77 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + +import "google/api/resource.proto"; +import "google/cloud/automl/v1beta1/io.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// A specification of a relational table. +// The table's schema is represented via its child column specs. It is +// pre-populated as part of ImportData by schema inference algorithm, the +// version of which is a required parameter of ImportData InputConfig. +// Note: While working with a table, at times the schema may be +// inconsistent with the data in the table (e.g. string in a FLOAT64 column). +// The consistency validation is done upon creation of a model. +// Used by: +// * Tables +message TableSpec { + option (google.api.resource) = { + type: "automl.googleapis.com/TableSpec" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}" + }; + + // Output only. The resource name of the table spec. + // Form: + // + // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/tableSpecs/{table_spec_id}` + string name = 1; + + // column_spec_id of the time column. Only used if the parent dataset's + // ml_use_column_spec_id is not set. Used to split rows into TRAIN, VALIDATE + // and TEST sets such that oldest rows go to TRAIN set, newest to TEST, and + // those in between to VALIDATE. + // Required type: TIMESTAMP. + // If both this column and ml_use_column are not set, then ML use of all rows + // will be assigned by AutoML. NOTE: Updates of this field will instantly + // affect any other users concurrently working with the dataset. + string time_column_spec_id = 2; + + // Output only. The number of rows (i.e. examples) in the table. + int64 row_count = 3; + + // Output only. The number of valid rows (i.e. without values that don't match + // DataType-s of their columns). + int64 valid_row_count = 4; + + // Output only. The number of columns of the table. That is, the number of + // child ColumnSpec-s. + int64 column_count = 7; + + // Output only. Input configs via which data currently residing in the table + // had been imported. + repeated InputConfig input_configs = 5; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 6; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/tables.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/tables.proto new file mode 100644 index 00000000000..34ea99b306a --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/tables.proto @@ -0,0 +1,291 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + +import "google/cloud/automl/v1beta1/classification.proto"; +import "google/cloud/automl/v1beta1/column_spec.proto"; +import "google/cloud/automl/v1beta1/data_items.proto"; +import "google/cloud/automl/v1beta1/data_stats.proto"; +import "google/cloud/automl/v1beta1/ranges.proto"; +import "google/cloud/automl/v1beta1/regression.proto"; +import "google/cloud/automl/v1beta1/temporal.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Metadata for a dataset used for AutoML Tables. +message TablesDatasetMetadata { + // Output only. The table_spec_id of the primary table of this dataset. + string primary_table_spec_id = 1; + + // column_spec_id of the primary table's column that should be used as the + // training & prediction target. + // This column must be non-nullable and have one of following data types + // (otherwise model creation will error): + // + // * CATEGORY + // + // * FLOAT64 + // + // If the type is CATEGORY , only up to + // 100 unique values may exist in that column across all rows. + // + // NOTE: Updates of this field will instantly affect any other users + // concurrently working with the dataset. + string target_column_spec_id = 2; + + // column_spec_id of the primary table's column that should be used as the + // weight column, i.e. the higher the value the more important the row will be + // during model training. + // Required type: FLOAT64. + // Allowed values: 0 to 10000, inclusive on both ends; 0 means the row is + // ignored for training. + // If not set all rows are assumed to have equal weight of 1. + // NOTE: Updates of this field will instantly affect any other users + // concurrently working with the dataset. + string weight_column_spec_id = 3; + + // column_spec_id of the primary table column which specifies a possible ML + // use of the row, i.e. the column will be used to split the rows into TRAIN, + // VALIDATE and TEST sets. + // Required type: STRING. + // This column, if set, must either have all of `TRAIN`, `VALIDATE`, `TEST` + // among its values, or only have `TEST`, `UNASSIGNED` values. In the latter + // case the rows with `UNASSIGNED` value will be assigned by AutoML. Note + // that if a given ml use distribution makes it impossible to create a "good" + // model, that call will error describing the issue. + // If both this column_spec_id and primary table's time_column_spec_id are not + // set, then all rows are treated as `UNASSIGNED`. + // NOTE: Updates of this field will instantly affect any other users + // concurrently working with the dataset. + string ml_use_column_spec_id = 4; + + // Output only. Correlations between + // + // [TablesDatasetMetadata.target_column_spec_id][google.cloud.automl.v1beta1.TablesDatasetMetadata.target_column_spec_id], + // and other columns of the + // + // [TablesDatasetMetadataprimary_table][google.cloud.automl.v1beta1.TablesDatasetMetadata.primary_table_spec_id]. + // Only set if the target column is set. Mapping from other column spec id to + // its CorrelationStats with the target column. + // This field may be stale, see the stats_update_time field for + // for the timestamp at which these stats were last updated. + map target_column_correlations = 6; + + // Output only. The most recent timestamp when target_column_correlations + // field and all descendant ColumnSpec.data_stats and + // ColumnSpec.top_correlated_columns fields were last (re-)generated. Any + // changes that happened to the dataset afterwards are not reflected in these + // fields values. The regeneration happens in the background on a best effort + // basis. + google.protobuf.Timestamp stats_update_time = 7; +} + +// Model metadata specific to AutoML Tables. +message TablesModelMetadata { + // Additional optimization objective configuration. Required for + // `MAXIMIZE_PRECISION_AT_RECALL` and `MAXIMIZE_RECALL_AT_PRECISION`, + // otherwise unused. + oneof additional_optimization_objective_config { + // Required when optimization_objective is "MAXIMIZE_PRECISION_AT_RECALL". + // Must be between 0 and 1, inclusive. + float optimization_objective_recall_value = 17; + + // Required when optimization_objective is "MAXIMIZE_RECALL_AT_PRECISION". + // Must be between 0 and 1, inclusive. + float optimization_objective_precision_value = 18; + } + + // Column spec of the dataset's primary table's column the model is + // predicting. Snapshotted when model creation started. + // Only 3 fields are used: + // name - May be set on CreateModel, if it's not then the ColumnSpec + // corresponding to the current target_column_spec_id of the dataset + // the model is trained from is used. + // If neither is set, CreateModel will error. + // display_name - Output only. + // data_type - Output only. + ColumnSpec target_column_spec = 2; + + // Column specs of the dataset's primary table's columns, on which + // the model is trained and which are used as the input for predictions. + // The + // + // [target_column][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec] + // as well as, according to dataset's state upon model creation, + // + // [weight_column][google.cloud.automl.v1beta1.TablesDatasetMetadata.weight_column_spec_id], + // and + // + // [ml_use_column][google.cloud.automl.v1beta1.TablesDatasetMetadata.ml_use_column_spec_id] + // must never be included here. + // + // Only 3 fields are used: + // + // * name - May be set on CreateModel, if set only the columns specified are + // used, otherwise all primary table's columns (except the ones listed + // above) are used for the training and prediction input. + // + // * display_name - Output only. + // + // * data_type - Output only. + repeated ColumnSpec input_feature_column_specs = 3; + + // Objective function the model is optimizing towards. The training process + // creates a model that maximizes/minimizes the value of the objective + // function over the validation set. + // + // The supported optimization objectives depend on the prediction type. + // If the field is not set, a default objective function is used. + // + // CLASSIFICATION_BINARY: + // "MAXIMIZE_AU_ROC" (default) - Maximize the area under the receiver + // operating characteristic (ROC) curve. + // "MINIMIZE_LOG_LOSS" - Minimize log loss. + // "MAXIMIZE_AU_PRC" - Maximize the area under the precision-recall curve. + // "MAXIMIZE_PRECISION_AT_RECALL" - Maximize precision for a specified + // recall value. + // "MAXIMIZE_RECALL_AT_PRECISION" - Maximize recall for a specified + // precision value. + // + // CLASSIFICATION_MULTI_CLASS : + // "MINIMIZE_LOG_LOSS" (default) - Minimize log loss. + // + // + // REGRESSION: + // "MINIMIZE_RMSE" (default) - Minimize root-mean-squared error (RMSE). + // "MINIMIZE_MAE" - Minimize mean-absolute error (MAE). + // "MINIMIZE_RMSLE" - Minimize root-mean-squared log error (RMSLE). + string optimization_objective = 4; + + // Output only. Auxiliary information for each of the + // input_feature_column_specs with respect to this particular model. + repeated TablesModelColumnInfo tables_model_column_info = 5; + + // Required. The train budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. + // + // The training cost of the model will not exceed this budget. The final cost + // will be attempted to be close to the budget, though may end up being (even) + // noticeably smaller - at the backend's discretion. This especially may + // happen when further model training ceases to provide any improvements. + // + // If the budget is set to a value known to be insufficient to train a + // model for the given dataset, the training won't be attempted and + // will error. + // + // The train budget must be between 1,000 and 72,000 milli node hours, + // inclusive. + int64 train_budget_milli_node_hours = 6; + + // Output only. The actual training cost of the model, expressed in milli + // node hours, i.e. 1,000 value in this field means 1 node hour. Guaranteed + // to not exceed the train budget. + int64 train_cost_milli_node_hours = 7; + + // Use the entire training budget. This disables the early stopping feature. + // By default, the early stopping feature is enabled, which means that AutoML + // Tables might stop training before the entire training budget has been used. + bool disable_early_stopping = 12; +} + +// Contains annotation details specific to Tables. +message TablesAnnotation { + // Output only. A confidence estimate between 0.0 and 1.0, inclusive. A higher + // value means greater confidence in the returned value. + // For + // + // [target_column_spec][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec] + // of FLOAT64 data type the score is not populated. + float score = 1; + + // Output only. Only populated when + // + // [target_column_spec][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec] + // has FLOAT64 data type. An interval in which the exactly correct target + // value has 95% chance to be in. + DoubleRange prediction_interval = 4; + + // The predicted value of the row's + // + // [target_column][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec]. + // The value depends on the column's DataType: + // + // * CATEGORY - the predicted (with the above confidence `score`) CATEGORY + // value. + // + // * FLOAT64 - the predicted (with above `prediction_interval`) FLOAT64 value. + google.protobuf.Value value = 2; + + // Output only. Auxiliary information for each of the model's + // + // [input_feature_column_specs][google.cloud.automl.v1beta1.TablesModelMetadata.input_feature_column_specs] + // with respect to this particular prediction. + // If no other fields than + // + // [column_spec_name][google.cloud.automl.v1beta1.TablesModelColumnInfo.column_spec_name] + // and + // + // [column_display_name][google.cloud.automl.v1beta1.TablesModelColumnInfo.column_display_name] + // would be populated, then this whole field is not. + repeated TablesModelColumnInfo tables_model_column_info = 3; + + // Output only. Stores the prediction score for the baseline example, which + // is defined as the example with all values set to their baseline values. + // This is used as part of the Sampled Shapley explanation of the model's + // prediction. This field is populated only when feature importance is + // requested. For regression models, this holds the baseline prediction for + // the baseline example. For classification models, this holds the baseline + // prediction for the baseline example for the argmax class. + float baseline_score = 5; +} + +// An information specific to given column and Tables Model, in context +// of the Model and the predictions created by it. +message TablesModelColumnInfo { + // Output only. The name of the ColumnSpec describing the column. Not + // populated when this proto is outputted to BigQuery. + string column_spec_name = 1; + + // Output only. The display name of the column (same as the display_name of + // its ColumnSpec). + string column_display_name = 2; + + // Output only. When given as part of a Model (always populated): + // Measurement of how much model predictions correctness on the TEST data + // depend on values in this column. A value between 0 and 1, higher means + // higher influence. These values are normalized - for all input feature + // columns of a given model they add to 1. + // + // When given back by Predict (populated iff + // [feature_importance + // param][google.cloud.automl.v1beta1.PredictRequest.params] is set) or Batch + // Predict (populated iff + // [feature_importance][google.cloud.automl.v1beta1.PredictRequest.params] + // param is set): + // Measurement of how impactful for the prediction returned for the given row + // the value in this column was. Specifically, the feature importance + // specifies the marginal contribution that the feature made to the prediction + // score compared to the baseline score. These values are computed using the + // Sampled Shapley method. + float feature_importance = 3; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/temporal.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/temporal.proto new file mode 100644 index 00000000000..55bb231d0fc --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/temporal.proto @@ -0,0 +1,36 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + +import "google/protobuf/duration.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// 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; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text.proto new file mode 100644 index 00000000000..b93376ec338 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text.proto @@ -0,0 +1,70 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + +import "google/cloud/automl/v1beta1/classification.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "TextProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Dataset metadata for classification. +message TextClassificationDatasetMetadata { + // Required. Type of the classification problem. + ClassificationType classification_type = 1; +} + +// Model metadata that is specific to text classification. +message TextClassificationModelMetadata { + // Output only. Classification type of the dataset used to train this model. + ClassificationType classification_type = 3; +} + +// Dataset metadata that is specific to text extraction +message TextExtractionDatasetMetadata { + +} + +// Model metadata that is specific to text extraction. +message TextExtractionModelMetadata { + // Indicates the scope of model use case. + // + // * `default`: Use to train a general text extraction model. Default value. + // + // * `health_care`: Use to train a text extraction model that is tuned for + // healthcare applications. + string model_hint = 3; +} + +// Dataset metadata for text sentiment. +message TextSentimentDatasetMetadata { + // Required. A sentiment is expressed as an integer ordinal, where higher value + // means a more positive sentiment. The range of sentiments that will be used + // is between 0 and sentiment_max (inclusive on both ends), and all the values + // in the range must be represented in the dataset before a model can be + // created. + // sentiment_max value must be between 1 and 10 (inclusive). + int32 sentiment_max = 1; +} + +// Model metadata that is specific to text sentiment. +message TextSentimentModelMetadata { + +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_extraction.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_extraction.proto new file mode 100644 index 00000000000..61afd54388d --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_extraction.proto @@ -0,0 +1,67 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + +import "google/cloud/automl/v1beta1/text_segment.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Annotation for identifying spans of text. +message TextExtractionAnnotation { + // Required. Text extraction annotations can either be a text segment or a + // text relation. + oneof annotation { + // An entity annotation will set this, which is the part of the original + // text to which the annotation pertains. + TextSegment text_segment = 3; + } + + // Output only. A confidence estimate between 0.0 and 1.0. A higher value + // means greater confidence in correctness of the annotation. + float score = 1; +} + +// Model evaluation metrics for text extraction problems. +message TextExtractionEvaluationMetrics { + // Metrics for a single confidence threshold. + message ConfidenceMetricsEntry { + // Output only. The confidence threshold value used to compute the metrics. + // Only annotations with score of at least this threshold are considered to + // be ones the model would return. + float confidence_threshold = 1; + + // Output only. Recall under the given confidence threshold. + float recall = 3; + + // Output only. Precision under the given confidence threshold. + float precision = 4; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 5; + } + + // Output only. The Area under precision recall curve metric. + float au_prc = 1; + + // Output only. Metrics that have confidence thresholds. + // Precision-recall curve can be derived from it. + repeated ConfidenceMetricsEntry confidence_metrics_entries = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_segment.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_segment.proto new file mode 100644 index 00000000000..451279c4461 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_segment.proto @@ -0,0 +1,40 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "TextSegmentProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// A contiguous part of a text (string), assuming it has an UTF-8 NFC encoding. +message TextSegment { + // Output only. The content of the TextSegment. + string content = 3; + + // Required. Zero-based character index of the first character of the text + // segment (counting characters from the beginning of the text). + int64 start_offset = 1; + + // Required. Zero-based character index of the first character past the end of + // the text segment (counting character from the beginning of the text). + // The character at the end_offset is NOT included in the text segment. + int64 end_offset = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_sentiment.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_sentiment.proto new file mode 100644 index 00000000000..a5b2c005e95 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_sentiment.proto @@ -0,0 +1,79 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + +import "google/cloud/automl/v1beta1/classification.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_outer_classname = "TextSentimentProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Contains annotation details specific to text sentiment. +message TextSentimentAnnotation { + // Output only. The sentiment with the semantic, as given to the + // [AutoMl.ImportData][google.cloud.automl.v1beta1.AutoMl.ImportData] when populating the dataset from which the model used + // for the prediction had been trained. + // The sentiment values are between 0 and + // Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive), + // with higher value meaning more positive sentiment. They are completely + // relative, i.e. 0 means least positive sentiment and sentiment_max means + // the most positive from the sentiments present in the train data. Therefore + // e.g. if train data had only negative sentiment, then sentiment_max, would + // be still negative (although least negative). + // The sentiment shouldn't be confused with "score" or "magnitude" + // from the previous Natural Language Sentiment Analysis API. + int32 sentiment = 1; +} + +// Model evaluation metrics for text sentiment problems. +message TextSentimentEvaluationMetrics { + // Output only. Precision. + float precision = 1; + + // Output only. Recall. + float recall = 2; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 3; + + // Output only. Mean absolute error. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float mean_absolute_error = 4; + + // Output only. Mean squared error. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float mean_squared_error = 5; + + // Output only. Linear weighted kappa. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float linear_kappa = 6; + + // Output only. Quadratic weighted kappa. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float quadratic_kappa = 7; + + // Output only. Confusion matrix of the evaluation. + // Only set for the overall model evaluation, not for evaluation of a single + // annotation spec. + ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + + // Output only. The annotation spec ids used for this evaluation. + // Deprecated . + repeated string annotation_spec_id = 9 [deprecated = true]; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/translation.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/translation.proto new file mode 100644 index 00000000000..7aefb42bb82 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/translation.proto @@ -0,0 +1,68 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/cloud/automl/v1beta1/data_items.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "TranslationProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Dataset metadata that is specific to translation. +message TranslationDatasetMetadata { + // Required. The BCP-47 language code of the source language. + string source_language_code = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The BCP-47 language code of the target language. + string target_language_code = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Evaluation metrics for the dataset. +message TranslationEvaluationMetrics { + // Output only. BLEU score. + double bleu_score = 1; + + // Output only. BLEU score for base model. + double base_bleu_score = 2; +} + +// Model metadata that is specific to translation. +message TranslationModelMetadata { + // The resource name of the model to use as a baseline to train the custom + // model. If unset, we use the default base model provided by Google + // Translate. Format: + // `projects/{project_id}/locations/{location_id}/models/{model_id}` + string base_model = 1; + + // Output only. Inferred from the dataset. + // The source languge (The BCP-47 language code) that is used for training. + string source_language_code = 2; + + // Output only. The target languge (The BCP-47 language code) that is used for + // training. + string target_language_code = 3; +} + +// Annotation details specific to translation. +message TranslationAnnotation { + // Output only . The translated content. + TextSnippet translated_content = 1; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/video.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/video.proto new file mode 100644 index 00000000000..872adb8045a --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/video.proto @@ -0,0 +1,47 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.automl.v1beta1; + +import "google/cloud/automl/v1beta1/classification.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "VideoProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Dataset metadata specific to video classification. +// All Video Classification datasets are treated as multi label. +message VideoClassificationDatasetMetadata { + +} + +// Dataset metadata specific to video object tracking. +message VideoObjectTrackingDatasetMetadata { + +} + +// Model metadata specific to video classification. +message VideoClassificationModelMetadata { + +} + +// Model metadata specific to video object tracking. +message VideoObjectTrackingModelMetadata { + +} diff --git a/packages/google-cloud-automl/protos/google/cloud/common_resources.proto b/packages/google-cloud-automl/protos/google/cloud/common_resources.proto new file mode 100644 index 00000000000..56c9f800d5e --- /dev/null +++ b/packages/google-cloud-automl/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-automl/protos/protos.d.ts b/packages/google-cloud-automl/protos/protos.d.ts new file mode 100644 index 00000000000..cbf037d1921 --- /dev/null +++ b/packages/google-cloud-automl/protos/protos.d.ts @@ -0,0 +1,32931 @@ +// Copyright 2023 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 automl. */ + namespace automl { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an AnnotationPayload. */ + interface IAnnotationPayload { + + /** AnnotationPayload translation */ + translation?: (google.cloud.automl.v1.ITranslationAnnotation|null); + + /** AnnotationPayload classification */ + classification?: (google.cloud.automl.v1.IClassificationAnnotation|null); + + /** AnnotationPayload imageObjectDetection */ + imageObjectDetection?: (google.cloud.automl.v1.IImageObjectDetectionAnnotation|null); + + /** AnnotationPayload textExtraction */ + textExtraction?: (google.cloud.automl.v1.ITextExtractionAnnotation|null); + + /** AnnotationPayload textSentiment */ + textSentiment?: (google.cloud.automl.v1.ITextSentimentAnnotation|null); + + /** AnnotationPayload annotationSpecId */ + annotationSpecId?: (string|null); + + /** AnnotationPayload displayName */ + displayName?: (string|null); + } + + /** Represents an AnnotationPayload. */ + class AnnotationPayload implements IAnnotationPayload { + + /** + * Constructs a new AnnotationPayload. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IAnnotationPayload); + + /** AnnotationPayload translation. */ + public translation?: (google.cloud.automl.v1.ITranslationAnnotation|null); + + /** AnnotationPayload classification. */ + public classification?: (google.cloud.automl.v1.IClassificationAnnotation|null); + + /** AnnotationPayload imageObjectDetection. */ + public imageObjectDetection?: (google.cloud.automl.v1.IImageObjectDetectionAnnotation|null); + + /** AnnotationPayload textExtraction. */ + public textExtraction?: (google.cloud.automl.v1.ITextExtractionAnnotation|null); + + /** AnnotationPayload textSentiment. */ + public textSentiment?: (google.cloud.automl.v1.ITextSentimentAnnotation|null); + + /** AnnotationPayload annotationSpecId. */ + public annotationSpecId: string; + + /** AnnotationPayload displayName. */ + public displayName: string; + + /** AnnotationPayload detail. */ + public detail?: ("translation"|"classification"|"imageObjectDetection"|"textExtraction"|"textSentiment"); + + /** + * Creates a new AnnotationPayload instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotationPayload instance + */ + public static create(properties?: google.cloud.automl.v1.IAnnotationPayload): google.cloud.automl.v1.AnnotationPayload; + + /** + * Encodes the specified AnnotationPayload message. Does not implicitly {@link google.cloud.automl.v1.AnnotationPayload.verify|verify} messages. + * @param message AnnotationPayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IAnnotationPayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotationPayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1.AnnotationPayload.verify|verify} messages. + * @param message AnnotationPayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IAnnotationPayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotationPayload message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotationPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.AnnotationPayload; + + /** + * Decodes an AnnotationPayload message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotationPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.AnnotationPayload; + + /** + * Verifies an AnnotationPayload message. + * @param message Plain 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 AnnotationPayload message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotationPayload + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.AnnotationPayload; + + /** + * Creates a plain object from an AnnotationPayload message. Also converts values to other types if specified. + * @param message AnnotationPayload + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.AnnotationPayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotationPayload to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotationPayload + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ClassificationType enum. */ + enum ClassificationType { + CLASSIFICATION_TYPE_UNSPECIFIED = 0, + MULTICLASS = 1, + MULTILABEL = 2 + } + + /** Properties of a ClassificationAnnotation. */ + interface IClassificationAnnotation { + + /** ClassificationAnnotation score */ + score?: (number|null); + } + + /** Represents a ClassificationAnnotation. */ + class ClassificationAnnotation implements IClassificationAnnotation { + + /** + * Constructs a new ClassificationAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IClassificationAnnotation); + + /** ClassificationAnnotation score. */ + public score: number; + + /** + * Creates a new ClassificationAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassificationAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1.IClassificationAnnotation): google.cloud.automl.v1.ClassificationAnnotation; + + /** + * Encodes the specified ClassificationAnnotation message. Does not implicitly {@link google.cloud.automl.v1.ClassificationAnnotation.verify|verify} messages. + * @param message ClassificationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IClassificationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassificationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationAnnotation.verify|verify} messages. + * @param message ClassificationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IClassificationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassificationAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ClassificationAnnotation; + + /** + * Decodes a ClassificationAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ClassificationAnnotation; + + /** + * Verifies a ClassificationAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassificationAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassificationAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ClassificationAnnotation; + + /** + * Creates a plain object from a ClassificationAnnotation message. Also converts values to other types if specified. + * @param message ClassificationAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ClassificationAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassificationAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassificationAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClassificationEvaluationMetrics. */ + interface IClassificationEvaluationMetrics { + + /** ClassificationEvaluationMetrics auPrc */ + auPrc?: (number|null); + + /** ClassificationEvaluationMetrics auRoc */ + auRoc?: (number|null); + + /** ClassificationEvaluationMetrics logLoss */ + logLoss?: (number|null); + + /** ClassificationEvaluationMetrics confidenceMetricsEntry */ + confidenceMetricsEntry?: (google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry[]|null); + + /** ClassificationEvaluationMetrics confusionMatrix */ + confusionMatrix?: (google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null); + + /** ClassificationEvaluationMetrics annotationSpecId */ + annotationSpecId?: (string[]|null); + } + + /** Represents a ClassificationEvaluationMetrics. */ + class ClassificationEvaluationMetrics implements IClassificationEvaluationMetrics { + + /** + * Constructs a new ClassificationEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IClassificationEvaluationMetrics); + + /** ClassificationEvaluationMetrics auPrc. */ + public auPrc: number; + + /** ClassificationEvaluationMetrics auRoc. */ + public auRoc: number; + + /** ClassificationEvaluationMetrics logLoss. */ + public logLoss: number; + + /** ClassificationEvaluationMetrics confidenceMetricsEntry. */ + public confidenceMetricsEntry: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry[]; + + /** ClassificationEvaluationMetrics confusionMatrix. */ + public confusionMatrix?: (google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null); + + /** ClassificationEvaluationMetrics annotationSpecId. */ + public annotationSpecId: string[]; + + /** + * Creates a new ClassificationEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassificationEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1.IClassificationEvaluationMetrics): google.cloud.automl.v1.ClassificationEvaluationMetrics; + + /** + * Encodes the specified ClassificationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.verify|verify} messages. + * @param message ClassificationEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IClassificationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassificationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.verify|verify} messages. + * @param message ClassificationEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IClassificationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassificationEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassificationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ClassificationEvaluationMetrics; + + /** + * Decodes a ClassificationEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassificationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ClassificationEvaluationMetrics; + + /** + * Verifies a ClassificationEvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassificationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassificationEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ClassificationEvaluationMetrics; + + /** + * Creates a plain object from a ClassificationEvaluationMetrics message. Also converts values to other types if specified. + * @param message ClassificationEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ClassificationEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassificationEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassificationEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ClassificationEvaluationMetrics { + + /** Properties of a ConfidenceMetricsEntry. */ + interface IConfidenceMetricsEntry { + + /** ConfidenceMetricsEntry confidenceThreshold */ + confidenceThreshold?: (number|null); + + /** ConfidenceMetricsEntry positionThreshold */ + positionThreshold?: (number|null); + + /** ConfidenceMetricsEntry recall */ + recall?: (number|null); + + /** ConfidenceMetricsEntry precision */ + precision?: (number|null); + + /** ConfidenceMetricsEntry falsePositiveRate */ + falsePositiveRate?: (number|null); + + /** ConfidenceMetricsEntry f1Score */ + f1Score?: (number|null); + + /** ConfidenceMetricsEntry recallAt1 */ + recallAt1?: (number|null); + + /** ConfidenceMetricsEntry precisionAt1 */ + precisionAt1?: (number|null); + + /** ConfidenceMetricsEntry falsePositiveRateAt1 */ + falsePositiveRateAt1?: (number|null); + + /** ConfidenceMetricsEntry f1ScoreAt1 */ + f1ScoreAt1?: (number|null); + + /** ConfidenceMetricsEntry truePositiveCount */ + truePositiveCount?: (number|Long|string|null); + + /** ConfidenceMetricsEntry falsePositiveCount */ + falsePositiveCount?: (number|Long|string|null); + + /** ConfidenceMetricsEntry falseNegativeCount */ + falseNegativeCount?: (number|Long|string|null); + + /** ConfidenceMetricsEntry trueNegativeCount */ + trueNegativeCount?: (number|Long|string|null); + } + + /** Represents a ConfidenceMetricsEntry. */ + class ConfidenceMetricsEntry implements IConfidenceMetricsEntry { + + /** + * Constructs a new ConfidenceMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry); + + /** ConfidenceMetricsEntry confidenceThreshold. */ + public confidenceThreshold: number; + + /** ConfidenceMetricsEntry positionThreshold. */ + public positionThreshold: number; + + /** ConfidenceMetricsEntry recall. */ + public recall: number; + + /** ConfidenceMetricsEntry precision. */ + public precision: number; + + /** ConfidenceMetricsEntry falsePositiveRate. */ + public falsePositiveRate: number; + + /** ConfidenceMetricsEntry f1Score. */ + public f1Score: number; + + /** ConfidenceMetricsEntry recallAt1. */ + public recallAt1: number; + + /** ConfidenceMetricsEntry precisionAt1. */ + public precisionAt1: number; + + /** ConfidenceMetricsEntry falsePositiveRateAt1. */ + public falsePositiveRateAt1: number; + + /** ConfidenceMetricsEntry f1ScoreAt1. */ + public f1ScoreAt1: number; + + /** ConfidenceMetricsEntry truePositiveCount. */ + public truePositiveCount: (number|Long|string); + + /** ConfidenceMetricsEntry falsePositiveCount. */ + public falsePositiveCount: (number|Long|string); + + /** ConfidenceMetricsEntry falseNegativeCount. */ + public falseNegativeCount: (number|Long|string); + + /** ConfidenceMetricsEntry trueNegativeCount. */ + public trueNegativeCount: (number|Long|string); + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidenceMetricsEntry instance + */ + public static create(properties?: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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 annotationSpecId */ + annotationSpecId?: (string[]|null); + + /** ConfusionMatrix displayName */ + displayName?: (string[]|null); + + /** ConfusionMatrix row */ + row?: (google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow[]|null); + } + + /** Represents a ConfusionMatrix. */ + class ConfusionMatrix implements IConfusionMatrix { + + /** + * Constructs a new ConfusionMatrix. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix); + + /** ConfusionMatrix annotationSpecId. */ + public annotationSpecId: string[]; + + /** ConfusionMatrix displayName. */ + public displayName: string[]; + + /** ConfusionMatrix row. */ + public row: google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix; + + /** + * Encodes the specified ConfusionMatrix message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfusionMatrix message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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 Row. */ + interface IRow { + + /** Row exampleCount */ + exampleCount?: (number[]|null); + } + + /** Represents a Row. */ + class Row implements IRow { + + /** + * Constructs a new Row. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow); + + /** Row exampleCount. */ + public exampleCount: number[]; + + /** + * Creates a new Row instance using the specified properties. + * @param [properties] Properties to set + * @returns Row instance + */ + public static create(properties?: google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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 ImageObjectDetectionAnnotation. */ + interface IImageObjectDetectionAnnotation { + + /** ImageObjectDetectionAnnotation boundingBox */ + boundingBox?: (google.cloud.automl.v1.IBoundingPoly|null); + + /** ImageObjectDetectionAnnotation score */ + score?: (number|null); + } + + /** Represents an ImageObjectDetectionAnnotation. */ + class ImageObjectDetectionAnnotation implements IImageObjectDetectionAnnotation { + + /** + * Constructs a new ImageObjectDetectionAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageObjectDetectionAnnotation); + + /** ImageObjectDetectionAnnotation boundingBox. */ + public boundingBox?: (google.cloud.automl.v1.IBoundingPoly|null); + + /** ImageObjectDetectionAnnotation score. */ + public score: number; + + /** + * Creates a new ImageObjectDetectionAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1.IImageObjectDetectionAnnotation): google.cloud.automl.v1.ImageObjectDetectionAnnotation; + + /** + * Encodes the specified ImageObjectDetectionAnnotation message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionAnnotation.verify|verify} messages. + * @param message ImageObjectDetectionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageObjectDetectionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionAnnotation.verify|verify} messages. + * @param message ImageObjectDetectionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageObjectDetectionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ImageObjectDetectionAnnotation; + + /** + * Decodes an ImageObjectDetectionAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ImageObjectDetectionAnnotation; + + /** + * Verifies an ImageObjectDetectionAnnotation message. + * @param message Plain 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 ImageObjectDetectionAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageObjectDetectionAnnotation; + + /** + * Creates a plain object from an ImageObjectDetectionAnnotation message. Also converts values to other types if specified. + * @param message ImageObjectDetectionAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageObjectDetectionAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoundingBoxMetricsEntry. */ + interface IBoundingBoxMetricsEntry { + + /** BoundingBoxMetricsEntry iouThreshold */ + iouThreshold?: (number|null); + + /** BoundingBoxMetricsEntry meanAveragePrecision */ + meanAveragePrecision?: (number|null); + + /** BoundingBoxMetricsEntry confidenceMetricsEntries */ + confidenceMetricsEntries?: (google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry[]|null); + } + + /** Represents a BoundingBoxMetricsEntry. */ + class BoundingBoxMetricsEntry implements IBoundingBoxMetricsEntry { + + /** + * Constructs a new BoundingBoxMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IBoundingBoxMetricsEntry); + + /** BoundingBoxMetricsEntry iouThreshold. */ + public iouThreshold: number; + + /** BoundingBoxMetricsEntry meanAveragePrecision. */ + public meanAveragePrecision: number; + + /** BoundingBoxMetricsEntry confidenceMetricsEntries. */ + public confidenceMetricsEntries: google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry[]; + + /** + * Creates a new BoundingBoxMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns BoundingBoxMetricsEntry instance + */ + public static create(properties?: google.cloud.automl.v1.IBoundingBoxMetricsEntry): google.cloud.automl.v1.BoundingBoxMetricsEntry; + + /** + * Encodes the specified BoundingBoxMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.verify|verify} messages. + * @param message BoundingBoxMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IBoundingBoxMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingBoxMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.verify|verify} messages. + * @param message BoundingBoxMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IBoundingBoxMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoundingBoxMetricsEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoundingBoxMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.BoundingBoxMetricsEntry; + + /** + * Decodes a BoundingBoxMetricsEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoundingBoxMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.BoundingBoxMetricsEntry; + + /** + * Verifies a BoundingBoxMetricsEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoundingBoxMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoundingBoxMetricsEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BoundingBoxMetricsEntry; + + /** + * Creates a plain object from a BoundingBoxMetricsEntry message. Also converts values to other types if specified. + * @param message BoundingBoxMetricsEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BoundingBoxMetricsEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoundingBoxMetricsEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoundingBoxMetricsEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BoundingBoxMetricsEntry { + + /** 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); + } + + /** Represents a ConfidenceMetricsEntry. */ + class ConfidenceMetricsEntry implements IConfidenceMetricsEntry { + + /** + * Constructs a new ConfidenceMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry); + + /** ConfidenceMetricsEntry confidenceThreshold. */ + public confidenceThreshold: number; + + /** ConfidenceMetricsEntry recall. */ + public recall: number; + + /** ConfidenceMetricsEntry precision. */ + public precision: number; + + /** ConfidenceMetricsEntry f1Score. */ + public f1Score: number; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidenceMetricsEntry instance + */ + public static create(properties?: google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry): google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.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.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.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.automl.v1.BoundingBoxMetricsEntry.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.automl.v1.BoundingBoxMetricsEntry.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.automl.v1.BoundingBoxMetricsEntry.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.automl.v1.BoundingBoxMetricsEntry.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.automl.v1.BoundingBoxMetricsEntry.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 an ImageObjectDetectionEvaluationMetrics. */ + interface IImageObjectDetectionEvaluationMetrics { + + /** ImageObjectDetectionEvaluationMetrics evaluatedBoundingBoxCount */ + evaluatedBoundingBoxCount?: (number|null); + + /** ImageObjectDetectionEvaluationMetrics boundingBoxMetricsEntries */ + boundingBoxMetricsEntries?: (google.cloud.automl.v1.IBoundingBoxMetricsEntry[]|null); + + /** ImageObjectDetectionEvaluationMetrics boundingBoxMeanAveragePrecision */ + boundingBoxMeanAveragePrecision?: (number|null); + } + + /** Represents an ImageObjectDetectionEvaluationMetrics. */ + class ImageObjectDetectionEvaluationMetrics implements IImageObjectDetectionEvaluationMetrics { + + /** + * Constructs a new ImageObjectDetectionEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics); + + /** ImageObjectDetectionEvaluationMetrics evaluatedBoundingBoxCount. */ + public evaluatedBoundingBoxCount: number; + + /** ImageObjectDetectionEvaluationMetrics boundingBoxMetricsEntries. */ + public boundingBoxMetricsEntries: google.cloud.automl.v1.IBoundingBoxMetricsEntry[]; + + /** ImageObjectDetectionEvaluationMetrics boundingBoxMeanAveragePrecision. */ + public boundingBoxMeanAveragePrecision: number; + + /** + * Creates a new ImageObjectDetectionEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics): google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics; + + /** + * Encodes the specified ImageObjectDetectionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.verify|verify} messages. + * @param message ImageObjectDetectionEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.verify|verify} messages. + * @param message ImageObjectDetectionEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics; + + /** + * Decodes an ImageObjectDetectionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics; + + /** + * Verifies an ImageObjectDetectionEvaluationMetrics message. + * @param message Plain 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 ImageObjectDetectionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics; + + /** + * Creates a plain object from an ImageObjectDetectionEvaluationMetrics message. Also converts values to other types if specified. + * @param message ImageObjectDetectionEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionEvaluationMetrics + * @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.automl.v1.INormalizedVertex); + + /** NormalizedVertex x. */ + public x: number; + + /** NormalizedVertex y. */ + public y: number; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedVertex instance + */ + public static create(properties?: google.cloud.automl.v1.INormalizedVertex): google.cloud.automl.v1.NormalizedVertex; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.automl.v1.NormalizedVertex.verify|verify} messages. + * @param message NormalizedVertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.automl.v1.NormalizedVertex.verify|verify} messages. + * @param message NormalizedVertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.NormalizedVertex; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.NormalizedVertex; + + /** + * Verifies a NormalizedVertex message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedVertex message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedVertex + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.NormalizedVertex; + + /** + * Creates a plain object from a NormalizedVertex message. Also converts values to other types if specified. + * @param message NormalizedVertex + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.NormalizedVertex, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedVertex to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedVertex + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoundingPoly. */ + interface IBoundingPoly { + + /** BoundingPoly normalizedVertices */ + normalizedVertices?: (google.cloud.automl.v1.INormalizedVertex[]|null); + } + + /** Represents a BoundingPoly. */ + class BoundingPoly implements IBoundingPoly { + + /** + * Constructs a new BoundingPoly. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IBoundingPoly); + + /** BoundingPoly normalizedVertices. */ + public normalizedVertices: google.cloud.automl.v1.INormalizedVertex[]; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @param [properties] Properties to set + * @returns BoundingPoly instance + */ + public static create(properties?: google.cloud.automl.v1.IBoundingPoly): google.cloud.automl.v1.BoundingPoly; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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 TextExtractionAnnotation. */ + interface ITextExtractionAnnotation { + + /** TextExtractionAnnotation textSegment */ + textSegment?: (google.cloud.automl.v1.ITextSegment|null); + + /** TextExtractionAnnotation score */ + score?: (number|null); + } + + /** Represents a TextExtractionAnnotation. */ + class TextExtractionAnnotation implements ITextExtractionAnnotation { + + /** + * Constructs a new TextExtractionAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextExtractionAnnotation); + + /** TextExtractionAnnotation textSegment. */ + public textSegment?: (google.cloud.automl.v1.ITextSegment|null); + + /** TextExtractionAnnotation score. */ + public score: number; + + /** TextExtractionAnnotation annotation. */ + public annotation?: "textSegment"; + + /** + * Creates a new TextExtractionAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TextExtractionAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1.ITextExtractionAnnotation): google.cloud.automl.v1.TextExtractionAnnotation; + + /** + * Encodes the specified TextExtractionAnnotation message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionAnnotation.verify|verify} messages. + * @param message TextExtractionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextExtractionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextExtractionAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionAnnotation.verify|verify} messages. + * @param message TextExtractionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextExtractionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextExtractionAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextExtractionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextExtractionAnnotation; + + /** + * Decodes a TextExtractionAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextExtractionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextExtractionAnnotation; + + /** + * Verifies a TextExtractionAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextExtractionAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextExtractionAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextExtractionAnnotation; + + /** + * Creates a plain object from a TextExtractionAnnotation message. Also converts values to other types if specified. + * @param message TextExtractionAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextExtractionAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextExtractionAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextExtractionAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextExtractionEvaluationMetrics. */ + interface ITextExtractionEvaluationMetrics { + + /** TextExtractionEvaluationMetrics auPrc */ + auPrc?: (number|null); + + /** TextExtractionEvaluationMetrics confidenceMetricsEntries */ + confidenceMetricsEntries?: (google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry[]|null); + } + + /** Represents a TextExtractionEvaluationMetrics. */ + class TextExtractionEvaluationMetrics implements ITextExtractionEvaluationMetrics { + + /** + * Constructs a new TextExtractionEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextExtractionEvaluationMetrics); + + /** TextExtractionEvaluationMetrics auPrc. */ + public auPrc: number; + + /** TextExtractionEvaluationMetrics confidenceMetricsEntries. */ + public confidenceMetricsEntries: google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry[]; + + /** + * Creates a new TextExtractionEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns TextExtractionEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1.ITextExtractionEvaluationMetrics): google.cloud.automl.v1.TextExtractionEvaluationMetrics; + + /** + * Encodes the specified TextExtractionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.verify|verify} messages. + * @param message TextExtractionEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextExtractionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextExtractionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.verify|verify} messages. + * @param message TextExtractionEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextExtractionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextExtractionEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextExtractionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextExtractionEvaluationMetrics; + + /** + * Decodes a TextExtractionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextExtractionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextExtractionEvaluationMetrics; + + /** + * Verifies a TextExtractionEvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextExtractionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextExtractionEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextExtractionEvaluationMetrics; + + /** + * Creates a plain object from a TextExtractionEvaluationMetrics message. Also converts values to other types if specified. + * @param message TextExtractionEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextExtractionEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextExtractionEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextExtractionEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TextExtractionEvaluationMetrics { + + /** 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); + } + + /** Represents a ConfidenceMetricsEntry. */ + class ConfidenceMetricsEntry implements IConfidenceMetricsEntry { + + /** + * Constructs a new ConfidenceMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry); + + /** ConfidenceMetricsEntry confidenceThreshold. */ + public confidenceThreshold: number; + + /** ConfidenceMetricsEntry recall. */ + public recall: number; + + /** ConfidenceMetricsEntry precision. */ + public precision: number; + + /** ConfidenceMetricsEntry f1Score. */ + public f1Score: number; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidenceMetricsEntry instance + */ + public static create(properties?: google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry): google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.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.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.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.automl.v1.TextExtractionEvaluationMetrics.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.automl.v1.TextExtractionEvaluationMetrics.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.automl.v1.TextExtractionEvaluationMetrics.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.automl.v1.TextExtractionEvaluationMetrics.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.automl.v1.TextExtractionEvaluationMetrics.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 TextSegment. */ + interface ITextSegment { + + /** TextSegment content */ + content?: (string|null); + + /** TextSegment startOffset */ + startOffset?: (number|Long|string|null); + + /** TextSegment endOffset */ + endOffset?: (number|Long|string|null); + } + + /** Represents a TextSegment. */ + class TextSegment implements ITextSegment { + + /** + * Constructs a new TextSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextSegment); + + /** TextSegment content. */ + public content: string; + + /** TextSegment startOffset. */ + public startOffset: (number|Long|string); + + /** TextSegment endOffset. */ + public endOffset: (number|Long|string); + + /** + * Creates a new TextSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSegment instance + */ + public static create(properties?: google.cloud.automl.v1.ITextSegment): google.cloud.automl.v1.TextSegment; + + /** + * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.automl.v1.TextSegment.verify|verify} messages. + * @param message TextSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSegment.verify|verify} messages. + * @param message TextSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextSegment; + + /** + * Decodes a TextSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextSegment; + + /** + * Verifies a TextSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextSegment; + + /** + * Creates a plain object from a TextSegment message. Also converts values to other types if specified. + * @param message TextSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSentimentAnnotation. */ + interface ITextSentimentAnnotation { + + /** TextSentimentAnnotation sentiment */ + sentiment?: (number|null); + } + + /** Represents a TextSentimentAnnotation. */ + class TextSentimentAnnotation implements ITextSentimentAnnotation { + + /** + * Constructs a new TextSentimentAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextSentimentAnnotation); + + /** TextSentimentAnnotation sentiment. */ + public sentiment: number; + + /** + * Creates a new TextSentimentAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSentimentAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1.ITextSentimentAnnotation): google.cloud.automl.v1.TextSentimentAnnotation; + + /** + * Encodes the specified TextSentimentAnnotation message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentAnnotation.verify|verify} messages. + * @param message TextSentimentAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextSentimentAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSentimentAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentAnnotation.verify|verify} messages. + * @param message TextSentimentAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextSentimentAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSentimentAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSentimentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextSentimentAnnotation; + + /** + * Decodes a TextSentimentAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSentimentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextSentimentAnnotation; + + /** + * Verifies a TextSentimentAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSentimentAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSentimentAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextSentimentAnnotation; + + /** + * Creates a plain object from a TextSentimentAnnotation message. Also converts values to other types if specified. + * @param message TextSentimentAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextSentimentAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSentimentAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSentimentAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSentimentEvaluationMetrics. */ + interface ITextSentimentEvaluationMetrics { + + /** TextSentimentEvaluationMetrics precision */ + precision?: (number|null); + + /** TextSentimentEvaluationMetrics recall */ + recall?: (number|null); + + /** TextSentimentEvaluationMetrics f1Score */ + f1Score?: (number|null); + + /** TextSentimentEvaluationMetrics meanAbsoluteError */ + meanAbsoluteError?: (number|null); + + /** TextSentimentEvaluationMetrics meanSquaredError */ + meanSquaredError?: (number|null); + + /** TextSentimentEvaluationMetrics linearKappa */ + linearKappa?: (number|null); + + /** TextSentimentEvaluationMetrics quadraticKappa */ + quadraticKappa?: (number|null); + + /** TextSentimentEvaluationMetrics confusionMatrix */ + confusionMatrix?: (google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null); + } + + /** Represents a TextSentimentEvaluationMetrics. */ + class TextSentimentEvaluationMetrics implements ITextSentimentEvaluationMetrics { + + /** + * Constructs a new TextSentimentEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextSentimentEvaluationMetrics); + + /** TextSentimentEvaluationMetrics precision. */ + public precision: number; + + /** TextSentimentEvaluationMetrics recall. */ + public recall: number; + + /** TextSentimentEvaluationMetrics f1Score. */ + public f1Score: number; + + /** TextSentimentEvaluationMetrics meanAbsoluteError. */ + public meanAbsoluteError: number; + + /** TextSentimentEvaluationMetrics meanSquaredError. */ + public meanSquaredError: number; + + /** TextSentimentEvaluationMetrics linearKappa. */ + public linearKappa: number; + + /** TextSentimentEvaluationMetrics quadraticKappa. */ + public quadraticKappa: number; + + /** TextSentimentEvaluationMetrics confusionMatrix. */ + public confusionMatrix?: (google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null); + + /** + * Creates a new TextSentimentEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSentimentEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1.ITextSentimentEvaluationMetrics): google.cloud.automl.v1.TextSentimentEvaluationMetrics; + + /** + * Encodes the specified TextSentimentEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentEvaluationMetrics.verify|verify} messages. + * @param message TextSentimentEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextSentimentEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSentimentEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentEvaluationMetrics.verify|verify} messages. + * @param message TextSentimentEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextSentimentEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSentimentEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSentimentEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextSentimentEvaluationMetrics; + + /** + * Decodes a TextSentimentEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSentimentEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextSentimentEvaluationMetrics; + + /** + * Verifies a TextSentimentEvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSentimentEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSentimentEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextSentimentEvaluationMetrics; + + /** + * Creates a plain object from a TextSentimentEvaluationMetrics message. Also converts values to other types if specified. + * @param message TextSentimentEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextSentimentEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSentimentEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSentimentEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TranslationDatasetMetadata. */ + interface ITranslationDatasetMetadata { + + /** TranslationDatasetMetadata sourceLanguageCode */ + sourceLanguageCode?: (string|null); + + /** TranslationDatasetMetadata targetLanguageCode */ + targetLanguageCode?: (string|null); + } + + /** Represents a TranslationDatasetMetadata. */ + class TranslationDatasetMetadata implements ITranslationDatasetMetadata { + + /** + * Constructs a new TranslationDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITranslationDatasetMetadata); + + /** TranslationDatasetMetadata sourceLanguageCode. */ + public sourceLanguageCode: string; + + /** TranslationDatasetMetadata targetLanguageCode. */ + public targetLanguageCode: string; + + /** + * Creates a new TranslationDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITranslationDatasetMetadata): google.cloud.automl.v1.TranslationDatasetMetadata; + + /** + * Encodes the specified TranslationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TranslationDatasetMetadata.verify|verify} messages. + * @param message TranslationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITranslationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationDatasetMetadata.verify|verify} messages. + * @param message TranslationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITranslationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TranslationDatasetMetadata; + + /** + * Decodes a TranslationDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TranslationDatasetMetadata; + + /** + * Verifies a TranslationDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TranslationDatasetMetadata; + + /** + * Creates a plain object from a TranslationDatasetMetadata message. Also converts values to other types if specified. + * @param message TranslationDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TranslationDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslationDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TranslationEvaluationMetrics. */ + interface ITranslationEvaluationMetrics { + + /** TranslationEvaluationMetrics bleuScore */ + bleuScore?: (number|null); + + /** TranslationEvaluationMetrics baseBleuScore */ + baseBleuScore?: (number|null); + } + + /** Represents a TranslationEvaluationMetrics. */ + class TranslationEvaluationMetrics implements ITranslationEvaluationMetrics { + + /** + * Constructs a new TranslationEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITranslationEvaluationMetrics); + + /** TranslationEvaluationMetrics bleuScore. */ + public bleuScore: number; + + /** TranslationEvaluationMetrics baseBleuScore. */ + public baseBleuScore: number; + + /** + * Creates a new TranslationEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1.ITranslationEvaluationMetrics): google.cloud.automl.v1.TranslationEvaluationMetrics; + + /** + * Encodes the specified TranslationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.TranslationEvaluationMetrics.verify|verify} messages. + * @param message TranslationEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITranslationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationEvaluationMetrics.verify|verify} messages. + * @param message TranslationEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITranslationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TranslationEvaluationMetrics; + + /** + * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TranslationEvaluationMetrics; + + /** + * Verifies a TranslationEvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TranslationEvaluationMetrics; + + /** + * Creates a plain object from a TranslationEvaluationMetrics message. Also converts values to other types if specified. + * @param message TranslationEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TranslationEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslationEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TranslationModelMetadata. */ + interface ITranslationModelMetadata { + + /** TranslationModelMetadata baseModel */ + baseModel?: (string|null); + + /** TranslationModelMetadata sourceLanguageCode */ + sourceLanguageCode?: (string|null); + + /** TranslationModelMetadata targetLanguageCode */ + targetLanguageCode?: (string|null); + } + + /** Represents a TranslationModelMetadata. */ + class TranslationModelMetadata implements ITranslationModelMetadata { + + /** + * Constructs a new TranslationModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITranslationModelMetadata); + + /** TranslationModelMetadata baseModel. */ + public baseModel: string; + + /** TranslationModelMetadata sourceLanguageCode. */ + public sourceLanguageCode: string; + + /** TranslationModelMetadata targetLanguageCode. */ + public targetLanguageCode: string; + + /** + * Creates a new TranslationModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITranslationModelMetadata): google.cloud.automl.v1.TranslationModelMetadata; + + /** + * Encodes the specified TranslationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TranslationModelMetadata.verify|verify} messages. + * @param message TranslationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITranslationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationModelMetadata.verify|verify} messages. + * @param message TranslationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITranslationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TranslationModelMetadata; + + /** + * Decodes a TranslationModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TranslationModelMetadata; + + /** + * Verifies a TranslationModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TranslationModelMetadata; + + /** + * Creates a plain object from a TranslationModelMetadata message. Also converts values to other types if specified. + * @param message TranslationModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TranslationModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslationModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TranslationAnnotation. */ + interface ITranslationAnnotation { + + /** TranslationAnnotation translatedContent */ + translatedContent?: (google.cloud.automl.v1.ITextSnippet|null); + } + + /** Represents a TranslationAnnotation. */ + class TranslationAnnotation implements ITranslationAnnotation { + + /** + * Constructs a new TranslationAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITranslationAnnotation); + + /** TranslationAnnotation translatedContent. */ + public translatedContent?: (google.cloud.automl.v1.ITextSnippet|null); + + /** + * Creates a new TranslationAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1.ITranslationAnnotation): google.cloud.automl.v1.TranslationAnnotation; + + /** + * Encodes the specified TranslationAnnotation message. Does not implicitly {@link google.cloud.automl.v1.TranslationAnnotation.verify|verify} messages. + * @param message TranslationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITranslationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationAnnotation.verify|verify} messages. + * @param message TranslationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITranslationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TranslationAnnotation; + + /** + * Decodes a TranslationAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TranslationAnnotation; + + /** + * Verifies a TranslationAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslationAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TranslationAnnotation; + + /** + * Creates a plain object from a TranslationAnnotation message. Also converts values to other types if specified. + * @param message TranslationAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TranslationAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslationAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Image. */ + interface IImage { + + /** Image imageBytes */ + imageBytes?: (Uint8Array|string|null); + + /** Image thumbnailUri */ + thumbnailUri?: (string|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImage); + + /** Image imageBytes. */ + public imageBytes?: (Uint8Array|string|null); + + /** Image thumbnailUri. */ + public thumbnailUri: string; + + /** Image data. */ + public data?: "imageBytes"; + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.cloud.automl.v1.IImage): google.cloud.automl.v1.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.automl.v1.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Image message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.Image; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.Image; + + /** + * Verifies an Image message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Image + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.Image; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @param message Image + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Image + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSnippet. */ + interface ITextSnippet { + + /** TextSnippet content */ + content?: (string|null); + + /** TextSnippet mimeType */ + mimeType?: (string|null); + + /** TextSnippet contentUri */ + contentUri?: (string|null); + } + + /** Represents a TextSnippet. */ + class TextSnippet implements ITextSnippet { + + /** + * Constructs a new TextSnippet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextSnippet); + + /** TextSnippet content. */ + public content: string; + + /** TextSnippet mimeType. */ + public mimeType: string; + + /** TextSnippet contentUri. */ + public contentUri: string; + + /** + * Creates a new TextSnippet instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSnippet instance + */ + public static create(properties?: google.cloud.automl.v1.ITextSnippet): google.cloud.automl.v1.TextSnippet; + + /** + * Encodes the specified TextSnippet message. Does not implicitly {@link google.cloud.automl.v1.TextSnippet.verify|verify} messages. + * @param message TextSnippet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextSnippet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSnippet message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSnippet.verify|verify} messages. + * @param message TextSnippet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextSnippet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSnippet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextSnippet; + + /** + * Decodes a TextSnippet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextSnippet; + + /** + * Verifies a TextSnippet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSnippet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSnippet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextSnippet; + + /** + * Creates a plain object from a TextSnippet message. Also converts values to other types if specified. + * @param message TextSnippet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextSnippet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSnippet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSnippet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DocumentDimensions. */ + interface IDocumentDimensions { + + /** DocumentDimensions unit */ + unit?: (google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit|keyof typeof google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit|null); + + /** DocumentDimensions width */ + width?: (number|null); + + /** DocumentDimensions height */ + height?: (number|null); + } + + /** Represents a DocumentDimensions. */ + class DocumentDimensions implements IDocumentDimensions { + + /** + * Constructs a new DocumentDimensions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDocumentDimensions); + + /** DocumentDimensions unit. */ + public unit: (google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit|keyof typeof google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit); + + /** DocumentDimensions width. */ + public width: number; + + /** DocumentDimensions height. */ + public height: number; + + /** + * Creates a new DocumentDimensions instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentDimensions instance + */ + public static create(properties?: google.cloud.automl.v1.IDocumentDimensions): google.cloud.automl.v1.DocumentDimensions; + + /** + * Encodes the specified DocumentDimensions message. Does not implicitly {@link google.cloud.automl.v1.DocumentDimensions.verify|verify} messages. + * @param message DocumentDimensions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IDocumentDimensions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentDimensions message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DocumentDimensions.verify|verify} messages. + * @param message DocumentDimensions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IDocumentDimensions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentDimensions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentDimensions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.DocumentDimensions; + + /** + * Decodes a DocumentDimensions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentDimensions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.DocumentDimensions; + + /** + * Verifies a DocumentDimensions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DocumentDimensions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentDimensions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DocumentDimensions; + + /** + * Creates a plain object from a DocumentDimensions message. Also converts values to other types if specified. + * @param message DocumentDimensions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.DocumentDimensions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentDimensions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentDimensions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DocumentDimensions { + + /** DocumentDimensionUnit enum. */ + enum DocumentDimensionUnit { + DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0, + INCH = 1, + CENTIMETER = 2, + POINT = 3 + } + } + + /** Properties of a Document. */ + interface IDocument { + + /** Document inputConfig */ + inputConfig?: (google.cloud.automl.v1.IDocumentInputConfig|null); + + /** Document documentText */ + documentText?: (google.cloud.automl.v1.ITextSnippet|null); + + /** Document layout */ + layout?: (google.cloud.automl.v1.Document.ILayout[]|null); + + /** Document documentDimensions */ + documentDimensions?: (google.cloud.automl.v1.IDocumentDimensions|null); + + /** Document pageCount */ + pageCount?: (number|null); + } + + /** Represents a Document. */ + class Document implements IDocument { + + /** + * Constructs a new Document. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDocument); + + /** Document inputConfig. */ + public inputConfig?: (google.cloud.automl.v1.IDocumentInputConfig|null); + + /** Document documentText. */ + public documentText?: (google.cloud.automl.v1.ITextSnippet|null); + + /** Document layout. */ + public layout: google.cloud.automl.v1.Document.ILayout[]; + + /** Document documentDimensions. */ + public documentDimensions?: (google.cloud.automl.v1.IDocumentDimensions|null); + + /** Document pageCount. */ + public pageCount: number; + + /** + * Creates a new Document instance using the specified properties. + * @param [properties] Properties to set + * @returns Document instance + */ + public static create(properties?: google.cloud.automl.v1.IDocument): google.cloud.automl.v1.Document; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.automl.v1.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Document message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.Document; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.Document; + + /** + * Verifies a Document message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Document + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.Document; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @param message Document + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Document to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Document + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Document { + + /** Properties of a Layout. */ + interface ILayout { + + /** Layout textSegment */ + textSegment?: (google.cloud.automl.v1.ITextSegment|null); + + /** Layout pageNumber */ + pageNumber?: (number|null); + + /** Layout boundingPoly */ + boundingPoly?: (google.cloud.automl.v1.IBoundingPoly|null); + + /** Layout textSegmentType */ + textSegmentType?: (google.cloud.automl.v1.Document.Layout.TextSegmentType|keyof typeof google.cloud.automl.v1.Document.Layout.TextSegmentType|null); + } + + /** Represents a Layout. */ + class Layout implements ILayout { + + /** + * Constructs a new Layout. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.Document.ILayout); + + /** Layout textSegment. */ + public textSegment?: (google.cloud.automl.v1.ITextSegment|null); + + /** Layout pageNumber. */ + public pageNumber: number; + + /** Layout boundingPoly. */ + public boundingPoly?: (google.cloud.automl.v1.IBoundingPoly|null); + + /** Layout textSegmentType. */ + public textSegmentType: (google.cloud.automl.v1.Document.Layout.TextSegmentType|keyof typeof google.cloud.automl.v1.Document.Layout.TextSegmentType); + + /** + * Creates a new Layout instance using the specified properties. + * @param [properties] Properties to set + * @returns Layout instance + */ + public static create(properties?: google.cloud.automl.v1.Document.ILayout): google.cloud.automl.v1.Document.Layout; + + /** + * Encodes the specified Layout message. Does not implicitly {@link google.cloud.automl.v1.Document.Layout.verify|verify} messages. + * @param message Layout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.Document.ILayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Layout message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Document.Layout.verify|verify} messages. + * @param message Layout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.Document.ILayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Layout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Layout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.Document.Layout; + + /** + * Decodes a Layout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Layout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.Document.Layout; + + /** + * Verifies a Layout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Layout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Layout + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.Document.Layout; + + /** + * Creates a plain object from a Layout message. Also converts values to other types if specified. + * @param message Layout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.Document.Layout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Layout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Layout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Layout { + + /** TextSegmentType enum. */ + enum TextSegmentType { + TEXT_SEGMENT_TYPE_UNSPECIFIED = 0, + TOKEN = 1, + PARAGRAPH = 2, + FORM_FIELD = 3, + FORM_FIELD_NAME = 4, + FORM_FIELD_CONTENTS = 5, + TABLE = 6, + TABLE_HEADER = 7, + TABLE_ROW = 8, + TABLE_CELL = 9 + } + } + } + + /** Properties of an ExamplePayload. */ + interface IExamplePayload { + + /** ExamplePayload image */ + image?: (google.cloud.automl.v1.IImage|null); + + /** ExamplePayload textSnippet */ + textSnippet?: (google.cloud.automl.v1.ITextSnippet|null); + + /** ExamplePayload document */ + document?: (google.cloud.automl.v1.IDocument|null); + } + + /** Represents an ExamplePayload. */ + class ExamplePayload implements IExamplePayload { + + /** + * Constructs a new ExamplePayload. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IExamplePayload); + + /** ExamplePayload image. */ + public image?: (google.cloud.automl.v1.IImage|null); + + /** ExamplePayload textSnippet. */ + public textSnippet?: (google.cloud.automl.v1.ITextSnippet|null); + + /** ExamplePayload document. */ + public document?: (google.cloud.automl.v1.IDocument|null); + + /** ExamplePayload payload. */ + public payload?: ("image"|"textSnippet"|"document"); + + /** + * Creates a new ExamplePayload instance using the specified properties. + * @param [properties] Properties to set + * @returns ExamplePayload instance + */ + public static create(properties?: google.cloud.automl.v1.IExamplePayload): google.cloud.automl.v1.ExamplePayload; + + /** + * Encodes the specified ExamplePayload message. Does not implicitly {@link google.cloud.automl.v1.ExamplePayload.verify|verify} messages. + * @param message ExamplePayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IExamplePayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExamplePayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExamplePayload.verify|verify} messages. + * @param message ExamplePayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IExamplePayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExamplePayload message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExamplePayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ExamplePayload; + + /** + * Decodes an ExamplePayload message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExamplePayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ExamplePayload; + + /** + * Verifies an ExamplePayload message. + * @param message Plain 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 ExamplePayload message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExamplePayload + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExamplePayload; + + /** + * Creates a plain object from an ExamplePayload message. Also converts values to other types if specified. + * @param message ExamplePayload + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ExamplePayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExamplePayload to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExamplePayload + * @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 gcsSource */ + gcsSource?: (google.cloud.automl.v1.IGcsSource|null); + + /** InputConfig params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents an InputConfig. */ + class InputConfig implements IInputConfig { + + /** + * Constructs a new InputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IInputConfig); + + /** InputConfig gcsSource. */ + public gcsSource?: (google.cloud.automl.v1.IGcsSource|null); + + /** InputConfig params. */ + public params: { [k: string]: string }; + + /** InputConfig source. */ + public source?: "gcsSource"; + + /** + * Creates a new InputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputConfig instance + */ + public static create(properties?: google.cloud.automl.v1.IInputConfig): google.cloud.automl.v1.InputConfig; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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 BatchPredictInputConfig. */ + interface IBatchPredictInputConfig { + + /** BatchPredictInputConfig gcsSource */ + gcsSource?: (google.cloud.automl.v1.IGcsSource|null); + } + + /** Represents a BatchPredictInputConfig. */ + class BatchPredictInputConfig implements IBatchPredictInputConfig { + + /** + * Constructs a new BatchPredictInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IBatchPredictInputConfig); + + /** BatchPredictInputConfig gcsSource. */ + public gcsSource?: (google.cloud.automl.v1.IGcsSource|null); + + /** BatchPredictInputConfig source. */ + public source?: "gcsSource"; + + /** + * Creates a new BatchPredictInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictInputConfig instance + */ + public static create(properties?: google.cloud.automl.v1.IBatchPredictInputConfig): google.cloud.automl.v1.BatchPredictInputConfig; + + /** + * Encodes the specified BatchPredictInputConfig message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictInputConfig.verify|verify} messages. + * @param message BatchPredictInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IBatchPredictInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictInputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictInputConfig.verify|verify} messages. + * @param message BatchPredictInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IBatchPredictInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.BatchPredictInputConfig; + + /** + * Decodes a BatchPredictInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.BatchPredictInputConfig; + + /** + * Verifies a BatchPredictInputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BatchPredictInputConfig; + + /** + * Creates a plain object from a BatchPredictInputConfig message. Also converts values to other types if specified. + * @param message BatchPredictInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BatchPredictInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictInputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DocumentInputConfig. */ + interface IDocumentInputConfig { + + /** DocumentInputConfig gcsSource */ + gcsSource?: (google.cloud.automl.v1.IGcsSource|null); + } + + /** Represents a DocumentInputConfig. */ + class DocumentInputConfig implements IDocumentInputConfig { + + /** + * Constructs a new DocumentInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDocumentInputConfig); + + /** DocumentInputConfig gcsSource. */ + public gcsSource?: (google.cloud.automl.v1.IGcsSource|null); + + /** + * Creates a new DocumentInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentInputConfig instance + */ + public static create(properties?: google.cloud.automl.v1.IDocumentInputConfig): google.cloud.automl.v1.DocumentInputConfig; + + /** + * Encodes the specified DocumentInputConfig message. Does not implicitly {@link google.cloud.automl.v1.DocumentInputConfig.verify|verify} messages. + * @param message DocumentInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IDocumentInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentInputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DocumentInputConfig.verify|verify} messages. + * @param message DocumentInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IDocumentInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.DocumentInputConfig; + + /** + * Decodes a DocumentInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.DocumentInputConfig; + + /** + * Verifies a DocumentInputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DocumentInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DocumentInputConfig; + + /** + * Creates a plain object from a DocumentInputConfig message. Also converts values to other types if specified. + * @param message DocumentInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.DocumentInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentInputConfig + * @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.automl.v1.IGcsDestination|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.automl.v1.IGcsDestination|null); + + /** OutputConfig destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.automl.v1.IOutputConfig): google.cloud.automl.v1.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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 BatchPredictOutputConfig. */ + interface IBatchPredictOutputConfig { + + /** BatchPredictOutputConfig gcsDestination */ + gcsDestination?: (google.cloud.automl.v1.IGcsDestination|null); + } + + /** Represents a BatchPredictOutputConfig. */ + class BatchPredictOutputConfig implements IBatchPredictOutputConfig { + + /** + * Constructs a new BatchPredictOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IBatchPredictOutputConfig); + + /** BatchPredictOutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.automl.v1.IGcsDestination|null); + + /** BatchPredictOutputConfig destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new BatchPredictOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictOutputConfig instance + */ + public static create(properties?: google.cloud.automl.v1.IBatchPredictOutputConfig): google.cloud.automl.v1.BatchPredictOutputConfig; + + /** + * Encodes the specified BatchPredictOutputConfig message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOutputConfig.verify|verify} messages. + * @param message BatchPredictOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IBatchPredictOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOutputConfig.verify|verify} messages. + * @param message BatchPredictOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IBatchPredictOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.BatchPredictOutputConfig; + + /** + * Decodes a BatchPredictOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.BatchPredictOutputConfig; + + /** + * Verifies a BatchPredictOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BatchPredictOutputConfig; + + /** + * Creates a plain object from a BatchPredictOutputConfig message. Also converts values to other types if specified. + * @param message BatchPredictOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BatchPredictOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModelExportOutputConfig. */ + interface IModelExportOutputConfig { + + /** ModelExportOutputConfig gcsDestination */ + gcsDestination?: (google.cloud.automl.v1.IGcsDestination|null); + + /** ModelExportOutputConfig modelFormat */ + modelFormat?: (string|null); + + /** ModelExportOutputConfig params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents a ModelExportOutputConfig. */ + class ModelExportOutputConfig implements IModelExportOutputConfig { + + /** + * Constructs a new ModelExportOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IModelExportOutputConfig); + + /** ModelExportOutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.automl.v1.IGcsDestination|null); + + /** ModelExportOutputConfig modelFormat. */ + public modelFormat: string; + + /** ModelExportOutputConfig params. */ + public params: { [k: string]: string }; + + /** ModelExportOutputConfig destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new ModelExportOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelExportOutputConfig instance + */ + public static create(properties?: google.cloud.automl.v1.IModelExportOutputConfig): google.cloud.automl.v1.ModelExportOutputConfig; + + /** + * Encodes the specified ModelExportOutputConfig message. Does not implicitly {@link google.cloud.automl.v1.ModelExportOutputConfig.verify|verify} messages. + * @param message ModelExportOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IModelExportOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelExportOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ModelExportOutputConfig.verify|verify} messages. + * @param message ModelExportOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IModelExportOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelExportOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelExportOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ModelExportOutputConfig; + + /** + * Decodes a ModelExportOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelExportOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ModelExportOutputConfig; + + /** + * Verifies a ModelExportOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelExportOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelExportOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ModelExportOutputConfig; + + /** + * Creates a plain object from a ModelExportOutputConfig message. Also converts values to other types if specified. + * @param message ModelExportOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ModelExportOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelExportOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelExportOutputConfig + * @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 inputUris */ + inputUris?: (string[]|null); + } + + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { + + /** + * Constructs a new GcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IGcsSource); + + /** GcsSource inputUris. */ + public inputUris: string[]; + + /** + * Creates a new GcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSource instance + */ + public static create(properties?: google.cloud.automl.v1.IGcsSource): google.cloud.automl.v1.GcsSource; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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 GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination outputUriPrefix */ + outputUriPrefix?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IGcsDestination); + + /** GcsDestination outputUriPrefix. */ + public outputUriPrefix: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.automl.v1.IGcsDestination): google.cloud.automl.v1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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 an AnnotationSpec. */ + interface IAnnotationSpec { + + /** AnnotationSpec name */ + name?: (string|null); + + /** AnnotationSpec displayName */ + displayName?: (string|null); + + /** AnnotationSpec exampleCount */ + exampleCount?: (number|null); + } + + /** Represents an AnnotationSpec. */ + class AnnotationSpec implements IAnnotationSpec { + + /** + * Constructs a new AnnotationSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IAnnotationSpec); + + /** AnnotationSpec name. */ + public name: string; + + /** AnnotationSpec displayName. */ + public displayName: string; + + /** AnnotationSpec exampleCount. */ + public exampleCount: number; + + /** + * Creates a new AnnotationSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotationSpec instance + */ + public static create(properties?: google.cloud.automl.v1.IAnnotationSpec): google.cloud.automl.v1.AnnotationSpec; + + /** + * Encodes the specified AnnotationSpec message. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.IAnnotationSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotationSpec message, length delimited. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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; + } + + /** Properties of a Dataset. */ + interface IDataset { + + /** Dataset translationDatasetMetadata */ + translationDatasetMetadata?: (google.cloud.automl.v1.ITranslationDatasetMetadata|null); + + /** Dataset imageClassificationDatasetMetadata */ + imageClassificationDatasetMetadata?: (google.cloud.automl.v1.IImageClassificationDatasetMetadata|null); + + /** Dataset textClassificationDatasetMetadata */ + textClassificationDatasetMetadata?: (google.cloud.automl.v1.ITextClassificationDatasetMetadata|null); + + /** Dataset imageObjectDetectionDatasetMetadata */ + imageObjectDetectionDatasetMetadata?: (google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata|null); + + /** Dataset textExtractionDatasetMetadata */ + textExtractionDatasetMetadata?: (google.cloud.automl.v1.ITextExtractionDatasetMetadata|null); + + /** Dataset textSentimentDatasetMetadata */ + textSentimentDatasetMetadata?: (google.cloud.automl.v1.ITextSentimentDatasetMetadata|null); + + /** Dataset name */ + name?: (string|null); + + /** Dataset displayName */ + displayName?: (string|null); + + /** Dataset description */ + description?: (string|null); + + /** Dataset exampleCount */ + exampleCount?: (number|null); + + /** Dataset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Dataset etag */ + etag?: (string|null); + + /** Dataset labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Dataset. */ + class Dataset implements IDataset { + + /** + * Constructs a new Dataset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDataset); + + /** Dataset translationDatasetMetadata. */ + public translationDatasetMetadata?: (google.cloud.automl.v1.ITranslationDatasetMetadata|null); + + /** Dataset imageClassificationDatasetMetadata. */ + public imageClassificationDatasetMetadata?: (google.cloud.automl.v1.IImageClassificationDatasetMetadata|null); + + /** Dataset textClassificationDatasetMetadata. */ + public textClassificationDatasetMetadata?: (google.cloud.automl.v1.ITextClassificationDatasetMetadata|null); + + /** Dataset imageObjectDetectionDatasetMetadata. */ + public imageObjectDetectionDatasetMetadata?: (google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata|null); + + /** Dataset textExtractionDatasetMetadata. */ + public textExtractionDatasetMetadata?: (google.cloud.automl.v1.ITextExtractionDatasetMetadata|null); + + /** Dataset textSentimentDatasetMetadata. */ + public textSentimentDatasetMetadata?: (google.cloud.automl.v1.ITextSentimentDatasetMetadata|null); + + /** Dataset name. */ + public name: string; + + /** Dataset displayName. */ + public displayName: string; + + /** Dataset description. */ + public description: string; + + /** Dataset exampleCount. */ + public exampleCount: number; + + /** Dataset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Dataset etag. */ + public etag: string; + + /** Dataset labels. */ + public labels: { [k: string]: string }; + + /** Dataset datasetMetadata. */ + public datasetMetadata?: ("translationDatasetMetadata"|"imageClassificationDatasetMetadata"|"textClassificationDatasetMetadata"|"imageObjectDetectionDatasetMetadata"|"textExtractionDatasetMetadata"|"textSentimentDatasetMetadata"); + + /** + * Creates a new Dataset instance using the specified properties. + * @param [properties] Properties to set + * @returns Dataset instance + */ + public static create(properties?: google.cloud.automl.v1.IDataset): google.cloud.automl.v1.Dataset; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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 ImageClassificationDatasetMetadata. */ + interface IImageClassificationDatasetMetadata { + + /** ImageClassificationDatasetMetadata classificationType */ + classificationType?: (google.cloud.automl.v1.ClassificationType|keyof typeof google.cloud.automl.v1.ClassificationType|null); + } + + /** Represents an ImageClassificationDatasetMetadata. */ + class ImageClassificationDatasetMetadata implements IImageClassificationDatasetMetadata { + + /** + * Constructs a new ImageClassificationDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageClassificationDatasetMetadata); + + /** ImageClassificationDatasetMetadata classificationType. */ + public classificationType: (google.cloud.automl.v1.ClassificationType|keyof typeof google.cloud.automl.v1.ClassificationType); + + /** + * Creates a new ImageClassificationDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageClassificationDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImageClassificationDatasetMetadata): google.cloud.automl.v1.ImageClassificationDatasetMetadata; + + /** + * Encodes the specified ImageClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationDatasetMetadata.verify|verify} messages. + * @param message ImageClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationDatasetMetadata.verify|verify} messages. + * @param message ImageClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageClassificationDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ImageClassificationDatasetMetadata; + + /** + * Decodes an ImageClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ImageClassificationDatasetMetadata; + + /** + * Verifies an ImageClassificationDatasetMetadata message. + * @param message Plain 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 ImageClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageClassificationDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageClassificationDatasetMetadata; + + /** + * Creates a plain object from an ImageClassificationDatasetMetadata message. Also converts values to other types if specified. + * @param message ImageClassificationDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageClassificationDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageClassificationDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageClassificationDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageObjectDetectionDatasetMetadata. */ + interface IImageObjectDetectionDatasetMetadata { + } + + /** Represents an ImageObjectDetectionDatasetMetadata. */ + class ImageObjectDetectionDatasetMetadata implements IImageObjectDetectionDatasetMetadata { + + /** + * Constructs a new ImageObjectDetectionDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata); + + /** + * Creates a new ImageObjectDetectionDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata): google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata; + + /** + * Encodes the specified ImageObjectDetectionDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.verify|verify} messages. + * @param message ImageObjectDetectionDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.verify|verify} messages. + * @param message ImageObjectDetectionDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata; + + /** + * Decodes an ImageObjectDetectionDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata; + + /** + * Verifies an ImageObjectDetectionDatasetMetadata message. + * @param message Plain 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 ImageObjectDetectionDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata; + + /** + * Creates a plain object from an ImageObjectDetectionDatasetMetadata message. Also converts values to other types if specified. + * @param message ImageObjectDetectionDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageClassificationModelMetadata. */ + interface IImageClassificationModelMetadata { + + /** ImageClassificationModelMetadata baseModelId */ + baseModelId?: (string|null); + + /** ImageClassificationModelMetadata trainBudgetMilliNodeHours */ + trainBudgetMilliNodeHours?: (number|Long|string|null); + + /** ImageClassificationModelMetadata trainCostMilliNodeHours */ + trainCostMilliNodeHours?: (number|Long|string|null); + + /** ImageClassificationModelMetadata stopReason */ + stopReason?: (string|null); + + /** ImageClassificationModelMetadata modelType */ + modelType?: (string|null); + + /** ImageClassificationModelMetadata nodeQps */ + nodeQps?: (number|null); + + /** ImageClassificationModelMetadata nodeCount */ + nodeCount?: (number|Long|string|null); + } + + /** Represents an ImageClassificationModelMetadata. */ + class ImageClassificationModelMetadata implements IImageClassificationModelMetadata { + + /** + * Constructs a new ImageClassificationModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageClassificationModelMetadata); + + /** ImageClassificationModelMetadata baseModelId. */ + public baseModelId: string; + + /** ImageClassificationModelMetadata trainBudgetMilliNodeHours. */ + public trainBudgetMilliNodeHours: (number|Long|string); + + /** ImageClassificationModelMetadata trainCostMilliNodeHours. */ + public trainCostMilliNodeHours: (number|Long|string); + + /** ImageClassificationModelMetadata stopReason. */ + public stopReason: string; + + /** ImageClassificationModelMetadata modelType. */ + public modelType: string; + + /** ImageClassificationModelMetadata nodeQps. */ + public nodeQps: number; + + /** ImageClassificationModelMetadata nodeCount. */ + public nodeCount: (number|Long|string); + + /** + * Creates a new ImageClassificationModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageClassificationModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImageClassificationModelMetadata): google.cloud.automl.v1.ImageClassificationModelMetadata; + + /** + * Encodes the specified ImageClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelMetadata.verify|verify} messages. + * @param message ImageClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelMetadata.verify|verify} messages. + * @param message ImageClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageClassificationModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ImageClassificationModelMetadata; + + /** + * Decodes an ImageClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ImageClassificationModelMetadata; + + /** + * Verifies an ImageClassificationModelMetadata message. + * @param message Plain 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 ImageClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageClassificationModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageClassificationModelMetadata; + + /** + * Creates a plain object from an ImageClassificationModelMetadata message. Also converts values to other types if specified. + * @param message ImageClassificationModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageClassificationModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageClassificationModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageClassificationModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageObjectDetectionModelMetadata. */ + interface IImageObjectDetectionModelMetadata { + + /** ImageObjectDetectionModelMetadata modelType */ + modelType?: (string|null); + + /** ImageObjectDetectionModelMetadata nodeCount */ + nodeCount?: (number|Long|string|null); + + /** ImageObjectDetectionModelMetadata nodeQps */ + nodeQps?: (number|null); + + /** ImageObjectDetectionModelMetadata stopReason */ + stopReason?: (string|null); + + /** ImageObjectDetectionModelMetadata trainBudgetMilliNodeHours */ + trainBudgetMilliNodeHours?: (number|Long|string|null); + + /** ImageObjectDetectionModelMetadata trainCostMilliNodeHours */ + trainCostMilliNodeHours?: (number|Long|string|null); + } + + /** Represents an ImageObjectDetectionModelMetadata. */ + class ImageObjectDetectionModelMetadata implements IImageObjectDetectionModelMetadata { + + /** + * Constructs a new ImageObjectDetectionModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageObjectDetectionModelMetadata); + + /** ImageObjectDetectionModelMetadata modelType. */ + public modelType: string; + + /** ImageObjectDetectionModelMetadata nodeCount. */ + public nodeCount: (number|Long|string); + + /** ImageObjectDetectionModelMetadata nodeQps. */ + public nodeQps: number; + + /** ImageObjectDetectionModelMetadata stopReason. */ + public stopReason: string; + + /** ImageObjectDetectionModelMetadata trainBudgetMilliNodeHours. */ + public trainBudgetMilliNodeHours: (number|Long|string); + + /** ImageObjectDetectionModelMetadata trainCostMilliNodeHours. */ + public trainCostMilliNodeHours: (number|Long|string); + + /** + * Creates a new ImageObjectDetectionModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImageObjectDetectionModelMetadata): google.cloud.automl.v1.ImageObjectDetectionModelMetadata; + + /** + * Encodes the specified ImageObjectDetectionModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelMetadata.verify|verify} messages. + * @param message ImageObjectDetectionModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageObjectDetectionModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelMetadata.verify|verify} messages. + * @param message ImageObjectDetectionModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageObjectDetectionModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ImageObjectDetectionModelMetadata; + + /** + * Decodes an ImageObjectDetectionModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ImageObjectDetectionModelMetadata; + + /** + * Verifies an ImageObjectDetectionModelMetadata message. + * @param message Plain 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 ImageObjectDetectionModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageObjectDetectionModelMetadata; + + /** + * Creates a plain object from an ImageObjectDetectionModelMetadata message. Also converts values to other types if specified. + * @param message ImageObjectDetectionModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageObjectDetectionModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageClassificationModelDeploymentMetadata. */ + interface IImageClassificationModelDeploymentMetadata { + + /** ImageClassificationModelDeploymentMetadata nodeCount */ + nodeCount?: (number|Long|string|null); + } + + /** Represents an ImageClassificationModelDeploymentMetadata. */ + class ImageClassificationModelDeploymentMetadata implements IImageClassificationModelDeploymentMetadata { + + /** + * Constructs a new ImageClassificationModelDeploymentMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata); + + /** ImageClassificationModelDeploymentMetadata nodeCount. */ + public nodeCount: (number|Long|string); + + /** + * Creates a new ImageClassificationModelDeploymentMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageClassificationModelDeploymentMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata): google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata; + + /** + * Encodes the specified ImageClassificationModelDeploymentMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.verify|verify} messages. + * @param message ImageClassificationModelDeploymentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageClassificationModelDeploymentMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.verify|verify} messages. + * @param message ImageClassificationModelDeploymentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageClassificationModelDeploymentMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageClassificationModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata; + + /** + * Decodes an ImageClassificationModelDeploymentMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageClassificationModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata; + + /** + * Verifies an ImageClassificationModelDeploymentMetadata message. + * @param message Plain 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 ImageClassificationModelDeploymentMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageClassificationModelDeploymentMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata; + + /** + * Creates a plain object from an ImageClassificationModelDeploymentMetadata message. Also converts values to other types if specified. + * @param message ImageClassificationModelDeploymentMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageClassificationModelDeploymentMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageClassificationModelDeploymentMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageObjectDetectionModelDeploymentMetadata. */ + interface IImageObjectDetectionModelDeploymentMetadata { + + /** ImageObjectDetectionModelDeploymentMetadata nodeCount */ + nodeCount?: (number|Long|string|null); + } + + /** Represents an ImageObjectDetectionModelDeploymentMetadata. */ + class ImageObjectDetectionModelDeploymentMetadata implements IImageObjectDetectionModelDeploymentMetadata { + + /** + * Constructs a new ImageObjectDetectionModelDeploymentMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata); + + /** ImageObjectDetectionModelDeploymentMetadata nodeCount. */ + public nodeCount: (number|Long|string); + + /** + * Creates a new ImageObjectDetectionModelDeploymentMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionModelDeploymentMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata): google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata; + + /** + * Encodes the specified ImageObjectDetectionModelDeploymentMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.verify|verify} messages. + * @param message ImageObjectDetectionModelDeploymentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionModelDeploymentMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.verify|verify} messages. + * @param message ImageObjectDetectionModelDeploymentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionModelDeploymentMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata; + + /** + * Decodes an ImageObjectDetectionModelDeploymentMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata; + + /** + * Verifies an ImageObjectDetectionModelDeploymentMetadata message. + * @param message Plain 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 ImageObjectDetectionModelDeploymentMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionModelDeploymentMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata; + + /** + * Creates a plain object from an ImageObjectDetectionModelDeploymentMetadata message. Also converts values to other types if specified. + * @param message ImageObjectDetectionModelDeploymentMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionModelDeploymentMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionModelDeploymentMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextClassificationDatasetMetadata. */ + interface ITextClassificationDatasetMetadata { + + /** TextClassificationDatasetMetadata classificationType */ + classificationType?: (google.cloud.automl.v1.ClassificationType|keyof typeof google.cloud.automl.v1.ClassificationType|null); + } + + /** Represents a TextClassificationDatasetMetadata. */ + class TextClassificationDatasetMetadata implements ITextClassificationDatasetMetadata { + + /** + * Constructs a new TextClassificationDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextClassificationDatasetMetadata); + + /** TextClassificationDatasetMetadata classificationType. */ + public classificationType: (google.cloud.automl.v1.ClassificationType|keyof typeof google.cloud.automl.v1.ClassificationType); + + /** + * Creates a new TextClassificationDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextClassificationDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITextClassificationDatasetMetadata): google.cloud.automl.v1.TextClassificationDatasetMetadata; + + /** + * Encodes the specified TextClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextClassificationDatasetMetadata.verify|verify} messages. + * @param message TextClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextClassificationDatasetMetadata.verify|verify} messages. + * @param message TextClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextClassificationDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextClassificationDatasetMetadata; + + /** + * Decodes a TextClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextClassificationDatasetMetadata; + + /** + * Verifies a TextClassificationDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextClassificationDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextClassificationDatasetMetadata; + + /** + * Creates a plain object from a TextClassificationDatasetMetadata message. Also converts values to other types if specified. + * @param message TextClassificationDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextClassificationDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextClassificationDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextClassificationDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextClassificationModelMetadata. */ + interface ITextClassificationModelMetadata { + + /** TextClassificationModelMetadata classificationType */ + classificationType?: (google.cloud.automl.v1.ClassificationType|keyof typeof google.cloud.automl.v1.ClassificationType|null); + } + + /** Represents a TextClassificationModelMetadata. */ + class TextClassificationModelMetadata implements ITextClassificationModelMetadata { + + /** + * Constructs a new TextClassificationModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextClassificationModelMetadata); + + /** TextClassificationModelMetadata classificationType. */ + public classificationType: (google.cloud.automl.v1.ClassificationType|keyof typeof google.cloud.automl.v1.ClassificationType); + + /** + * Creates a new TextClassificationModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextClassificationModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITextClassificationModelMetadata): google.cloud.automl.v1.TextClassificationModelMetadata; + + /** + * Encodes the specified TextClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextClassificationModelMetadata.verify|verify} messages. + * @param message TextClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextClassificationModelMetadata.verify|verify} messages. + * @param message TextClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextClassificationModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextClassificationModelMetadata; + + /** + * Decodes a TextClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextClassificationModelMetadata; + + /** + * Verifies a TextClassificationModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextClassificationModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextClassificationModelMetadata; + + /** + * Creates a plain object from a TextClassificationModelMetadata message. Also converts values to other types if specified. + * @param message TextClassificationModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextClassificationModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextClassificationModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextClassificationModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextExtractionDatasetMetadata. */ + interface ITextExtractionDatasetMetadata { + } + + /** Represents a TextExtractionDatasetMetadata. */ + class TextExtractionDatasetMetadata implements ITextExtractionDatasetMetadata { + + /** + * Constructs a new TextExtractionDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextExtractionDatasetMetadata); + + /** + * Creates a new TextExtractionDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextExtractionDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITextExtractionDatasetMetadata): google.cloud.automl.v1.TextExtractionDatasetMetadata; + + /** + * Encodes the specified TextExtractionDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionDatasetMetadata.verify|verify} messages. + * @param message TextExtractionDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextExtractionDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextExtractionDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionDatasetMetadata.verify|verify} messages. + * @param message TextExtractionDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextExtractionDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextExtractionDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextExtractionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextExtractionDatasetMetadata; + + /** + * Decodes a TextExtractionDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextExtractionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextExtractionDatasetMetadata; + + /** + * Verifies a TextExtractionDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextExtractionDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextExtractionDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextExtractionDatasetMetadata; + + /** + * Creates a plain object from a TextExtractionDatasetMetadata message. Also converts values to other types if specified. + * @param message TextExtractionDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextExtractionDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextExtractionDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextExtractionDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextExtractionModelMetadata. */ + interface ITextExtractionModelMetadata { + } + + /** Represents a TextExtractionModelMetadata. */ + class TextExtractionModelMetadata implements ITextExtractionModelMetadata { + + /** + * Constructs a new TextExtractionModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextExtractionModelMetadata); + + /** + * Creates a new TextExtractionModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextExtractionModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITextExtractionModelMetadata): google.cloud.automl.v1.TextExtractionModelMetadata; + + /** + * Encodes the specified TextExtractionModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionModelMetadata.verify|verify} messages. + * @param message TextExtractionModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextExtractionModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextExtractionModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionModelMetadata.verify|verify} messages. + * @param message TextExtractionModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextExtractionModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextExtractionModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextExtractionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextExtractionModelMetadata; + + /** + * Decodes a TextExtractionModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextExtractionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextExtractionModelMetadata; + + /** + * Verifies a TextExtractionModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextExtractionModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextExtractionModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextExtractionModelMetadata; + + /** + * Creates a plain object from a TextExtractionModelMetadata message. Also converts values to other types if specified. + * @param message TextExtractionModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextExtractionModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextExtractionModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextExtractionModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSentimentDatasetMetadata. */ + interface ITextSentimentDatasetMetadata { + + /** TextSentimentDatasetMetadata sentimentMax */ + sentimentMax?: (number|null); + } + + /** Represents a TextSentimentDatasetMetadata. */ + class TextSentimentDatasetMetadata implements ITextSentimentDatasetMetadata { + + /** + * Constructs a new TextSentimentDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextSentimentDatasetMetadata); + + /** TextSentimentDatasetMetadata sentimentMax. */ + public sentimentMax: number; + + /** + * Creates a new TextSentimentDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSentimentDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITextSentimentDatasetMetadata): google.cloud.automl.v1.TextSentimentDatasetMetadata; + + /** + * Encodes the specified TextSentimentDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentDatasetMetadata.verify|verify} messages. + * @param message TextSentimentDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextSentimentDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSentimentDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentDatasetMetadata.verify|verify} messages. + * @param message TextSentimentDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextSentimentDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSentimentDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSentimentDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextSentimentDatasetMetadata; + + /** + * Decodes a TextSentimentDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSentimentDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextSentimentDatasetMetadata; + + /** + * Verifies a TextSentimentDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSentimentDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSentimentDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextSentimentDatasetMetadata; + + /** + * Creates a plain object from a TextSentimentDatasetMetadata message. Also converts values to other types if specified. + * @param message TextSentimentDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextSentimentDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSentimentDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSentimentDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSentimentModelMetadata. */ + interface ITextSentimentModelMetadata { + } + + /** Represents a TextSentimentModelMetadata. */ + class TextSentimentModelMetadata implements ITextSentimentModelMetadata { + + /** + * Constructs a new TextSentimentModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextSentimentModelMetadata); + + /** + * Creates a new TextSentimentModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSentimentModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITextSentimentModelMetadata): google.cloud.automl.v1.TextSentimentModelMetadata; + + /** + * Encodes the specified TextSentimentModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentModelMetadata.verify|verify} messages. + * @param message TextSentimentModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextSentimentModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSentimentModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentModelMetadata.verify|verify} messages. + * @param message TextSentimentModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextSentimentModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSentimentModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSentimentModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextSentimentModelMetadata; + + /** + * Decodes a TextSentimentModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSentimentModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextSentimentModelMetadata; + + /** + * Verifies a TextSentimentModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSentimentModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSentimentModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextSentimentModelMetadata; + + /** + * Creates a plain object from a TextSentimentModelMetadata message. Also converts values to other types if specified. + * @param message TextSentimentModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextSentimentModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSentimentModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSentimentModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Model. */ + interface IModel { + + /** Model translationModelMetadata */ + translationModelMetadata?: (google.cloud.automl.v1.ITranslationModelMetadata|null); + + /** Model imageClassificationModelMetadata */ + imageClassificationModelMetadata?: (google.cloud.automl.v1.IImageClassificationModelMetadata|null); + + /** Model textClassificationModelMetadata */ + textClassificationModelMetadata?: (google.cloud.automl.v1.ITextClassificationModelMetadata|null); + + /** Model imageObjectDetectionModelMetadata */ + imageObjectDetectionModelMetadata?: (google.cloud.automl.v1.IImageObjectDetectionModelMetadata|null); + + /** Model textExtractionModelMetadata */ + textExtractionModelMetadata?: (google.cloud.automl.v1.ITextExtractionModelMetadata|null); + + /** Model textSentimentModelMetadata */ + textSentimentModelMetadata?: (google.cloud.automl.v1.ITextSentimentModelMetadata|null); + + /** Model name */ + name?: (string|null); + + /** Model displayName */ + displayName?: (string|null); + + /** Model datasetId */ + datasetId?: (string|null); + + /** Model createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Model updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Model deploymentState */ + deploymentState?: (google.cloud.automl.v1.Model.DeploymentState|keyof typeof google.cloud.automl.v1.Model.DeploymentState|null); + + /** Model etag */ + etag?: (string|null); + + /** Model labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Model. */ + class Model implements IModel { + + /** + * Constructs a new Model. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IModel); + + /** Model translationModelMetadata. */ + public translationModelMetadata?: (google.cloud.automl.v1.ITranslationModelMetadata|null); + + /** Model imageClassificationModelMetadata. */ + public imageClassificationModelMetadata?: (google.cloud.automl.v1.IImageClassificationModelMetadata|null); + + /** Model textClassificationModelMetadata. */ + public textClassificationModelMetadata?: (google.cloud.automl.v1.ITextClassificationModelMetadata|null); + + /** Model imageObjectDetectionModelMetadata. */ + public imageObjectDetectionModelMetadata?: (google.cloud.automl.v1.IImageObjectDetectionModelMetadata|null); + + /** Model textExtractionModelMetadata. */ + public textExtractionModelMetadata?: (google.cloud.automl.v1.ITextExtractionModelMetadata|null); + + /** Model textSentimentModelMetadata. */ + public textSentimentModelMetadata?: (google.cloud.automl.v1.ITextSentimentModelMetadata|null); + + /** Model name. */ + public name: string; + + /** Model displayName. */ + public displayName: string; + + /** Model datasetId. */ + public datasetId: string; + + /** Model createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Model updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Model deploymentState. */ + public deploymentState: (google.cloud.automl.v1.Model.DeploymentState|keyof typeof google.cloud.automl.v1.Model.DeploymentState); + + /** Model etag. */ + public etag: string; + + /** Model labels. */ + public labels: { [k: string]: string }; + + /** Model modelMetadata. */ + public modelMetadata?: ("translationModelMetadata"|"imageClassificationModelMetadata"|"textClassificationModelMetadata"|"imageObjectDetectionModelMetadata"|"textExtractionModelMetadata"|"textSentimentModelMetadata"); + + /** + * Creates a new Model instance using the specified properties. + * @param [properties] Properties to set + * @returns Model instance + */ + public static create(properties?: google.cloud.automl.v1.IModel): google.cloud.automl.v1.Model; + + /** + * Encodes the specified Model message. Does not implicitly {@link google.cloud.automl.v1.Model.verify|verify} messages. + * @param message Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Model.verify|verify} messages. + * @param message Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Model message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.Model; + + /** + * Decodes a Model message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.Model; + + /** + * Verifies a Model message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Model message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Model + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.Model; + + /** + * Creates a plain object from a Model message. Also converts values to other types if specified. + * @param message Model + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.Model, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Model to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Model + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Model { + + /** DeploymentState enum. */ + enum DeploymentState { + DEPLOYMENT_STATE_UNSPECIFIED = 0, + DEPLOYED = 1, + UNDEPLOYED = 2 + } + } + + /** Properties of a ModelEvaluation. */ + interface IModelEvaluation { + + /** ModelEvaluation classificationEvaluationMetrics */ + classificationEvaluationMetrics?: (google.cloud.automl.v1.IClassificationEvaluationMetrics|null); + + /** ModelEvaluation translationEvaluationMetrics */ + translationEvaluationMetrics?: (google.cloud.automl.v1.ITranslationEvaluationMetrics|null); + + /** ModelEvaluation imageObjectDetectionEvaluationMetrics */ + imageObjectDetectionEvaluationMetrics?: (google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics|null); + + /** ModelEvaluation textSentimentEvaluationMetrics */ + textSentimentEvaluationMetrics?: (google.cloud.automl.v1.ITextSentimentEvaluationMetrics|null); + + /** ModelEvaluation textExtractionEvaluationMetrics */ + textExtractionEvaluationMetrics?: (google.cloud.automl.v1.ITextExtractionEvaluationMetrics|null); + + /** ModelEvaluation name */ + name?: (string|null); + + /** ModelEvaluation annotationSpecId */ + annotationSpecId?: (string|null); + + /** ModelEvaluation displayName */ + displayName?: (string|null); + + /** ModelEvaluation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ModelEvaluation evaluatedExampleCount */ + evaluatedExampleCount?: (number|null); + } + + /** Represents a ModelEvaluation. */ + class ModelEvaluation implements IModelEvaluation { + + /** + * Constructs a new ModelEvaluation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IModelEvaluation); + + /** ModelEvaluation classificationEvaluationMetrics. */ + public classificationEvaluationMetrics?: (google.cloud.automl.v1.IClassificationEvaluationMetrics|null); + + /** ModelEvaluation translationEvaluationMetrics. */ + public translationEvaluationMetrics?: (google.cloud.automl.v1.ITranslationEvaluationMetrics|null); + + /** ModelEvaluation imageObjectDetectionEvaluationMetrics. */ + public imageObjectDetectionEvaluationMetrics?: (google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics|null); + + /** ModelEvaluation textSentimentEvaluationMetrics. */ + public textSentimentEvaluationMetrics?: (google.cloud.automl.v1.ITextSentimentEvaluationMetrics|null); + + /** ModelEvaluation textExtractionEvaluationMetrics. */ + public textExtractionEvaluationMetrics?: (google.cloud.automl.v1.ITextExtractionEvaluationMetrics|null); + + /** ModelEvaluation name. */ + public name: string; + + /** ModelEvaluation annotationSpecId. */ + public annotationSpecId: string; + + /** ModelEvaluation displayName. */ + public displayName: string; + + /** ModelEvaluation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ModelEvaluation evaluatedExampleCount. */ + public evaluatedExampleCount: number; + + /** ModelEvaluation metrics. */ + public metrics?: ("classificationEvaluationMetrics"|"translationEvaluationMetrics"|"imageObjectDetectionEvaluationMetrics"|"textSentimentEvaluationMetrics"|"textExtractionEvaluationMetrics"); + + /** + * Creates a new ModelEvaluation instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelEvaluation instance + */ + public static create(properties?: google.cloud.automl.v1.IModelEvaluation): google.cloud.automl.v1.ModelEvaluation; + + /** + * Encodes the specified ModelEvaluation message. Does not implicitly {@link google.cloud.automl.v1.ModelEvaluation.verify|verify} messages. + * @param message ModelEvaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IModelEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelEvaluation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ModelEvaluation.verify|verify} messages. + * @param message ModelEvaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IModelEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ModelEvaluation; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ModelEvaluation; + + /** + * Verifies a ModelEvaluation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelEvaluation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelEvaluation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ModelEvaluation; + + /** + * Creates a plain object from a ModelEvaluation message. Also converts values to other types if specified. + * @param message ModelEvaluation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ModelEvaluation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelEvaluation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelEvaluation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata deleteDetails */ + deleteDetails?: (google.cloud.automl.v1.IDeleteOperationMetadata|null); + + /** OperationMetadata deployModelDetails */ + deployModelDetails?: (google.cloud.automl.v1.IDeployModelOperationMetadata|null); + + /** OperationMetadata undeployModelDetails */ + undeployModelDetails?: (google.cloud.automl.v1.IUndeployModelOperationMetadata|null); + + /** OperationMetadata createModelDetails */ + createModelDetails?: (google.cloud.automl.v1.ICreateModelOperationMetadata|null); + + /** OperationMetadata createDatasetDetails */ + createDatasetDetails?: (google.cloud.automl.v1.ICreateDatasetOperationMetadata|null); + + /** OperationMetadata importDataDetails */ + importDataDetails?: (google.cloud.automl.v1.IImportDataOperationMetadata|null); + + /** OperationMetadata batchPredictDetails */ + batchPredictDetails?: (google.cloud.automl.v1.IBatchPredictOperationMetadata|null); + + /** OperationMetadata exportDataDetails */ + exportDataDetails?: (google.cloud.automl.v1.IExportDataOperationMetadata|null); + + /** OperationMetadata exportModelDetails */ + exportModelDetails?: (google.cloud.automl.v1.IExportModelOperationMetadata|null); + + /** OperationMetadata progressPercent */ + progressPercent?: (number|null); + + /** OperationMetadata partialFailures */ + partialFailures?: (google.rpc.IStatus[]|null); + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IOperationMetadata); + + /** OperationMetadata deleteDetails. */ + public deleteDetails?: (google.cloud.automl.v1.IDeleteOperationMetadata|null); + + /** OperationMetadata deployModelDetails. */ + public deployModelDetails?: (google.cloud.automl.v1.IDeployModelOperationMetadata|null); + + /** OperationMetadata undeployModelDetails. */ + public undeployModelDetails?: (google.cloud.automl.v1.IUndeployModelOperationMetadata|null); + + /** OperationMetadata createModelDetails. */ + public createModelDetails?: (google.cloud.automl.v1.ICreateModelOperationMetadata|null); + + /** OperationMetadata createDatasetDetails. */ + public createDatasetDetails?: (google.cloud.automl.v1.ICreateDatasetOperationMetadata|null); + + /** OperationMetadata importDataDetails. */ + public importDataDetails?: (google.cloud.automl.v1.IImportDataOperationMetadata|null); + + /** OperationMetadata batchPredictDetails. */ + public batchPredictDetails?: (google.cloud.automl.v1.IBatchPredictOperationMetadata|null); + + /** OperationMetadata exportDataDetails. */ + public exportDataDetails?: (google.cloud.automl.v1.IExportDataOperationMetadata|null); + + /** OperationMetadata exportModelDetails. */ + public exportModelDetails?: (google.cloud.automl.v1.IExportModelOperationMetadata|null); + + /** OperationMetadata progressPercent. */ + public progressPercent: number; + + /** OperationMetadata partialFailures. */ + public partialFailures: google.rpc.IStatus[]; + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata details. */ + public details?: ("deleteDetails"|"deployModelDetails"|"undeployModelDetails"|"createModelDetails"|"createDatasetDetails"|"importDataDetails"|"batchPredictDetails"|"exportDataDetails"|"exportModelDetails"); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IOperationMetadata): google.cloud.automl.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationMetadata. */ + interface IDeleteOperationMetadata { + } + + /** Represents a DeleteOperationMetadata. */ + class DeleteOperationMetadata implements IDeleteOperationMetadata { + + /** + * Constructs a new DeleteOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDeleteOperationMetadata); + + /** + * Creates a new DeleteOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IDeleteOperationMetadata): google.cloud.automl.v1.DeleteOperationMetadata; + + /** + * Encodes the specified DeleteOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.DeleteOperationMetadata.verify|verify} messages. + * @param message DeleteOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IDeleteOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteOperationMetadata.verify|verify} messages. + * @param message DeleteOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IDeleteOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.DeleteOperationMetadata; + + /** + * Decodes a DeleteOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.DeleteOperationMetadata; + + /** + * Verifies a DeleteOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DeleteOperationMetadata; + + /** + * Creates a plain object from a DeleteOperationMetadata message. Also converts values to other types if specified. + * @param message DeleteOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.DeleteOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployModelOperationMetadata. */ + interface IDeployModelOperationMetadata { + } + + /** Represents a DeployModelOperationMetadata. */ + class DeployModelOperationMetadata implements IDeployModelOperationMetadata { + + /** + * Constructs a new DeployModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDeployModelOperationMetadata); + + /** + * Creates a new DeployModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployModelOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IDeployModelOperationMetadata): google.cloud.automl.v1.DeployModelOperationMetadata; + + /** + * Encodes the specified DeployModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.DeployModelOperationMetadata.verify|verify} messages. + * @param message DeployModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IDeployModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeployModelOperationMetadata.verify|verify} messages. + * @param message DeployModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IDeployModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.DeployModelOperationMetadata; + + /** + * Decodes a DeployModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.DeployModelOperationMetadata; + + /** + * Verifies a DeployModelOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DeployModelOperationMetadata; + + /** + * Creates a plain object from a DeployModelOperationMetadata message. Also converts values to other types if specified. + * @param message DeployModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.DeployModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployModelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeployModelOperationMetadata. */ + interface IUndeployModelOperationMetadata { + } + + /** Represents an UndeployModelOperationMetadata. */ + class UndeployModelOperationMetadata implements IUndeployModelOperationMetadata { + + /** + * Constructs a new UndeployModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IUndeployModelOperationMetadata); + + /** + * Creates a new UndeployModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeployModelOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IUndeployModelOperationMetadata): google.cloud.automl.v1.UndeployModelOperationMetadata; + + /** + * Encodes the specified UndeployModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.UndeployModelOperationMetadata.verify|verify} messages. + * @param message UndeployModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IUndeployModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeployModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UndeployModelOperationMetadata.verify|verify} messages. + * @param message UndeployModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IUndeployModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeployModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.UndeployModelOperationMetadata; + + /** + * Decodes an UndeployModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.UndeployModelOperationMetadata; + + /** + * Verifies an UndeployModelOperationMetadata message. + * @param message Plain 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 UndeployModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeployModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.UndeployModelOperationMetadata; + + /** + * Creates a plain object from an UndeployModelOperationMetadata message. Also converts values to other types if specified. + * @param message UndeployModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.UndeployModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeployModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeployModelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDatasetOperationMetadata. */ + interface ICreateDatasetOperationMetadata { + } + + /** Represents a CreateDatasetOperationMetadata. */ + class CreateDatasetOperationMetadata implements ICreateDatasetOperationMetadata { + + /** + * Constructs a new CreateDatasetOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ICreateDatasetOperationMetadata); + + /** + * Creates a new CreateDatasetOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDatasetOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ICreateDatasetOperationMetadata): google.cloud.automl.v1.CreateDatasetOperationMetadata; + + /** + * Encodes the specified CreateDatasetOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetOperationMetadata.verify|verify} messages. + * @param message CreateDatasetOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ICreateDatasetOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDatasetOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetOperationMetadata.verify|verify} messages. + * @param message CreateDatasetOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ICreateDatasetOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDatasetOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDatasetOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.CreateDatasetOperationMetadata; + + /** + * Decodes a CreateDatasetOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDatasetOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.CreateDatasetOperationMetadata; + + /** + * Verifies a CreateDatasetOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDatasetOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDatasetOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.CreateDatasetOperationMetadata; + + /** + * Creates a plain object from a CreateDatasetOperationMetadata message. Also converts values to other types if specified. + * @param message CreateDatasetOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.CreateDatasetOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDatasetOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDatasetOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateModelOperationMetadata. */ + interface ICreateModelOperationMetadata { + } + + /** Represents a CreateModelOperationMetadata. */ + class CreateModelOperationMetadata implements ICreateModelOperationMetadata { + + /** + * Constructs a new CreateModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ICreateModelOperationMetadata); + + /** + * Creates a new CreateModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateModelOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ICreateModelOperationMetadata): google.cloud.automl.v1.CreateModelOperationMetadata; + + /** + * Encodes the specified CreateModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.CreateModelOperationMetadata.verify|verify} messages. + * @param message CreateModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ICreateModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateModelOperationMetadata.verify|verify} messages. + * @param message CreateModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ICreateModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.CreateModelOperationMetadata; + + /** + * Decodes a CreateModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.CreateModelOperationMetadata; + + /** + * Verifies a CreateModelOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.CreateModelOperationMetadata; + + /** + * Creates a plain object from a CreateModelOperationMetadata message. Also converts values to other types if specified. + * @param message CreateModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.CreateModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateModelOperationMetadata + * @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 { + } + + /** Represents an ImportDataOperationMetadata. */ + class ImportDataOperationMetadata implements IImportDataOperationMetadata { + + /** + * Constructs a new ImportDataOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImportDataOperationMetadata); + + /** + * Creates a new ImportDataOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDataOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImportDataOperationMetadata): google.cloud.automl.v1.ImportDataOperationMetadata; + + /** + * Encodes the specified ImportDataOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.IImportDataOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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 outputInfo */ + outputInfo?: (google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo|null); + } + + /** Represents an ExportDataOperationMetadata. */ + class ExportDataOperationMetadata implements IExportDataOperationMetadata { + + /** + * Constructs a new ExportDataOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IExportDataOperationMetadata); + + /** ExportDataOperationMetadata outputInfo. */ + public outputInfo?: (google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo|null); + + /** + * Creates a new ExportDataOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IExportDataOperationMetadata): google.cloud.automl.v1.ExportDataOperationMetadata; + + /** + * Encodes the specified ExportDataOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.IExportDataOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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; + } + + namespace ExportDataOperationMetadata { + + /** Properties of an ExportDataOutputInfo. */ + interface IExportDataOutputInfo { + + /** ExportDataOutputInfo gcsOutputDirectory */ + gcsOutputDirectory?: (string|null); + } + + /** Represents an ExportDataOutputInfo. */ + class ExportDataOutputInfo implements IExportDataOutputInfo { + + /** + * Constructs a new ExportDataOutputInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo); + + /** ExportDataOutputInfo gcsOutputDirectory. */ + public gcsOutputDirectory?: (string|null); + + /** ExportDataOutputInfo outputLocation. */ + public outputLocation?: "gcsOutputDirectory"; + + /** + * Creates a new ExportDataOutputInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataOutputInfo instance + */ + public static create(properties?: google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo): google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo; + + /** + * Encodes the specified ExportDataOutputInfo message. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.verify|verify} messages. + * @param message ExportDataOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.verify|verify} messages. + * @param message ExportDataOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportDataOutputInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportDataOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo; + + /** + * Decodes an ExportDataOutputInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportDataOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo; + + /** + * Verifies an ExportDataOutputInfo message. + * @param message Plain 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 ExportDataOutputInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportDataOutputInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo; + + /** + * Creates a plain object from an ExportDataOutputInfo message. Also converts values to other types if specified. + * @param message ExportDataOutputInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportDataOutputInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportDataOutputInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a BatchPredictOperationMetadata. */ + interface IBatchPredictOperationMetadata { + + /** BatchPredictOperationMetadata inputConfig */ + inputConfig?: (google.cloud.automl.v1.IBatchPredictInputConfig|null); + + /** BatchPredictOperationMetadata outputInfo */ + outputInfo?: (google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo|null); + } + + /** Represents a BatchPredictOperationMetadata. */ + class BatchPredictOperationMetadata implements IBatchPredictOperationMetadata { + + /** + * Constructs a new BatchPredictOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IBatchPredictOperationMetadata); + + /** BatchPredictOperationMetadata inputConfig. */ + public inputConfig?: (google.cloud.automl.v1.IBatchPredictInputConfig|null); + + /** BatchPredictOperationMetadata outputInfo. */ + public outputInfo?: (google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo|null); + + /** + * Creates a new BatchPredictOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IBatchPredictOperationMetadata): google.cloud.automl.v1.BatchPredictOperationMetadata; + + /** + * Encodes the specified BatchPredictOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.verify|verify} messages. + * @param message BatchPredictOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IBatchPredictOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.verify|verify} messages. + * @param message BatchPredictOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IBatchPredictOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.BatchPredictOperationMetadata; + + /** + * Decodes a BatchPredictOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.BatchPredictOperationMetadata; + + /** + * Verifies a BatchPredictOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BatchPredictOperationMetadata; + + /** + * Creates a plain object from a BatchPredictOperationMetadata message. Also converts values to other types if specified. + * @param message BatchPredictOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BatchPredictOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchPredictOperationMetadata { + + /** Properties of a BatchPredictOutputInfo. */ + interface IBatchPredictOutputInfo { + + /** BatchPredictOutputInfo gcsOutputDirectory */ + gcsOutputDirectory?: (string|null); + } + + /** Represents a BatchPredictOutputInfo. */ + class BatchPredictOutputInfo implements IBatchPredictOutputInfo { + + /** + * Constructs a new BatchPredictOutputInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo); + + /** BatchPredictOutputInfo gcsOutputDirectory. */ + public gcsOutputDirectory?: (string|null); + + /** BatchPredictOutputInfo outputLocation. */ + public outputLocation?: "gcsOutputDirectory"; + + /** + * Creates a new BatchPredictOutputInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictOutputInfo instance + */ + public static create(properties?: google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo): google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo; + + /** + * Encodes the specified BatchPredictOutputInfo message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify|verify} messages. + * @param message BatchPredictOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify|verify} messages. + * @param message BatchPredictOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictOutputInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo; + + /** + * Decodes a BatchPredictOutputInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo; + + /** + * Verifies a BatchPredictOutputInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictOutputInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictOutputInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo; + + /** + * Creates a plain object from a BatchPredictOutputInfo message. Also converts values to other types if specified. + * @param message BatchPredictOutputInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictOutputInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictOutputInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExportModelOperationMetadata. */ + interface IExportModelOperationMetadata { + + /** ExportModelOperationMetadata outputInfo */ + outputInfo?: (google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo|null); + } + + /** Represents an ExportModelOperationMetadata. */ + class ExportModelOperationMetadata implements IExportModelOperationMetadata { + + /** + * Constructs a new ExportModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IExportModelOperationMetadata); + + /** ExportModelOperationMetadata outputInfo. */ + public outputInfo?: (google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo|null); + + /** + * Creates a new ExportModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportModelOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IExportModelOperationMetadata): google.cloud.automl.v1.ExportModelOperationMetadata; + + /** + * Encodes the specified ExportModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.verify|verify} messages. + * @param message ExportModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IExportModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.verify|verify} messages. + * @param message ExportModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IExportModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ExportModelOperationMetadata; + + /** + * Decodes an ExportModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ExportModelOperationMetadata; + + /** + * Verifies an ExportModelOperationMetadata message. + * @param message Plain 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 ExportModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExportModelOperationMetadata; + + /** + * Creates a plain object from an ExportModelOperationMetadata message. Also converts values to other types if specified. + * @param message ExportModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ExportModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportModelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportModelOperationMetadata { + + /** Properties of an ExportModelOutputInfo. */ + interface IExportModelOutputInfo { + + /** ExportModelOutputInfo gcsOutputDirectory */ + gcsOutputDirectory?: (string|null); + } + + /** Represents an ExportModelOutputInfo. */ + class ExportModelOutputInfo implements IExportModelOutputInfo { + + /** + * Constructs a new ExportModelOutputInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo); + + /** ExportModelOutputInfo gcsOutputDirectory. */ + public gcsOutputDirectory: string; + + /** + * Creates a new ExportModelOutputInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportModelOutputInfo instance + */ + public static create(properties?: google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo): google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo; + + /** + * Encodes the specified ExportModelOutputInfo message. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.verify|verify} messages. + * @param message ExportModelOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportModelOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.verify|verify} messages. + * @param message ExportModelOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportModelOutputInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportModelOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo; + + /** + * Decodes an ExportModelOutputInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportModelOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo; + + /** + * Verifies an ExportModelOutputInfo message. + * @param message Plain 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 ExportModelOutputInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportModelOutputInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo; + + /** + * Creates a plain object from an ExportModelOutputInfo message. Also converts values to other types if specified. + * @param message ExportModelOutputInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportModelOutputInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportModelOutputInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a PredictionService */ + class PredictionService extends $protobuf.rpc.Service { + + /** + * Constructs a new PredictionService 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 PredictionService 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): PredictionService; + + /** + * Calls Predict. + * @param request PredictRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PredictResponse + */ + public predict(request: google.cloud.automl.v1.IPredictRequest, callback: google.cloud.automl.v1.PredictionService.PredictCallback): void; + + /** + * Calls Predict. + * @param request PredictRequest message or plain object + * @returns Promise + */ + public predict(request: google.cloud.automl.v1.IPredictRequest): Promise; + + /** + * Calls BatchPredict. + * @param request BatchPredictRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchPredict(request: google.cloud.automl.v1.IBatchPredictRequest, callback: google.cloud.automl.v1.PredictionService.BatchPredictCallback): void; + + /** + * Calls BatchPredict. + * @param request BatchPredictRequest message or plain object + * @returns Promise + */ + public batchPredict(request: google.cloud.automl.v1.IBatchPredictRequest): Promise; + } + + namespace PredictionService { + + /** + * Callback as used by {@link google.cloud.automl.v1.PredictionService|predict}. + * @param error Error, if any + * @param [response] PredictResponse + */ + type PredictCallback = (error: (Error|null), response?: google.cloud.automl.v1.PredictResponse) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.PredictionService|batchPredict}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchPredictCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a PredictRequest. */ + interface IPredictRequest { + + /** PredictRequest name */ + name?: (string|null); + + /** PredictRequest payload */ + payload?: (google.cloud.automl.v1.IExamplePayload|null); + + /** PredictRequest params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents a PredictRequest. */ + class PredictRequest implements IPredictRequest { + + /** + * Constructs a new PredictRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IPredictRequest); + + /** PredictRequest name. */ + public name: string; + + /** PredictRequest payload. */ + public payload?: (google.cloud.automl.v1.IExamplePayload|null); + + /** PredictRequest params. */ + public params: { [k: string]: string }; + + /** + * Creates a new PredictRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PredictRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IPredictRequest): google.cloud.automl.v1.PredictRequest; + + /** + * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.automl.v1.PredictRequest.verify|verify} messages. + * @param message PredictRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.PredictRequest.verify|verify} messages. + * @param message PredictRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PredictRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.PredictRequest; + + /** + * Decodes a PredictRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.PredictRequest; + + /** + * Verifies a PredictRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PredictRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.PredictRequest; + + /** + * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. + * @param message PredictRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.PredictRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PredictRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PredictRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PredictResponse. */ + interface IPredictResponse { + + /** PredictResponse payload */ + payload?: (google.cloud.automl.v1.IAnnotationPayload[]|null); + + /** PredictResponse preprocessedInput */ + preprocessedInput?: (google.cloud.automl.v1.IExamplePayload|null); + + /** PredictResponse metadata */ + metadata?: ({ [k: string]: string }|null); + } + + /** Represents a PredictResponse. */ + class PredictResponse implements IPredictResponse { + + /** + * Constructs a new PredictResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IPredictResponse); + + /** PredictResponse payload. */ + public payload: google.cloud.automl.v1.IAnnotationPayload[]; + + /** PredictResponse preprocessedInput. */ + public preprocessedInput?: (google.cloud.automl.v1.IExamplePayload|null); + + /** PredictResponse metadata. */ + public metadata: { [k: string]: string }; + + /** + * Creates a new PredictResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PredictResponse instance + */ + public static create(properties?: google.cloud.automl.v1.IPredictResponse): google.cloud.automl.v1.PredictResponse; + + /** + * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.automl.v1.PredictResponse.verify|verify} messages. + * @param message PredictResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.PredictResponse.verify|verify} messages. + * @param message PredictResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PredictResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PredictResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.PredictResponse; + + /** + * Decodes a PredictResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PredictResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.PredictResponse; + + /** + * Verifies a PredictResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PredictResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.PredictResponse; + + /** + * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. + * @param message PredictResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.PredictResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PredictResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PredictResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchPredictRequest. */ + interface IBatchPredictRequest { + + /** BatchPredictRequest name */ + name?: (string|null); + + /** BatchPredictRequest inputConfig */ + inputConfig?: (google.cloud.automl.v1.IBatchPredictInputConfig|null); + + /** BatchPredictRequest outputConfig */ + outputConfig?: (google.cloud.automl.v1.IBatchPredictOutputConfig|null); + + /** BatchPredictRequest params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents a BatchPredictRequest. */ + class BatchPredictRequest implements IBatchPredictRequest { + + /** + * Constructs a new BatchPredictRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IBatchPredictRequest); + + /** BatchPredictRequest name. */ + public name: string; + + /** BatchPredictRequest inputConfig. */ + public inputConfig?: (google.cloud.automl.v1.IBatchPredictInputConfig|null); + + /** BatchPredictRequest outputConfig. */ + public outputConfig?: (google.cloud.automl.v1.IBatchPredictOutputConfig|null); + + /** BatchPredictRequest params. */ + public params: { [k: string]: string }; + + /** + * Creates a new BatchPredictRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IBatchPredictRequest): google.cloud.automl.v1.BatchPredictRequest; + + /** + * Encodes the specified BatchPredictRequest message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictRequest.verify|verify} messages. + * @param message BatchPredictRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IBatchPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictRequest.verify|verify} messages. + * @param message BatchPredictRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IBatchPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.BatchPredictRequest; + + /** + * Decodes a BatchPredictRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.BatchPredictRequest; + + /** + * Verifies a BatchPredictRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BatchPredictRequest; + + /** + * Creates a plain object from a BatchPredictRequest message. Also converts values to other types if specified. + * @param message BatchPredictRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BatchPredictRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchPredictResult. */ + interface IBatchPredictResult { + + /** BatchPredictResult metadata */ + metadata?: ({ [k: string]: string }|null); + } + + /** Represents a BatchPredictResult. */ + class BatchPredictResult implements IBatchPredictResult { + + /** + * Constructs a new BatchPredictResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IBatchPredictResult); + + /** BatchPredictResult metadata. */ + public metadata: { [k: string]: string }; + + /** + * Creates a new BatchPredictResult instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictResult instance + */ + public static create(properties?: google.cloud.automl.v1.IBatchPredictResult): google.cloud.automl.v1.BatchPredictResult; + + /** + * Encodes the specified BatchPredictResult message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictResult.verify|verify} messages. + * @param message BatchPredictResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IBatchPredictResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictResult message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictResult.verify|verify} messages. + * @param message BatchPredictResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IBatchPredictResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.BatchPredictResult; + + /** + * Decodes a BatchPredictResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.BatchPredictResult; + + /** + * Verifies a BatchPredictResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BatchPredictResult; + + /** + * Creates a plain object from a BatchPredictResult message. Also converts values to other types if specified. + * @param message BatchPredictResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BatchPredictResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an AutoMl */ + class AutoMl extends $protobuf.rpc.Service { + + /** + * Constructs a new AutoMl 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 AutoMl 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): AutoMl; + + /** + * Calls CreateDataset. + * @param request CreateDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createDataset(request: google.cloud.automl.v1.ICreateDatasetRequest, callback: google.cloud.automl.v1.AutoMl.CreateDatasetCallback): void; + + /** + * Calls CreateDataset. + * @param request CreateDatasetRequest message or plain object + * @returns Promise + */ + public createDataset(request: google.cloud.automl.v1.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.automl.v1.IGetDatasetRequest, callback: google.cloud.automl.v1.AutoMl.GetDatasetCallback): void; + + /** + * Calls GetDataset. + * @param request GetDatasetRequest message or plain object + * @returns Promise + */ + public getDataset(request: google.cloud.automl.v1.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.automl.v1.IListDatasetsRequest, callback: google.cloud.automl.v1.AutoMl.ListDatasetsCallback): void; + + /** + * Calls ListDatasets. + * @param request ListDatasetsRequest message or plain object + * @returns Promise + */ + public listDatasets(request: google.cloud.automl.v1.IListDatasetsRequest): Promise; + + /** + * Calls UpdateDataset. + * @param request UpdateDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dataset + */ + public updateDataset(request: google.cloud.automl.v1.IUpdateDatasetRequest, callback: google.cloud.automl.v1.AutoMl.UpdateDatasetCallback): void; + + /** + * Calls UpdateDataset. + * @param request UpdateDatasetRequest message or plain object + * @returns Promise + */ + public updateDataset(request: google.cloud.automl.v1.IUpdateDatasetRequest): Promise; + + /** + * Calls DeleteDataset. + * @param request DeleteDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteDataset(request: google.cloud.automl.v1.IDeleteDatasetRequest, callback: google.cloud.automl.v1.AutoMl.DeleteDatasetCallback): void; + + /** + * Calls DeleteDataset. + * @param request DeleteDatasetRequest message or plain object + * @returns Promise + */ + public deleteDataset(request: google.cloud.automl.v1.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.automl.v1.IImportDataRequest, callback: google.cloud.automl.v1.AutoMl.ImportDataCallback): void; + + /** + * Calls ImportData. + * @param request ImportDataRequest message or plain object + * @returns Promise + */ + public importData(request: google.cloud.automl.v1.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.automl.v1.IExportDataRequest, callback: google.cloud.automl.v1.AutoMl.ExportDataCallback): void; + + /** + * Calls ExportData. + * @param request ExportDataRequest message or plain object + * @returns Promise + */ + public exportData(request: google.cloud.automl.v1.IExportDataRequest): Promise; + + /** + * Calls GetAnnotationSpec. + * @param request GetAnnotationSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnnotationSpec + */ + public getAnnotationSpec(request: google.cloud.automl.v1.IGetAnnotationSpecRequest, callback: google.cloud.automl.v1.AutoMl.GetAnnotationSpecCallback): void; + + /** + * Calls GetAnnotationSpec. + * @param request GetAnnotationSpecRequest message or plain object + * @returns Promise + */ + public getAnnotationSpec(request: google.cloud.automl.v1.IGetAnnotationSpecRequest): Promise; + + /** + * Calls CreateModel. + * @param request CreateModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createModel(request: google.cloud.automl.v1.ICreateModelRequest, callback: google.cloud.automl.v1.AutoMl.CreateModelCallback): void; + + /** + * Calls CreateModel. + * @param request CreateModelRequest message or plain object + * @returns Promise + */ + public createModel(request: google.cloud.automl.v1.ICreateModelRequest): Promise; + + /** + * Calls GetModel. + * @param request GetModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Model + */ + public getModel(request: google.cloud.automl.v1.IGetModelRequest, callback: google.cloud.automl.v1.AutoMl.GetModelCallback): void; + + /** + * Calls GetModel. + * @param request GetModelRequest message or plain object + * @returns Promise + */ + public getModel(request: google.cloud.automl.v1.IGetModelRequest): Promise; + + /** + * Calls ListModels. + * @param request ListModelsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListModelsResponse + */ + public listModels(request: google.cloud.automl.v1.IListModelsRequest, callback: google.cloud.automl.v1.AutoMl.ListModelsCallback): void; + + /** + * Calls ListModels. + * @param request ListModelsRequest message or plain object + * @returns Promise + */ + public listModels(request: google.cloud.automl.v1.IListModelsRequest): Promise; + + /** + * Calls DeleteModel. + * @param request DeleteModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteModel(request: google.cloud.automl.v1.IDeleteModelRequest, callback: google.cloud.automl.v1.AutoMl.DeleteModelCallback): void; + + /** + * Calls DeleteModel. + * @param request DeleteModelRequest message or plain object + * @returns Promise + */ + public deleteModel(request: google.cloud.automl.v1.IDeleteModelRequest): Promise; + + /** + * Calls UpdateModel. + * @param request UpdateModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Model + */ + public updateModel(request: google.cloud.automl.v1.IUpdateModelRequest, callback: google.cloud.automl.v1.AutoMl.UpdateModelCallback): void; + + /** + * Calls UpdateModel. + * @param request UpdateModelRequest message or plain object + * @returns Promise + */ + public updateModel(request: google.cloud.automl.v1.IUpdateModelRequest): Promise; + + /** + * Calls DeployModel. + * @param request DeployModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deployModel(request: google.cloud.automl.v1.IDeployModelRequest, callback: google.cloud.automl.v1.AutoMl.DeployModelCallback): void; + + /** + * Calls DeployModel. + * @param request DeployModelRequest message or plain object + * @returns Promise + */ + public deployModel(request: google.cloud.automl.v1.IDeployModelRequest): Promise; + + /** + * Calls UndeployModel. + * @param request UndeployModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public undeployModel(request: google.cloud.automl.v1.IUndeployModelRequest, callback: google.cloud.automl.v1.AutoMl.UndeployModelCallback): void; + + /** + * Calls UndeployModel. + * @param request UndeployModelRequest message or plain object + * @returns Promise + */ + public undeployModel(request: google.cloud.automl.v1.IUndeployModelRequest): Promise; + + /** + * Calls ExportModel. + * @param request ExportModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportModel(request: google.cloud.automl.v1.IExportModelRequest, callback: google.cloud.automl.v1.AutoMl.ExportModelCallback): void; + + /** + * Calls ExportModel. + * @param request ExportModelRequest message or plain object + * @returns Promise + */ + public exportModel(request: google.cloud.automl.v1.IExportModelRequest): Promise; + + /** + * Calls GetModelEvaluation. + * @param request GetModelEvaluationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ModelEvaluation + */ + public getModelEvaluation(request: google.cloud.automl.v1.IGetModelEvaluationRequest, callback: google.cloud.automl.v1.AutoMl.GetModelEvaluationCallback): void; + + /** + * Calls GetModelEvaluation. + * @param request GetModelEvaluationRequest message or plain object + * @returns Promise + */ + public getModelEvaluation(request: google.cloud.automl.v1.IGetModelEvaluationRequest): Promise; + + /** + * Calls ListModelEvaluations. + * @param request ListModelEvaluationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListModelEvaluationsResponse + */ + public listModelEvaluations(request: google.cloud.automl.v1.IListModelEvaluationsRequest, callback: google.cloud.automl.v1.AutoMl.ListModelEvaluationsCallback): void; + + /** + * Calls ListModelEvaluations. + * @param request ListModelEvaluationsRequest message or plain object + * @returns Promise + */ + public listModelEvaluations(request: google.cloud.automl.v1.IListModelEvaluationsRequest): Promise; + } + + namespace AutoMl { + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|createDataset}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateDatasetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|getDataset}. + * @param error Error, if any + * @param [response] Dataset + */ + type GetDatasetCallback = (error: (Error|null), response?: google.cloud.automl.v1.Dataset) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|listDatasets}. + * @param error Error, if any + * @param [response] ListDatasetsResponse + */ + type ListDatasetsCallback = (error: (Error|null), response?: google.cloud.automl.v1.ListDatasetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|updateDataset}. + * @param error Error, if any + * @param [response] Dataset + */ + type UpdateDatasetCallback = (error: (Error|null), response?: google.cloud.automl.v1.Dataset) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|deleteDataset}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteDatasetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|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.automl.v1.AutoMl|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.automl.v1.AutoMl|getAnnotationSpec}. + * @param error Error, if any + * @param [response] AnnotationSpec + */ + type GetAnnotationSpecCallback = (error: (Error|null), response?: google.cloud.automl.v1.AnnotationSpec) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|createModel}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|getModel}. + * @param error Error, if any + * @param [response] Model + */ + type GetModelCallback = (error: (Error|null), response?: google.cloud.automl.v1.Model) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|listModels}. + * @param error Error, if any + * @param [response] ListModelsResponse + */ + type ListModelsCallback = (error: (Error|null), response?: google.cloud.automl.v1.ListModelsResponse) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|deleteModel}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|updateModel}. + * @param error Error, if any + * @param [response] Model + */ + type UpdateModelCallback = (error: (Error|null), response?: google.cloud.automl.v1.Model) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|deployModel}. + * @param error Error, if any + * @param [response] Operation + */ + type DeployModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|undeployModel}. + * @param error Error, if any + * @param [response] Operation + */ + type UndeployModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|exportModel}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|getModelEvaluation}. + * @param error Error, if any + * @param [response] ModelEvaluation + */ + type GetModelEvaluationCallback = (error: (Error|null), response?: google.cloud.automl.v1.ModelEvaluation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|listModelEvaluations}. + * @param error Error, if any + * @param [response] ListModelEvaluationsResponse + */ + type ListModelEvaluationsCallback = (error: (Error|null), response?: google.cloud.automl.v1.ListModelEvaluationsResponse) => void; + } + + /** Properties of a CreateDatasetRequest. */ + interface ICreateDatasetRequest { + + /** CreateDatasetRequest parent */ + parent?: (string|null); + + /** CreateDatasetRequest dataset */ + dataset?: (google.cloud.automl.v1.IDataset|null); + } + + /** Represents a CreateDatasetRequest. */ + class CreateDatasetRequest implements ICreateDatasetRequest { + + /** + * Constructs a new CreateDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ICreateDatasetRequest); + + /** CreateDatasetRequest parent. */ + public parent: string; + + /** CreateDatasetRequest dataset. */ + public dataset?: (google.cloud.automl.v1.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.automl.v1.ICreateDatasetRequest): google.cloud.automl.v1.CreateDatasetRequest; + + /** + * Encodes the specified CreateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.ICreateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.IGetDatasetRequest): google.cloud.automl.v1.GetDatasetRequest; + + /** + * Encodes the specified GetDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.IGetDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.IListDatasetsRequest): google.cloud.automl.v1.ListDatasetsRequest; + + /** + * Encodes the specified ListDatasetsRequest message. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.IListDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.IListDatasetsResponse); + + /** ListDatasetsResponse datasets. */ + public datasets: google.cloud.automl.v1.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.automl.v1.IListDatasetsResponse): google.cloud.automl.v1.ListDatasetsResponse; + + /** + * Encodes the specified ListDatasetsResponse message. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.IListDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatasetsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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 an UpdateDatasetRequest. */ + interface IUpdateDatasetRequest { + + /** UpdateDatasetRequest dataset */ + dataset?: (google.cloud.automl.v1.IDataset|null); + + /** UpdateDatasetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDatasetRequest. */ + class UpdateDatasetRequest implements IUpdateDatasetRequest { + + /** + * Constructs a new UpdateDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IUpdateDatasetRequest); + + /** UpdateDatasetRequest dataset. */ + public dataset?: (google.cloud.automl.v1.IDataset|null); + + /** UpdateDatasetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDatasetRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IUpdateDatasetRequest): google.cloud.automl.v1.UpdateDatasetRequest; + + /** + * Encodes the specified UpdateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.UpdateDatasetRequest.verify|verify} messages. + * @param message UpdateDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IUpdateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UpdateDatasetRequest.verify|verify} messages. + * @param message UpdateDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IUpdateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.UpdateDatasetRequest; + + /** + * Decodes an UpdateDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.UpdateDatasetRequest; + + /** + * Verifies an UpdateDatasetRequest message. + * @param message Plain 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 UpdateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.UpdateDatasetRequest; + + /** + * Creates a plain object from an UpdateDatasetRequest message. Also converts values to other types if specified. + * @param message UpdateDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.UpdateDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDatasetRequest + * @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.automl.v1.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.automl.v1.IDeleteDatasetRequest): google.cloud.automl.v1.DeleteDatasetRequest; + + /** + * Encodes the specified DeleteDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.IDeleteDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.IInputConfig|null); + } + + /** Represents an ImportDataRequest. */ + class ImportDataRequest implements IImportDataRequest { + + /** + * Constructs a new ImportDataRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImportDataRequest); + + /** ImportDataRequest name. */ + public name: string; + + /** ImportDataRequest inputConfig. */ + public inputConfig?: (google.cloud.automl.v1.IInputConfig|null); + + /** + * Creates a new ImportDataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDataRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IImportDataRequest): google.cloud.automl.v1.ImportDataRequest; + + /** + * Encodes the specified ImportDataRequest message. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.IImportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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 outputConfig */ + outputConfig?: (google.cloud.automl.v1.IOutputConfig|null); + } + + /** Represents an ExportDataRequest. */ + class ExportDataRequest implements IExportDataRequest { + + /** + * Constructs a new ExportDataRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IExportDataRequest); + + /** ExportDataRequest name. */ + public name: string; + + /** ExportDataRequest outputConfig. */ + public outputConfig?: (google.cloud.automl.v1.IOutputConfig|null); + + /** + * Creates a new ExportDataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IExportDataRequest): google.cloud.automl.v1.ExportDataRequest; + + /** + * Encodes the specified ExportDataRequest message. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.IExportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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 GetAnnotationSpecRequest. */ + interface IGetAnnotationSpecRequest { + + /** GetAnnotationSpecRequest name */ + name?: (string|null); + } + + /** Represents a GetAnnotationSpecRequest. */ + class GetAnnotationSpecRequest implements IGetAnnotationSpecRequest { + + /** + * Constructs a new GetAnnotationSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IGetAnnotationSpecRequest); + + /** GetAnnotationSpecRequest name. */ + public name: string; + + /** + * Creates a new GetAnnotationSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAnnotationSpecRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IGetAnnotationSpecRequest): google.cloud.automl.v1.GetAnnotationSpecRequest; + + /** + * Encodes the specified GetAnnotationSpecRequest message. Does not implicitly {@link google.cloud.automl.v1.GetAnnotationSpecRequest.verify|verify} messages. + * @param message GetAnnotationSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IGetAnnotationSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAnnotationSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetAnnotationSpecRequest.verify|verify} messages. + * @param message GetAnnotationSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IGetAnnotationSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAnnotationSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAnnotationSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.GetAnnotationSpecRequest; + + /** + * Decodes a GetAnnotationSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAnnotationSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.GetAnnotationSpecRequest; + + /** + * Verifies a GetAnnotationSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAnnotationSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAnnotationSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.GetAnnotationSpecRequest; + + /** + * Creates a plain object from a GetAnnotationSpecRequest message. Also converts values to other types if specified. + * @param message GetAnnotationSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.GetAnnotationSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAnnotationSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAnnotationSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateModelRequest. */ + interface ICreateModelRequest { + + /** CreateModelRequest parent */ + parent?: (string|null); + + /** CreateModelRequest model */ + model?: (google.cloud.automl.v1.IModel|null); + } + + /** Represents a CreateModelRequest. */ + class CreateModelRequest implements ICreateModelRequest { + + /** + * Constructs a new CreateModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ICreateModelRequest); + + /** CreateModelRequest parent. */ + public parent: string; + + /** CreateModelRequest model. */ + public model?: (google.cloud.automl.v1.IModel|null); + + /** + * Creates a new CreateModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1.ICreateModelRequest): google.cloud.automl.v1.CreateModelRequest; + + /** + * Encodes the specified CreateModelRequest message. Does not implicitly {@link google.cloud.automl.v1.CreateModelRequest.verify|verify} messages. + * @param message CreateModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ICreateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateModelRequest.verify|verify} messages. + * @param message CreateModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ICreateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.CreateModelRequest; + + /** + * Decodes a CreateModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.CreateModelRequest; + + /** + * Verifies a CreateModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.CreateModelRequest; + + /** + * Creates a plain object from a CreateModelRequest message. Also converts values to other types if specified. + * @param message CreateModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.CreateModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetModelRequest. */ + interface IGetModelRequest { + + /** GetModelRequest name */ + name?: (string|null); + } + + /** Represents a GetModelRequest. */ + class GetModelRequest implements IGetModelRequest { + + /** + * Constructs a new GetModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IGetModelRequest); + + /** GetModelRequest name. */ + public name: string; + + /** + * Creates a new GetModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IGetModelRequest): google.cloud.automl.v1.GetModelRequest; + + /** + * Encodes the specified GetModelRequest message. Does not implicitly {@link google.cloud.automl.v1.GetModelRequest.verify|verify} messages. + * @param message GetModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetModelRequest.verify|verify} messages. + * @param message GetModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.GetModelRequest; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.GetModelRequest; + + /** + * Verifies a GetModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.GetModelRequest; + + /** + * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified. + * @param message GetModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.GetModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelsRequest. */ + interface IListModelsRequest { + + /** ListModelsRequest parent */ + parent?: (string|null); + + /** ListModelsRequest filter */ + filter?: (string|null); + + /** ListModelsRequest pageSize */ + pageSize?: (number|null); + + /** ListModelsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListModelsRequest. */ + class ListModelsRequest implements IListModelsRequest { + + /** + * Constructs a new ListModelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IListModelsRequest); + + /** ListModelsRequest parent. */ + public parent: string; + + /** ListModelsRequest filter. */ + public filter: string; + + /** ListModelsRequest pageSize. */ + public pageSize: number; + + /** ListModelsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListModelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelsRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IListModelsRequest): google.cloud.automl.v1.ListModelsRequest; + + /** + * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListModelsRequest.verify|verify} messages. + * @param message ListModelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelsRequest.verify|verify} messages. + * @param message ListModelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ListModelsRequest; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ListModelsRequest; + + /** + * Verifies a ListModelsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListModelsRequest; + + /** + * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified. + * @param message ListModelsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ListModelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelsResponse. */ + interface IListModelsResponse { + + /** ListModelsResponse model */ + model?: (google.cloud.automl.v1.IModel[]|null); + + /** ListModelsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListModelsResponse. */ + class ListModelsResponse implements IListModelsResponse { + + /** + * Constructs a new ListModelsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IListModelsResponse); + + /** ListModelsResponse model. */ + public model: google.cloud.automl.v1.IModel[]; + + /** ListModelsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListModelsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelsResponse instance + */ + public static create(properties?: google.cloud.automl.v1.IListModelsResponse): google.cloud.automl.v1.ListModelsResponse; + + /** + * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListModelsResponse.verify|verify} messages. + * @param message ListModelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelsResponse.verify|verify} messages. + * @param message ListModelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ListModelsResponse; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ListModelsResponse; + + /** + * Verifies a ListModelsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListModelsResponse; + + /** + * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. + * @param message ListModelsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ListModelsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteModelRequest. */ + interface IDeleteModelRequest { + + /** DeleteModelRequest name */ + name?: (string|null); + } + + /** Represents a DeleteModelRequest. */ + class DeleteModelRequest implements IDeleteModelRequest { + + /** + * Constructs a new DeleteModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDeleteModelRequest); + + /** DeleteModelRequest name. */ + public name: string; + + /** + * Creates a new DeleteModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IDeleteModelRequest): google.cloud.automl.v1.DeleteModelRequest; + + /** + * Encodes the specified DeleteModelRequest message. Does not implicitly {@link google.cloud.automl.v1.DeleteModelRequest.verify|verify} messages. + * @param message DeleteModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IDeleteModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteModelRequest.verify|verify} messages. + * @param message DeleteModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IDeleteModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.DeleteModelRequest; + + /** + * Decodes a DeleteModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.DeleteModelRequest; + + /** + * Verifies a DeleteModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DeleteModelRequest; + + /** + * Creates a plain object from a DeleteModelRequest message. Also converts values to other types if specified. + * @param message DeleteModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.DeleteModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateModelRequest. */ + interface IUpdateModelRequest { + + /** UpdateModelRequest model */ + model?: (google.cloud.automl.v1.IModel|null); + + /** UpdateModelRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateModelRequest. */ + class UpdateModelRequest implements IUpdateModelRequest { + + /** + * Constructs a new UpdateModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IUpdateModelRequest); + + /** UpdateModelRequest model. */ + public model?: (google.cloud.automl.v1.IModel|null); + + /** UpdateModelRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IUpdateModelRequest): google.cloud.automl.v1.UpdateModelRequest; + + /** + * Encodes the specified UpdateModelRequest message. Does not implicitly {@link google.cloud.automl.v1.UpdateModelRequest.verify|verify} messages. + * @param message UpdateModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IUpdateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UpdateModelRequest.verify|verify} messages. + * @param message UpdateModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IUpdateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.UpdateModelRequest; + + /** + * Decodes an UpdateModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.UpdateModelRequest; + + /** + * Verifies an UpdateModelRequest message. + * @param message Plain 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 UpdateModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.UpdateModelRequest; + + /** + * Creates a plain object from an UpdateModelRequest message. Also converts values to other types if specified. + * @param message UpdateModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.UpdateModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployModelRequest. */ + interface IDeployModelRequest { + + /** DeployModelRequest imageObjectDetectionModelDeploymentMetadata */ + imageObjectDetectionModelDeploymentMetadata?: (google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata|null); + + /** DeployModelRequest imageClassificationModelDeploymentMetadata */ + imageClassificationModelDeploymentMetadata?: (google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata|null); + + /** DeployModelRequest name */ + name?: (string|null); + } + + /** Represents a DeployModelRequest. */ + class DeployModelRequest implements IDeployModelRequest { + + /** + * Constructs a new DeployModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDeployModelRequest); + + /** DeployModelRequest imageObjectDetectionModelDeploymentMetadata. */ + public imageObjectDetectionModelDeploymentMetadata?: (google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata|null); + + /** DeployModelRequest imageClassificationModelDeploymentMetadata. */ + public imageClassificationModelDeploymentMetadata?: (google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata|null); + + /** DeployModelRequest name. */ + public name: string; + + /** DeployModelRequest modelDeploymentMetadata. */ + public modelDeploymentMetadata?: ("imageObjectDetectionModelDeploymentMetadata"|"imageClassificationModelDeploymentMetadata"); + + /** + * Creates a new DeployModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IDeployModelRequest): google.cloud.automl.v1.DeployModelRequest; + + /** + * Encodes the specified DeployModelRequest message. Does not implicitly {@link google.cloud.automl.v1.DeployModelRequest.verify|verify} messages. + * @param message DeployModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IDeployModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeployModelRequest.verify|verify} messages. + * @param message DeployModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IDeployModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.DeployModelRequest; + + /** + * Decodes a DeployModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.DeployModelRequest; + + /** + * Verifies a DeployModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DeployModelRequest; + + /** + * Creates a plain object from a DeployModelRequest message. Also converts values to other types if specified. + * @param message DeployModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.DeployModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeployModelRequest. */ + interface IUndeployModelRequest { + + /** UndeployModelRequest name */ + name?: (string|null); + } + + /** Represents an UndeployModelRequest. */ + class UndeployModelRequest implements IUndeployModelRequest { + + /** + * Constructs a new UndeployModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IUndeployModelRequest); + + /** UndeployModelRequest name. */ + public name: string; + + /** + * Creates a new UndeployModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeployModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IUndeployModelRequest): google.cloud.automl.v1.UndeployModelRequest; + + /** + * Encodes the specified UndeployModelRequest message. Does not implicitly {@link google.cloud.automl.v1.UndeployModelRequest.verify|verify} messages. + * @param message UndeployModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IUndeployModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeployModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UndeployModelRequest.verify|verify} messages. + * @param message UndeployModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IUndeployModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeployModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.UndeployModelRequest; + + /** + * Decodes an UndeployModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.UndeployModelRequest; + + /** + * Verifies an UndeployModelRequest message. + * @param message Plain 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 UndeployModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeployModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.UndeployModelRequest; + + /** + * Creates a plain object from an UndeployModelRequest message. Also converts values to other types if specified. + * @param message UndeployModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.UndeployModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeployModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeployModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportModelRequest. */ + interface IExportModelRequest { + + /** ExportModelRequest name */ + name?: (string|null); + + /** ExportModelRequest outputConfig */ + outputConfig?: (google.cloud.automl.v1.IModelExportOutputConfig|null); + } + + /** Represents an ExportModelRequest. */ + class ExportModelRequest implements IExportModelRequest { + + /** + * Constructs a new ExportModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IExportModelRequest); + + /** ExportModelRequest name. */ + public name: string; + + /** ExportModelRequest outputConfig. */ + public outputConfig?: (google.cloud.automl.v1.IModelExportOutputConfig|null); + + /** + * Creates a new ExportModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IExportModelRequest): google.cloud.automl.v1.ExportModelRequest; + + /** + * Encodes the specified ExportModelRequest message. Does not implicitly {@link google.cloud.automl.v1.ExportModelRequest.verify|verify} messages. + * @param message ExportModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IExportModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportModelRequest.verify|verify} messages. + * @param message ExportModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IExportModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ExportModelRequest; + + /** + * Decodes an ExportModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ExportModelRequest; + + /** + * Verifies an ExportModelRequest message. + * @param message Plain 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 ExportModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExportModelRequest; + + /** + * Creates a plain object from an ExportModelRequest message. Also converts values to other types if specified. + * @param message ExportModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ExportModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetModelEvaluationRequest. */ + interface IGetModelEvaluationRequest { + + /** GetModelEvaluationRequest name */ + name?: (string|null); + } + + /** Represents a GetModelEvaluationRequest. */ + class GetModelEvaluationRequest implements IGetModelEvaluationRequest { + + /** + * Constructs a new GetModelEvaluationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IGetModelEvaluationRequest); + + /** GetModelEvaluationRequest name. */ + public name: string; + + /** + * Creates a new GetModelEvaluationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetModelEvaluationRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IGetModelEvaluationRequest): google.cloud.automl.v1.GetModelEvaluationRequest; + + /** + * Encodes the specified GetModelEvaluationRequest message. Does not implicitly {@link google.cloud.automl.v1.GetModelEvaluationRequest.verify|verify} messages. + * @param message GetModelEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IGetModelEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetModelEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetModelEvaluationRequest.verify|verify} messages. + * @param message GetModelEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IGetModelEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetModelEvaluationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetModelEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.GetModelEvaluationRequest; + + /** + * Decodes a GetModelEvaluationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetModelEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.GetModelEvaluationRequest; + + /** + * Verifies a GetModelEvaluationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetModelEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetModelEvaluationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.GetModelEvaluationRequest; + + /** + * Creates a plain object from a GetModelEvaluationRequest message. Also converts values to other types if specified. + * @param message GetModelEvaluationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.GetModelEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetModelEvaluationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetModelEvaluationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelEvaluationsRequest. */ + interface IListModelEvaluationsRequest { + + /** ListModelEvaluationsRequest parent */ + parent?: (string|null); + + /** ListModelEvaluationsRequest filter */ + filter?: (string|null); + + /** ListModelEvaluationsRequest pageSize */ + pageSize?: (number|null); + + /** ListModelEvaluationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListModelEvaluationsRequest. */ + class ListModelEvaluationsRequest implements IListModelEvaluationsRequest { + + /** + * Constructs a new ListModelEvaluationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IListModelEvaluationsRequest); + + /** ListModelEvaluationsRequest parent. */ + public parent: string; + + /** ListModelEvaluationsRequest filter. */ + public filter: string; + + /** ListModelEvaluationsRequest pageSize. */ + public pageSize: number; + + /** ListModelEvaluationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListModelEvaluationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelEvaluationsRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IListModelEvaluationsRequest): google.cloud.automl.v1.ListModelEvaluationsRequest; + + /** + * Encodes the specified ListModelEvaluationsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsRequest.verify|verify} messages. + * @param message ListModelEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IListModelEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsRequest.verify|verify} messages. + * @param message ListModelEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IListModelEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ListModelEvaluationsRequest; + + /** + * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ListModelEvaluationsRequest; + + /** + * Verifies a ListModelEvaluationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelEvaluationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListModelEvaluationsRequest; + + /** + * Creates a plain object from a ListModelEvaluationsRequest message. Also converts values to other types if specified. + * @param message ListModelEvaluationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ListModelEvaluationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelEvaluationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelEvaluationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelEvaluationsResponse. */ + interface IListModelEvaluationsResponse { + + /** ListModelEvaluationsResponse modelEvaluation */ + modelEvaluation?: (google.cloud.automl.v1.IModelEvaluation[]|null); + + /** ListModelEvaluationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListModelEvaluationsResponse. */ + class ListModelEvaluationsResponse implements IListModelEvaluationsResponse { + + /** + * Constructs a new ListModelEvaluationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IListModelEvaluationsResponse); + + /** ListModelEvaluationsResponse modelEvaluation. */ + public modelEvaluation: google.cloud.automl.v1.IModelEvaluation[]; + + /** ListModelEvaluationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListModelEvaluationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelEvaluationsResponse instance + */ + public static create(properties?: google.cloud.automl.v1.IListModelEvaluationsResponse): google.cloud.automl.v1.ListModelEvaluationsResponse; + + /** + * Encodes the specified ListModelEvaluationsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsResponse.verify|verify} messages. + * @param message ListModelEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IListModelEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsResponse.verify|verify} messages. + * @param message ListModelEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IListModelEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ListModelEvaluationsResponse; + + /** + * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ListModelEvaluationsResponse; + + /** + * Verifies a ListModelEvaluationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelEvaluationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListModelEvaluationsResponse; + + /** + * Creates a plain object from a ListModelEvaluationsResponse message. Also converts values to other types if specified. + * @param message ListModelEvaluationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ListModelEvaluationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelEvaluationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelEvaluationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Properties of an AnnotationPayload. */ + interface IAnnotationPayload { + + /** AnnotationPayload translation */ + translation?: (google.cloud.automl.v1beta1.ITranslationAnnotation|null); + + /** AnnotationPayload classification */ + classification?: (google.cloud.automl.v1beta1.IClassificationAnnotation|null); + + /** AnnotationPayload imageObjectDetection */ + imageObjectDetection?: (google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation|null); + + /** AnnotationPayload videoClassification */ + videoClassification?: (google.cloud.automl.v1beta1.IVideoClassificationAnnotation|null); + + /** AnnotationPayload videoObjectTracking */ + videoObjectTracking?: (google.cloud.automl.v1beta1.IVideoObjectTrackingAnnotation|null); + + /** AnnotationPayload textExtraction */ + textExtraction?: (google.cloud.automl.v1beta1.ITextExtractionAnnotation|null); + + /** AnnotationPayload textSentiment */ + textSentiment?: (google.cloud.automl.v1beta1.ITextSentimentAnnotation|null); + + /** AnnotationPayload tables */ + tables?: (google.cloud.automl.v1beta1.ITablesAnnotation|null); + + /** AnnotationPayload annotationSpecId */ + annotationSpecId?: (string|null); + + /** AnnotationPayload displayName */ + displayName?: (string|null); + } + + /** Represents an AnnotationPayload. */ + class AnnotationPayload implements IAnnotationPayload { + + /** + * Constructs a new AnnotationPayload. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IAnnotationPayload); + + /** AnnotationPayload translation. */ + public translation?: (google.cloud.automl.v1beta1.ITranslationAnnotation|null); + + /** AnnotationPayload classification. */ + public classification?: (google.cloud.automl.v1beta1.IClassificationAnnotation|null); + + /** AnnotationPayload imageObjectDetection. */ + public imageObjectDetection?: (google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation|null); + + /** AnnotationPayload videoClassification. */ + public videoClassification?: (google.cloud.automl.v1beta1.IVideoClassificationAnnotation|null); + + /** AnnotationPayload videoObjectTracking. */ + public videoObjectTracking?: (google.cloud.automl.v1beta1.IVideoObjectTrackingAnnotation|null); + + /** AnnotationPayload textExtraction. */ + public textExtraction?: (google.cloud.automl.v1beta1.ITextExtractionAnnotation|null); + + /** AnnotationPayload textSentiment. */ + public textSentiment?: (google.cloud.automl.v1beta1.ITextSentimentAnnotation|null); + + /** AnnotationPayload tables. */ + public tables?: (google.cloud.automl.v1beta1.ITablesAnnotation|null); + + /** AnnotationPayload annotationSpecId. */ + public annotationSpecId: string; + + /** AnnotationPayload displayName. */ + public displayName: string; + + /** AnnotationPayload detail. */ + public detail?: ("translation"|"classification"|"imageObjectDetection"|"videoClassification"|"videoObjectTracking"|"textExtraction"|"textSentiment"|"tables"); + + /** + * Creates a new AnnotationPayload instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotationPayload instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IAnnotationPayload): google.cloud.automl.v1beta1.AnnotationPayload; + + /** + * Encodes the specified AnnotationPayload message. Does not implicitly {@link google.cloud.automl.v1beta1.AnnotationPayload.verify|verify} messages. + * @param message AnnotationPayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IAnnotationPayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotationPayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.AnnotationPayload.verify|verify} messages. + * @param message AnnotationPayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IAnnotationPayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotationPayload message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotationPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.AnnotationPayload; + + /** + * Decodes an AnnotationPayload message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotationPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.AnnotationPayload; + + /** + * Verifies an AnnotationPayload message. + * @param message Plain 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 AnnotationPayload message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotationPayload + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.AnnotationPayload; + + /** + * Creates a plain object from an AnnotationPayload message. Also converts values to other types if specified. + * @param message AnnotationPayload + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.AnnotationPayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotationPayload to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotationPayload + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ClassificationType enum. */ + enum ClassificationType { + CLASSIFICATION_TYPE_UNSPECIFIED = 0, + MULTICLASS = 1, + MULTILABEL = 2 + } + + /** Properties of a ClassificationAnnotation. */ + interface IClassificationAnnotation { + + /** ClassificationAnnotation score */ + score?: (number|null); + } + + /** Represents a ClassificationAnnotation. */ + class ClassificationAnnotation implements IClassificationAnnotation { + + /** + * Constructs a new ClassificationAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IClassificationAnnotation); + + /** ClassificationAnnotation score. */ + public score: number; + + /** + * Creates a new ClassificationAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassificationAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IClassificationAnnotation): google.cloud.automl.v1beta1.ClassificationAnnotation; + + /** + * Encodes the specified ClassificationAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationAnnotation.verify|verify} messages. + * @param message ClassificationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IClassificationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassificationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationAnnotation.verify|verify} messages. + * @param message ClassificationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IClassificationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassificationAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ClassificationAnnotation; + + /** + * Decodes a ClassificationAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ClassificationAnnotation; + + /** + * Verifies a ClassificationAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassificationAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassificationAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ClassificationAnnotation; + + /** + * Creates a plain object from a ClassificationAnnotation message. Also converts values to other types if specified. + * @param message ClassificationAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ClassificationAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassificationAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassificationAnnotation + * @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 type */ + type?: (string|null); + + /** VideoClassificationAnnotation classificationAnnotation */ + classificationAnnotation?: (google.cloud.automl.v1beta1.IClassificationAnnotation|null); + + /** VideoClassificationAnnotation timeSegment */ + timeSegment?: (google.cloud.automl.v1beta1.ITimeSegment|null); + } + + /** Represents a VideoClassificationAnnotation. */ + class VideoClassificationAnnotation implements IVideoClassificationAnnotation { + + /** + * Constructs a new VideoClassificationAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IVideoClassificationAnnotation); + + /** VideoClassificationAnnotation type. */ + public type: string; + + /** VideoClassificationAnnotation classificationAnnotation. */ + public classificationAnnotation?: (google.cloud.automl.v1beta1.IClassificationAnnotation|null); + + /** VideoClassificationAnnotation timeSegment. */ + public timeSegment?: (google.cloud.automl.v1beta1.ITimeSegment|null); + + /** + * Creates a new VideoClassificationAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoClassificationAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IVideoClassificationAnnotation): google.cloud.automl.v1beta1.VideoClassificationAnnotation; + + /** + * Encodes the specified VideoClassificationAnnotation message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.IVideoClassificationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoClassificationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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 a ClassificationEvaluationMetrics. */ + interface IClassificationEvaluationMetrics { + + /** ClassificationEvaluationMetrics auPrc */ + auPrc?: (number|null); + + /** ClassificationEvaluationMetrics baseAuPrc */ + baseAuPrc?: (number|null); + + /** ClassificationEvaluationMetrics auRoc */ + auRoc?: (number|null); + + /** ClassificationEvaluationMetrics logLoss */ + logLoss?: (number|null); + + /** ClassificationEvaluationMetrics confidenceMetricsEntry */ + confidenceMetricsEntry?: (google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry[]|null); + + /** ClassificationEvaluationMetrics confusionMatrix */ + confusionMatrix?: (google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix|null); + + /** ClassificationEvaluationMetrics annotationSpecId */ + annotationSpecId?: (string[]|null); + } + + /** Represents a ClassificationEvaluationMetrics. */ + class ClassificationEvaluationMetrics implements IClassificationEvaluationMetrics { + + /** + * Constructs a new ClassificationEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IClassificationEvaluationMetrics); + + /** ClassificationEvaluationMetrics auPrc. */ + public auPrc: number; + + /** ClassificationEvaluationMetrics baseAuPrc. */ + public baseAuPrc: number; + + /** ClassificationEvaluationMetrics auRoc. */ + public auRoc: number; + + /** ClassificationEvaluationMetrics logLoss. */ + public logLoss: number; + + /** ClassificationEvaluationMetrics confidenceMetricsEntry. */ + public confidenceMetricsEntry: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry[]; + + /** ClassificationEvaluationMetrics confusionMatrix. */ + public confusionMatrix?: (google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix|null); + + /** ClassificationEvaluationMetrics annotationSpecId. */ + public annotationSpecId: string[]; + + /** + * Creates a new ClassificationEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassificationEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IClassificationEvaluationMetrics): google.cloud.automl.v1beta1.ClassificationEvaluationMetrics; + + /** + * Encodes the specified ClassificationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.verify|verify} messages. + * @param message ClassificationEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IClassificationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassificationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.verify|verify} messages. + * @param message ClassificationEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IClassificationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassificationEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassificationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ClassificationEvaluationMetrics; + + /** + * Decodes a ClassificationEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassificationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ClassificationEvaluationMetrics; + + /** + * Verifies a ClassificationEvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassificationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassificationEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ClassificationEvaluationMetrics; + + /** + * Creates a plain object from a ClassificationEvaluationMetrics message. Also converts values to other types if specified. + * @param message ClassificationEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassificationEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassificationEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ClassificationEvaluationMetrics { + + /** Properties of a ConfidenceMetricsEntry. */ + interface IConfidenceMetricsEntry { + + /** ConfidenceMetricsEntry confidenceThreshold */ + confidenceThreshold?: (number|null); + + /** ConfidenceMetricsEntry positionThreshold */ + positionThreshold?: (number|null); + + /** ConfidenceMetricsEntry recall */ + recall?: (number|null); + + /** ConfidenceMetricsEntry precision */ + precision?: (number|null); + + /** ConfidenceMetricsEntry falsePositiveRate */ + falsePositiveRate?: (number|null); + + /** ConfidenceMetricsEntry f1Score */ + f1Score?: (number|null); + + /** ConfidenceMetricsEntry recallAt1 */ + recallAt1?: (number|null); + + /** ConfidenceMetricsEntry precisionAt1 */ + precisionAt1?: (number|null); + + /** ConfidenceMetricsEntry falsePositiveRateAt1 */ + falsePositiveRateAt1?: (number|null); + + /** ConfidenceMetricsEntry f1ScoreAt1 */ + f1ScoreAt1?: (number|null); + + /** ConfidenceMetricsEntry truePositiveCount */ + truePositiveCount?: (number|Long|string|null); + + /** ConfidenceMetricsEntry falsePositiveCount */ + falsePositiveCount?: (number|Long|string|null); + + /** ConfidenceMetricsEntry falseNegativeCount */ + falseNegativeCount?: (number|Long|string|null); + + /** ConfidenceMetricsEntry trueNegativeCount */ + trueNegativeCount?: (number|Long|string|null); + } + + /** Represents a ConfidenceMetricsEntry. */ + class ConfidenceMetricsEntry implements IConfidenceMetricsEntry { + + /** + * Constructs a new ConfidenceMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry); + + /** ConfidenceMetricsEntry confidenceThreshold. */ + public confidenceThreshold: number; + + /** ConfidenceMetricsEntry positionThreshold. */ + public positionThreshold: number; + + /** ConfidenceMetricsEntry recall. */ + public recall: number; + + /** ConfidenceMetricsEntry precision. */ + public precision: number; + + /** ConfidenceMetricsEntry falsePositiveRate. */ + public falsePositiveRate: number; + + /** ConfidenceMetricsEntry f1Score. */ + public f1Score: number; + + /** ConfidenceMetricsEntry recallAt1. */ + public recallAt1: number; + + /** ConfidenceMetricsEntry precisionAt1. */ + public precisionAt1: number; + + /** ConfidenceMetricsEntry falsePositiveRateAt1. */ + public falsePositiveRateAt1: number; + + /** ConfidenceMetricsEntry f1ScoreAt1. */ + public f1ScoreAt1: number; + + /** ConfidenceMetricsEntry truePositiveCount. */ + public truePositiveCount: (number|Long|string); + + /** ConfidenceMetricsEntry falsePositiveCount. */ + public falsePositiveCount: (number|Long|string); + + /** ConfidenceMetricsEntry falseNegativeCount. */ + public falseNegativeCount: (number|Long|string); + + /** ConfidenceMetricsEntry trueNegativeCount. */ + public trueNegativeCount: (number|Long|string); + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidenceMetricsEntry instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry): google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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 annotationSpecId */ + annotationSpecId?: (string[]|null); + + /** ConfusionMatrix displayName */ + displayName?: (string[]|null); + + /** ConfusionMatrix row */ + row?: (google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow[]|null); + } + + /** Represents a ConfusionMatrix. */ + class ConfusionMatrix implements IConfusionMatrix { + + /** + * Constructs a new ConfusionMatrix. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix); + + /** ConfusionMatrix annotationSpecId. */ + public annotationSpecId: string[]; + + /** ConfusionMatrix displayName. */ + public displayName: string[]; + + /** ConfusionMatrix row. */ + public row: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix): google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix; + + /** + * Encodes the specified ConfusionMatrix message. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfusionMatrix message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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 Row. */ + interface IRow { + + /** Row exampleCount */ + exampleCount?: (number[]|null); + } + + /** Represents a Row. */ + class Row implements IRow { + + /** + * Constructs a new Row. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow); + + /** Row exampleCount. */ + public exampleCount: number[]; + + /** + * Creates a new Row instance using the specified properties. + * @param [properties] Properties to set + * @returns Row instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow): google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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 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.automl.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.automl.v1beta1.ITimeSegment): google.cloud.automl.v1beta1.TimeSegment; + + /** + * Encodes the specified TimeSegment message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.ITimeSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeSegment message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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 an ImageObjectDetectionAnnotation. */ + interface IImageObjectDetectionAnnotation { + + /** ImageObjectDetectionAnnotation boundingBox */ + boundingBox?: (google.cloud.automl.v1beta1.IBoundingPoly|null); + + /** ImageObjectDetectionAnnotation score */ + score?: (number|null); + } + + /** Represents an ImageObjectDetectionAnnotation. */ + class ImageObjectDetectionAnnotation implements IImageObjectDetectionAnnotation { + + /** + * Constructs a new ImageObjectDetectionAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation); + + /** ImageObjectDetectionAnnotation boundingBox. */ + public boundingBox?: (google.cloud.automl.v1beta1.IBoundingPoly|null); + + /** ImageObjectDetectionAnnotation score. */ + public score: number; + + /** + * Creates a new ImageObjectDetectionAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation): google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation; + + /** + * Encodes the specified ImageObjectDetectionAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.verify|verify} messages. + * @param message ImageObjectDetectionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.verify|verify} messages. + * @param message ImageObjectDetectionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation; + + /** + * Decodes an ImageObjectDetectionAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation; + + /** + * Verifies an ImageObjectDetectionAnnotation message. + * @param message Plain 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 ImageObjectDetectionAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation; + + /** + * Creates a plain object from an ImageObjectDetectionAnnotation message. Also converts values to other types if specified. + * @param message ImageObjectDetectionAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionAnnotation + * @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 instanceId */ + instanceId?: (string|null); + + /** VideoObjectTrackingAnnotation timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + + /** VideoObjectTrackingAnnotation boundingBox */ + boundingBox?: (google.cloud.automl.v1beta1.IBoundingPoly|null); + + /** VideoObjectTrackingAnnotation score */ + score?: (number|null); + } + + /** Represents a VideoObjectTrackingAnnotation. */ + class VideoObjectTrackingAnnotation implements IVideoObjectTrackingAnnotation { + + /** + * Constructs a new VideoObjectTrackingAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IVideoObjectTrackingAnnotation); + + /** VideoObjectTrackingAnnotation instanceId. */ + public instanceId: string; + + /** VideoObjectTrackingAnnotation timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** VideoObjectTrackingAnnotation boundingBox. */ + public boundingBox?: (google.cloud.automl.v1beta1.IBoundingPoly|null); + + /** VideoObjectTrackingAnnotation score. */ + public score: number; + + /** + * Creates a new VideoObjectTrackingAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoObjectTrackingAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IVideoObjectTrackingAnnotation): google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation; + + /** + * Encodes the specified VideoObjectTrackingAnnotation message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.IVideoObjectTrackingAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoObjectTrackingAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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 BoundingBoxMetricsEntry. */ + interface IBoundingBoxMetricsEntry { + + /** BoundingBoxMetricsEntry iouThreshold */ + iouThreshold?: (number|null); + + /** BoundingBoxMetricsEntry meanAveragePrecision */ + meanAveragePrecision?: (number|null); + + /** BoundingBoxMetricsEntry confidenceMetricsEntries */ + confidenceMetricsEntries?: (google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry[]|null); + } + + /** Represents a BoundingBoxMetricsEntry. */ + class BoundingBoxMetricsEntry implements IBoundingBoxMetricsEntry { + + /** + * Constructs a new BoundingBoxMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry); + + /** BoundingBoxMetricsEntry iouThreshold. */ + public iouThreshold: number; + + /** BoundingBoxMetricsEntry meanAveragePrecision. */ + public meanAveragePrecision: number; + + /** BoundingBoxMetricsEntry confidenceMetricsEntries. */ + public confidenceMetricsEntries: google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry[]; + + /** + * Creates a new BoundingBoxMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns BoundingBoxMetricsEntry instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry): google.cloud.automl.v1beta1.BoundingBoxMetricsEntry; + + /** + * Encodes the specified BoundingBoxMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.verify|verify} messages. + * @param message BoundingBoxMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingBoxMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.verify|verify} messages. + * @param message BoundingBoxMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoundingBoxMetricsEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoundingBoxMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.BoundingBoxMetricsEntry; + + /** + * Decodes a BoundingBoxMetricsEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoundingBoxMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.BoundingBoxMetricsEntry; + + /** + * Verifies a BoundingBoxMetricsEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoundingBoxMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoundingBoxMetricsEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BoundingBoxMetricsEntry; + + /** + * Creates a plain object from a BoundingBoxMetricsEntry message. Also converts values to other types if specified. + * @param message BoundingBoxMetricsEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.BoundingBoxMetricsEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoundingBoxMetricsEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoundingBoxMetricsEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BoundingBoxMetricsEntry { + + /** 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); + } + + /** Represents a ConfidenceMetricsEntry. */ + class ConfidenceMetricsEntry implements IConfidenceMetricsEntry { + + /** + * Constructs a new ConfidenceMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry); + + /** ConfidenceMetricsEntry confidenceThreshold. */ + public confidenceThreshold: number; + + /** ConfidenceMetricsEntry recall. */ + public recall: number; + + /** ConfidenceMetricsEntry precision. */ + public precision: number; + + /** ConfidenceMetricsEntry f1Score. */ + public f1Score: number; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidenceMetricsEntry instance + */ + public static create(properties?: google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry): google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.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.automl.v1beta1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.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.automl.v1beta1.BoundingBoxMetricsEntry.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.automl.v1beta1.BoundingBoxMetricsEntry.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.automl.v1beta1.BoundingBoxMetricsEntry.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.automl.v1beta1.BoundingBoxMetricsEntry.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.automl.v1beta1.BoundingBoxMetricsEntry.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 an ImageObjectDetectionEvaluationMetrics. */ + interface IImageObjectDetectionEvaluationMetrics { + + /** ImageObjectDetectionEvaluationMetrics evaluatedBoundingBoxCount */ + evaluatedBoundingBoxCount?: (number|null); + + /** ImageObjectDetectionEvaluationMetrics boundingBoxMetricsEntries */ + boundingBoxMetricsEntries?: (google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry[]|null); + + /** ImageObjectDetectionEvaluationMetrics boundingBoxMeanAveragePrecision */ + boundingBoxMeanAveragePrecision?: (number|null); + } + + /** Represents an ImageObjectDetectionEvaluationMetrics. */ + class ImageObjectDetectionEvaluationMetrics implements IImageObjectDetectionEvaluationMetrics { + + /** + * Constructs a new ImageObjectDetectionEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics); + + /** ImageObjectDetectionEvaluationMetrics evaluatedBoundingBoxCount. */ + public evaluatedBoundingBoxCount: number; + + /** ImageObjectDetectionEvaluationMetrics boundingBoxMetricsEntries. */ + public boundingBoxMetricsEntries: google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry[]; + + /** ImageObjectDetectionEvaluationMetrics boundingBoxMeanAveragePrecision. */ + public boundingBoxMeanAveragePrecision: number; + + /** + * Creates a new ImageObjectDetectionEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics): google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics; + + /** + * Encodes the specified ImageObjectDetectionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.verify|verify} messages. + * @param message ImageObjectDetectionEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.verify|verify} messages. + * @param message ImageObjectDetectionEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics; + + /** + * Decodes an ImageObjectDetectionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics; + + /** + * Verifies an ImageObjectDetectionEvaluationMetrics message. + * @param message Plain 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 ImageObjectDetectionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics; + + /** + * Creates a plain object from an ImageObjectDetectionEvaluationMetrics message. Also converts values to other types if specified. + * @param message ImageObjectDetectionEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoObjectTrackingEvaluationMetrics. */ + interface IVideoObjectTrackingEvaluationMetrics { + + /** VideoObjectTrackingEvaluationMetrics evaluatedFrameCount */ + evaluatedFrameCount?: (number|null); + + /** VideoObjectTrackingEvaluationMetrics evaluatedBoundingBoxCount */ + evaluatedBoundingBoxCount?: (number|null); + + /** VideoObjectTrackingEvaluationMetrics boundingBoxMetricsEntries */ + boundingBoxMetricsEntries?: (google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry[]|null); + + /** VideoObjectTrackingEvaluationMetrics boundingBoxMeanAveragePrecision */ + boundingBoxMeanAveragePrecision?: (number|null); + } + + /** Represents a VideoObjectTrackingEvaluationMetrics. */ + class VideoObjectTrackingEvaluationMetrics implements IVideoObjectTrackingEvaluationMetrics { + + /** + * Constructs a new VideoObjectTrackingEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics); + + /** VideoObjectTrackingEvaluationMetrics evaluatedFrameCount. */ + public evaluatedFrameCount: number; + + /** VideoObjectTrackingEvaluationMetrics evaluatedBoundingBoxCount. */ + public evaluatedBoundingBoxCount: number; + + /** VideoObjectTrackingEvaluationMetrics boundingBoxMetricsEntries. */ + public boundingBoxMetricsEntries: google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry[]; + + /** VideoObjectTrackingEvaluationMetrics boundingBoxMeanAveragePrecision. */ + public boundingBoxMeanAveragePrecision: number; + + /** + * Creates a new VideoObjectTrackingEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoObjectTrackingEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics): google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics; + + /** + * Encodes the specified VideoObjectTrackingEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.verify|verify} messages. + * @param message VideoObjectTrackingEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoObjectTrackingEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.verify|verify} messages. + * @param message VideoObjectTrackingEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoObjectTrackingEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoObjectTrackingEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics; + + /** + * Decodes a VideoObjectTrackingEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoObjectTrackingEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics; + + /** + * Verifies a VideoObjectTrackingEvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoObjectTrackingEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoObjectTrackingEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics; + + /** + * Creates a plain object from a VideoObjectTrackingEvaluationMetrics message. Also converts values to other types if specified. + * @param message VideoObjectTrackingEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoObjectTrackingEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoObjectTrackingEvaluationMetrics + * @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.automl.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.automl.v1beta1.INormalizedVertex): google.cloud.automl.v1beta1.NormalizedVertex; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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 normalizedVertices */ + normalizedVertices?: (google.cloud.automl.v1beta1.INormalizedVertex[]|null); + } + + /** Represents a BoundingPoly. */ + class BoundingPoly implements IBoundingPoly { + + /** + * Constructs a new BoundingPoly. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IBoundingPoly); + + /** BoundingPoly normalizedVertices. */ + public normalizedVertices: google.cloud.automl.v1beta1.INormalizedVertex[]; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @param [properties] Properties to set + * @returns BoundingPoly instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IBoundingPoly): google.cloud.automl.v1beta1.BoundingPoly; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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 TablesDatasetMetadata. */ + interface ITablesDatasetMetadata { + + /** TablesDatasetMetadata primaryTableSpecId */ + primaryTableSpecId?: (string|null); + + /** TablesDatasetMetadata targetColumnSpecId */ + targetColumnSpecId?: (string|null); + + /** TablesDatasetMetadata weightColumnSpecId */ + weightColumnSpecId?: (string|null); + + /** TablesDatasetMetadata mlUseColumnSpecId */ + mlUseColumnSpecId?: (string|null); + + /** TablesDatasetMetadata targetColumnCorrelations */ + targetColumnCorrelations?: ({ [k: string]: google.cloud.automl.v1beta1.ICorrelationStats }|null); + + /** TablesDatasetMetadata statsUpdateTime */ + statsUpdateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TablesDatasetMetadata. */ + class TablesDatasetMetadata implements ITablesDatasetMetadata { + + /** + * Constructs a new TablesDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITablesDatasetMetadata); + + /** TablesDatasetMetadata primaryTableSpecId. */ + public primaryTableSpecId: string; + + /** TablesDatasetMetadata targetColumnSpecId. */ + public targetColumnSpecId: string; + + /** TablesDatasetMetadata weightColumnSpecId. */ + public weightColumnSpecId: string; + + /** TablesDatasetMetadata mlUseColumnSpecId. */ + public mlUseColumnSpecId: string; + + /** TablesDatasetMetadata targetColumnCorrelations. */ + public targetColumnCorrelations: { [k: string]: google.cloud.automl.v1beta1.ICorrelationStats }; + + /** TablesDatasetMetadata statsUpdateTime. */ + public statsUpdateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TablesDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TablesDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITablesDatasetMetadata): google.cloud.automl.v1beta1.TablesDatasetMetadata; + + /** + * Encodes the specified TablesDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TablesDatasetMetadata.verify|verify} messages. + * @param message TablesDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITablesDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TablesDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TablesDatasetMetadata.verify|verify} messages. + * @param message TablesDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITablesDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TablesDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TablesDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TablesDatasetMetadata; + + /** + * Decodes a TablesDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TablesDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TablesDatasetMetadata; + + /** + * Verifies a TablesDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TablesDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TablesDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TablesDatasetMetadata; + + /** + * Creates a plain object from a TablesDatasetMetadata message. Also converts values to other types if specified. + * @param message TablesDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TablesDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TablesDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TablesDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TablesModelMetadata. */ + interface ITablesModelMetadata { + + /** TablesModelMetadata optimizationObjectiveRecallValue */ + optimizationObjectiveRecallValue?: (number|null); + + /** TablesModelMetadata optimizationObjectivePrecisionValue */ + optimizationObjectivePrecisionValue?: (number|null); + + /** TablesModelMetadata targetColumnSpec */ + targetColumnSpec?: (google.cloud.automl.v1beta1.IColumnSpec|null); + + /** TablesModelMetadata inputFeatureColumnSpecs */ + inputFeatureColumnSpecs?: (google.cloud.automl.v1beta1.IColumnSpec[]|null); + + /** TablesModelMetadata optimizationObjective */ + optimizationObjective?: (string|null); + + /** TablesModelMetadata tablesModelColumnInfo */ + tablesModelColumnInfo?: (google.cloud.automl.v1beta1.ITablesModelColumnInfo[]|null); + + /** TablesModelMetadata trainBudgetMilliNodeHours */ + trainBudgetMilliNodeHours?: (number|Long|string|null); + + /** TablesModelMetadata trainCostMilliNodeHours */ + trainCostMilliNodeHours?: (number|Long|string|null); + + /** TablesModelMetadata disableEarlyStopping */ + disableEarlyStopping?: (boolean|null); + } + + /** Represents a TablesModelMetadata. */ + class TablesModelMetadata implements ITablesModelMetadata { + + /** + * Constructs a new TablesModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITablesModelMetadata); + + /** TablesModelMetadata optimizationObjectiveRecallValue. */ + public optimizationObjectiveRecallValue?: (number|null); + + /** TablesModelMetadata optimizationObjectivePrecisionValue. */ + public optimizationObjectivePrecisionValue?: (number|null); + + /** TablesModelMetadata targetColumnSpec. */ + public targetColumnSpec?: (google.cloud.automl.v1beta1.IColumnSpec|null); + + /** TablesModelMetadata inputFeatureColumnSpecs. */ + public inputFeatureColumnSpecs: google.cloud.automl.v1beta1.IColumnSpec[]; + + /** TablesModelMetadata optimizationObjective. */ + public optimizationObjective: string; + + /** TablesModelMetadata tablesModelColumnInfo. */ + public tablesModelColumnInfo: google.cloud.automl.v1beta1.ITablesModelColumnInfo[]; + + /** TablesModelMetadata trainBudgetMilliNodeHours. */ + public trainBudgetMilliNodeHours: (number|Long|string); + + /** TablesModelMetadata trainCostMilliNodeHours. */ + public trainCostMilliNodeHours: (number|Long|string); + + /** TablesModelMetadata disableEarlyStopping. */ + public disableEarlyStopping: boolean; + + /** TablesModelMetadata additionalOptimizationObjectiveConfig. */ + public additionalOptimizationObjectiveConfig?: ("optimizationObjectiveRecallValue"|"optimizationObjectivePrecisionValue"); + + /** + * Creates a new TablesModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TablesModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITablesModelMetadata): google.cloud.automl.v1beta1.TablesModelMetadata; + + /** + * Encodes the specified TablesModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TablesModelMetadata.verify|verify} messages. + * @param message TablesModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITablesModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TablesModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TablesModelMetadata.verify|verify} messages. + * @param message TablesModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITablesModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TablesModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TablesModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TablesModelMetadata; + + /** + * Decodes a TablesModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TablesModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TablesModelMetadata; + + /** + * Verifies a TablesModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TablesModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TablesModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TablesModelMetadata; + + /** + * Creates a plain object from a TablesModelMetadata message. Also converts values to other types if specified. + * @param message TablesModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TablesModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TablesModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TablesModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TablesAnnotation. */ + interface ITablesAnnotation { + + /** TablesAnnotation score */ + score?: (number|null); + + /** TablesAnnotation predictionInterval */ + predictionInterval?: (google.cloud.automl.v1beta1.IDoubleRange|null); + + /** TablesAnnotation value */ + value?: (google.protobuf.IValue|null); + + /** TablesAnnotation tablesModelColumnInfo */ + tablesModelColumnInfo?: (google.cloud.automl.v1beta1.ITablesModelColumnInfo[]|null); + + /** TablesAnnotation baselineScore */ + baselineScore?: (number|null); + } + + /** Represents a TablesAnnotation. */ + class TablesAnnotation implements ITablesAnnotation { + + /** + * Constructs a new TablesAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITablesAnnotation); + + /** TablesAnnotation score. */ + public score: number; + + /** TablesAnnotation predictionInterval. */ + public predictionInterval?: (google.cloud.automl.v1beta1.IDoubleRange|null); + + /** TablesAnnotation value. */ + public value?: (google.protobuf.IValue|null); + + /** TablesAnnotation tablesModelColumnInfo. */ + public tablesModelColumnInfo: google.cloud.automl.v1beta1.ITablesModelColumnInfo[]; + + /** TablesAnnotation baselineScore. */ + public baselineScore: number; + + /** + * Creates a new TablesAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TablesAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITablesAnnotation): google.cloud.automl.v1beta1.TablesAnnotation; + + /** + * Encodes the specified TablesAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.TablesAnnotation.verify|verify} messages. + * @param message TablesAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITablesAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TablesAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TablesAnnotation.verify|verify} messages. + * @param message TablesAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITablesAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TablesAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TablesAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TablesAnnotation; + + /** + * Decodes a TablesAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TablesAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TablesAnnotation; + + /** + * Verifies a TablesAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TablesAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TablesAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TablesAnnotation; + + /** + * Creates a plain object from a TablesAnnotation message. Also converts values to other types if specified. + * @param message TablesAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TablesAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TablesAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TablesAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TablesModelColumnInfo. */ + interface ITablesModelColumnInfo { + + /** TablesModelColumnInfo columnSpecName */ + columnSpecName?: (string|null); + + /** TablesModelColumnInfo columnDisplayName */ + columnDisplayName?: (string|null); + + /** TablesModelColumnInfo featureImportance */ + featureImportance?: (number|null); + } + + /** Represents a TablesModelColumnInfo. */ + class TablesModelColumnInfo implements ITablesModelColumnInfo { + + /** + * Constructs a new TablesModelColumnInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITablesModelColumnInfo); + + /** TablesModelColumnInfo columnSpecName. */ + public columnSpecName: string; + + /** TablesModelColumnInfo columnDisplayName. */ + public columnDisplayName: string; + + /** TablesModelColumnInfo featureImportance. */ + public featureImportance: number; + + /** + * Creates a new TablesModelColumnInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns TablesModelColumnInfo instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITablesModelColumnInfo): google.cloud.automl.v1beta1.TablesModelColumnInfo; + + /** + * Encodes the specified TablesModelColumnInfo message. Does not implicitly {@link google.cloud.automl.v1beta1.TablesModelColumnInfo.verify|verify} messages. + * @param message TablesModelColumnInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITablesModelColumnInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TablesModelColumnInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TablesModelColumnInfo.verify|verify} messages. + * @param message TablesModelColumnInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITablesModelColumnInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TablesModelColumnInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TablesModelColumnInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TablesModelColumnInfo; + + /** + * Decodes a TablesModelColumnInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TablesModelColumnInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TablesModelColumnInfo; + + /** + * Verifies a TablesModelColumnInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TablesModelColumnInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TablesModelColumnInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TablesModelColumnInfo; + + /** + * Creates a plain object from a TablesModelColumnInfo message. Also converts values to other types if specified. + * @param message TablesModelColumnInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TablesModelColumnInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TablesModelColumnInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TablesModelColumnInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ColumnSpec. */ + interface IColumnSpec { + + /** ColumnSpec name */ + name?: (string|null); + + /** ColumnSpec dataType */ + dataType?: (google.cloud.automl.v1beta1.IDataType|null); + + /** ColumnSpec displayName */ + displayName?: (string|null); + + /** ColumnSpec dataStats */ + dataStats?: (google.cloud.automl.v1beta1.IDataStats|null); + + /** ColumnSpec topCorrelatedColumns */ + topCorrelatedColumns?: (google.cloud.automl.v1beta1.ColumnSpec.ICorrelatedColumn[]|null); + + /** ColumnSpec etag */ + etag?: (string|null); + } + + /** Represents a ColumnSpec. */ + class ColumnSpec implements IColumnSpec { + + /** + * Constructs a new ColumnSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IColumnSpec); + + /** ColumnSpec name. */ + public name: string; + + /** ColumnSpec dataType. */ + public dataType?: (google.cloud.automl.v1beta1.IDataType|null); + + /** ColumnSpec displayName. */ + public displayName: string; + + /** ColumnSpec dataStats. */ + public dataStats?: (google.cloud.automl.v1beta1.IDataStats|null); + + /** ColumnSpec topCorrelatedColumns. */ + public topCorrelatedColumns: google.cloud.automl.v1beta1.ColumnSpec.ICorrelatedColumn[]; + + /** ColumnSpec etag. */ + public etag: string; + + /** + * Creates a new ColumnSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ColumnSpec instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IColumnSpec): google.cloud.automl.v1beta1.ColumnSpec; + + /** + * Encodes the specified ColumnSpec message. Does not implicitly {@link google.cloud.automl.v1beta1.ColumnSpec.verify|verify} messages. + * @param message ColumnSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IColumnSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColumnSpec message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ColumnSpec.verify|verify} messages. + * @param message ColumnSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IColumnSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColumnSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColumnSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ColumnSpec; + + /** + * Decodes a ColumnSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColumnSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ColumnSpec; + + /** + * Verifies a ColumnSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColumnSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColumnSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ColumnSpec; + + /** + * Creates a plain object from a ColumnSpec message. Also converts values to other types if specified. + * @param message ColumnSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ColumnSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColumnSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ColumnSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ColumnSpec { + + /** Properties of a CorrelatedColumn. */ + interface ICorrelatedColumn { + + /** CorrelatedColumn columnSpecId */ + columnSpecId?: (string|null); + + /** CorrelatedColumn correlationStats */ + correlationStats?: (google.cloud.automl.v1beta1.ICorrelationStats|null); + } + + /** Represents a CorrelatedColumn. */ + class CorrelatedColumn implements ICorrelatedColumn { + + /** + * Constructs a new CorrelatedColumn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ColumnSpec.ICorrelatedColumn); + + /** CorrelatedColumn columnSpecId. */ + public columnSpecId: string; + + /** CorrelatedColumn correlationStats. */ + public correlationStats?: (google.cloud.automl.v1beta1.ICorrelationStats|null); + + /** + * Creates a new CorrelatedColumn instance using the specified properties. + * @param [properties] Properties to set + * @returns CorrelatedColumn instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ColumnSpec.ICorrelatedColumn): google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn; + + /** + * Encodes the specified CorrelatedColumn message. Does not implicitly {@link google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.verify|verify} messages. + * @param message CorrelatedColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ColumnSpec.ICorrelatedColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CorrelatedColumn message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.verify|verify} messages. + * @param message CorrelatedColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ColumnSpec.ICorrelatedColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CorrelatedColumn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CorrelatedColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn; + + /** + * Decodes a CorrelatedColumn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CorrelatedColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn; + + /** + * Verifies a CorrelatedColumn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CorrelatedColumn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CorrelatedColumn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn; + + /** + * Creates a plain object from a CorrelatedColumn message. Also converts values to other types if specified. + * @param message CorrelatedColumn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CorrelatedColumn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CorrelatedColumn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a DataStats. */ + interface IDataStats { + + /** DataStats float64Stats */ + float64Stats?: (google.cloud.automl.v1beta1.IFloat64Stats|null); + + /** DataStats stringStats */ + stringStats?: (google.cloud.automl.v1beta1.IStringStats|null); + + /** DataStats timestampStats */ + timestampStats?: (google.cloud.automl.v1beta1.ITimestampStats|null); + + /** DataStats arrayStats */ + arrayStats?: (google.cloud.automl.v1beta1.IArrayStats|null); + + /** DataStats structStats */ + structStats?: (google.cloud.automl.v1beta1.IStructStats|null); + + /** DataStats categoryStats */ + categoryStats?: (google.cloud.automl.v1beta1.ICategoryStats|null); + + /** DataStats distinctValueCount */ + distinctValueCount?: (number|Long|string|null); + + /** DataStats nullValueCount */ + nullValueCount?: (number|Long|string|null); + + /** DataStats validValueCount */ + validValueCount?: (number|Long|string|null); + } + + /** Represents a DataStats. */ + class DataStats implements IDataStats { + + /** + * Constructs a new DataStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDataStats); + + /** DataStats float64Stats. */ + public float64Stats?: (google.cloud.automl.v1beta1.IFloat64Stats|null); + + /** DataStats stringStats. */ + public stringStats?: (google.cloud.automl.v1beta1.IStringStats|null); + + /** DataStats timestampStats. */ + public timestampStats?: (google.cloud.automl.v1beta1.ITimestampStats|null); + + /** DataStats arrayStats. */ + public arrayStats?: (google.cloud.automl.v1beta1.IArrayStats|null); + + /** DataStats structStats. */ + public structStats?: (google.cloud.automl.v1beta1.IStructStats|null); + + /** DataStats categoryStats. */ + public categoryStats?: (google.cloud.automl.v1beta1.ICategoryStats|null); + + /** DataStats distinctValueCount. */ + public distinctValueCount: (number|Long|string); + + /** DataStats nullValueCount. */ + public nullValueCount: (number|Long|string); + + /** DataStats validValueCount. */ + public validValueCount: (number|Long|string); + + /** DataStats stats. */ + public stats?: ("float64Stats"|"stringStats"|"timestampStats"|"arrayStats"|"structStats"|"categoryStats"); + + /** + * Creates a new DataStats instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDataStats): google.cloud.automl.v1beta1.DataStats; + + /** + * Encodes the specified DataStats message. Does not implicitly {@link google.cloud.automl.v1beta1.DataStats.verify|verify} messages. + * @param message DataStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDataStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DataStats.verify|verify} messages. + * @param message DataStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDataStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.DataStats; + + /** + * Decodes a DataStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.DataStats; + + /** + * Verifies a DataStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.DataStats; + + /** + * Creates a plain object from a DataStats message. Also converts values to other types if specified. + * @param message DataStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.DataStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Float64Stats. */ + interface IFloat64Stats { + + /** Float64Stats mean */ + mean?: (number|null); + + /** Float64Stats standardDeviation */ + standardDeviation?: (number|null); + + /** Float64Stats quantiles */ + quantiles?: (number[]|null); + + /** Float64Stats histogramBuckets */ + histogramBuckets?: (google.cloud.automl.v1beta1.Float64Stats.IHistogramBucket[]|null); + } + + /** Represents a Float64Stats. */ + class Float64Stats implements IFloat64Stats { + + /** + * Constructs a new Float64Stats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IFloat64Stats); + + /** Float64Stats mean. */ + public mean: number; + + /** Float64Stats standardDeviation. */ + public standardDeviation: number; + + /** Float64Stats quantiles. */ + public quantiles: number[]; + + /** Float64Stats histogramBuckets. */ + public histogramBuckets: google.cloud.automl.v1beta1.Float64Stats.IHistogramBucket[]; + + /** + * Creates a new Float64Stats instance using the specified properties. + * @param [properties] Properties to set + * @returns Float64Stats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IFloat64Stats): google.cloud.automl.v1beta1.Float64Stats; + + /** + * Encodes the specified Float64Stats message. Does not implicitly {@link google.cloud.automl.v1beta1.Float64Stats.verify|verify} messages. + * @param message Float64Stats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IFloat64Stats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Float64Stats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Float64Stats.verify|verify} messages. + * @param message Float64Stats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IFloat64Stats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Float64Stats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Float64Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.Float64Stats; + + /** + * Decodes a Float64Stats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Float64Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.Float64Stats; + + /** + * Verifies a Float64Stats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Float64Stats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Float64Stats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.Float64Stats; + + /** + * Creates a plain object from a Float64Stats message. Also converts values to other types if specified. + * @param message Float64Stats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.Float64Stats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Float64Stats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Float64Stats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Float64Stats { + + /** Properties of a HistogramBucket. */ + interface IHistogramBucket { + + /** HistogramBucket min */ + min?: (number|null); + + /** HistogramBucket max */ + max?: (number|null); + + /** HistogramBucket count */ + count?: (number|Long|string|null); + } + + /** Represents a HistogramBucket. */ + class HistogramBucket implements IHistogramBucket { + + /** + * Constructs a new HistogramBucket. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.Float64Stats.IHistogramBucket); + + /** HistogramBucket min. */ + public min: number; + + /** HistogramBucket max. */ + public max: number; + + /** HistogramBucket count. */ + public count: (number|Long|string); + + /** + * Creates a new HistogramBucket instance using the specified properties. + * @param [properties] Properties to set + * @returns HistogramBucket instance + */ + public static create(properties?: google.cloud.automl.v1beta1.Float64Stats.IHistogramBucket): google.cloud.automl.v1beta1.Float64Stats.HistogramBucket; + + /** + * Encodes the specified HistogramBucket message. Does not implicitly {@link google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.verify|verify} messages. + * @param message HistogramBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.Float64Stats.IHistogramBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HistogramBucket message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.verify|verify} messages. + * @param message HistogramBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.Float64Stats.IHistogramBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HistogramBucket message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HistogramBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.Float64Stats.HistogramBucket; + + /** + * Decodes a HistogramBucket message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HistogramBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.Float64Stats.HistogramBucket; + + /** + * Verifies a HistogramBucket message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HistogramBucket message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HistogramBucket + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.Float64Stats.HistogramBucket; + + /** + * Creates a plain object from a HistogramBucket message. Also converts values to other types if specified. + * @param message HistogramBucket + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.Float64Stats.HistogramBucket, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HistogramBucket to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HistogramBucket + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a StringStats. */ + interface IStringStats { + + /** StringStats topUnigramStats */ + topUnigramStats?: (google.cloud.automl.v1beta1.StringStats.IUnigramStats[]|null); + } + + /** Represents a StringStats. */ + class StringStats implements IStringStats { + + /** + * Constructs a new StringStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IStringStats); + + /** StringStats topUnigramStats. */ + public topUnigramStats: google.cloud.automl.v1beta1.StringStats.IUnigramStats[]; + + /** + * Creates a new StringStats instance using the specified properties. + * @param [properties] Properties to set + * @returns StringStats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IStringStats): google.cloud.automl.v1beta1.StringStats; + + /** + * Encodes the specified StringStats message. Does not implicitly {@link google.cloud.automl.v1beta1.StringStats.verify|verify} messages. + * @param message StringStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IStringStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.StringStats.verify|verify} messages. + * @param message StringStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IStringStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.StringStats; + + /** + * Decodes a StringStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.StringStats; + + /** + * Verifies a StringStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.StringStats; + + /** + * Creates a plain object from a StringStats message. Also converts values to other types if specified. + * @param message StringStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.StringStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StringStats { + + /** Properties of an UnigramStats. */ + interface IUnigramStats { + + /** UnigramStats value */ + value?: (string|null); + + /** UnigramStats count */ + count?: (number|Long|string|null); + } + + /** Represents an UnigramStats. */ + class UnigramStats implements IUnigramStats { + + /** + * Constructs a new UnigramStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.StringStats.IUnigramStats); + + /** UnigramStats value. */ + public value: string; + + /** UnigramStats count. */ + public count: (number|Long|string); + + /** + * Creates a new UnigramStats instance using the specified properties. + * @param [properties] Properties to set + * @returns UnigramStats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.StringStats.IUnigramStats): google.cloud.automl.v1beta1.StringStats.UnigramStats; + + /** + * Encodes the specified UnigramStats message. Does not implicitly {@link google.cloud.automl.v1beta1.StringStats.UnigramStats.verify|verify} messages. + * @param message UnigramStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.StringStats.IUnigramStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UnigramStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.StringStats.UnigramStats.verify|verify} messages. + * @param message UnigramStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.StringStats.IUnigramStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UnigramStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UnigramStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.StringStats.UnigramStats; + + /** + * Decodes an UnigramStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UnigramStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.StringStats.UnigramStats; + + /** + * Verifies an UnigramStats message. + * @param message Plain 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 UnigramStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UnigramStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.StringStats.UnigramStats; + + /** + * Creates a plain object from an UnigramStats message. Also converts values to other types if specified. + * @param message UnigramStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.StringStats.UnigramStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UnigramStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UnigramStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TimestampStats. */ + interface ITimestampStats { + + /** TimestampStats granularStats */ + granularStats?: ({ [k: string]: google.cloud.automl.v1beta1.TimestampStats.IGranularStats }|null); + } + + /** Represents a TimestampStats. */ + class TimestampStats implements ITimestampStats { + + /** + * Constructs a new TimestampStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITimestampStats); + + /** TimestampStats granularStats. */ + public granularStats: { [k: string]: google.cloud.automl.v1beta1.TimestampStats.IGranularStats }; + + /** + * Creates a new TimestampStats instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampStats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITimestampStats): google.cloud.automl.v1beta1.TimestampStats; + + /** + * Encodes the specified TimestampStats message. Does not implicitly {@link google.cloud.automl.v1beta1.TimestampStats.verify|verify} messages. + * @param message TimestampStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITimestampStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimestampStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TimestampStats.verify|verify} messages. + * @param message TimestampStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITimestampStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimestampStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TimestampStats; + + /** + * Decodes a TimestampStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimestampStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TimestampStats; + + /** + * Verifies a TimestampStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimestampStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimestampStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TimestampStats; + + /** + * Creates a plain object from a TimestampStats message. Also converts values to other types if specified. + * @param message TimestampStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TimestampStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimestampStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimestampStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TimestampStats { + + /** Properties of a GranularStats. */ + interface IGranularStats { + + /** GranularStats buckets */ + buckets?: ({ [k: string]: (number|Long|string) }|null); + } + + /** Represents a GranularStats. */ + class GranularStats implements IGranularStats { + + /** + * Constructs a new GranularStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.TimestampStats.IGranularStats); + + /** GranularStats buckets. */ + public buckets: { [k: string]: (number|Long|string) }; + + /** + * Creates a new GranularStats instance using the specified properties. + * @param [properties] Properties to set + * @returns GranularStats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.TimestampStats.IGranularStats): google.cloud.automl.v1beta1.TimestampStats.GranularStats; + + /** + * Encodes the specified GranularStats message. Does not implicitly {@link google.cloud.automl.v1beta1.TimestampStats.GranularStats.verify|verify} messages. + * @param message GranularStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.TimestampStats.IGranularStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GranularStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TimestampStats.GranularStats.verify|verify} messages. + * @param message GranularStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.TimestampStats.IGranularStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GranularStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GranularStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TimestampStats.GranularStats; + + /** + * Decodes a GranularStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GranularStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TimestampStats.GranularStats; + + /** + * Verifies a GranularStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GranularStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GranularStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TimestampStats.GranularStats; + + /** + * Creates a plain object from a GranularStats message. Also converts values to other types if specified. + * @param message GranularStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TimestampStats.GranularStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GranularStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GranularStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ArrayStats. */ + interface IArrayStats { + + /** ArrayStats memberStats */ + memberStats?: (google.cloud.automl.v1beta1.IDataStats|null); + } + + /** Represents an ArrayStats. */ + class ArrayStats implements IArrayStats { + + /** + * Constructs a new ArrayStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IArrayStats); + + /** ArrayStats memberStats. */ + public memberStats?: (google.cloud.automl.v1beta1.IDataStats|null); + + /** + * Creates a new ArrayStats instance using the specified properties. + * @param [properties] Properties to set + * @returns ArrayStats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IArrayStats): google.cloud.automl.v1beta1.ArrayStats; + + /** + * Encodes the specified ArrayStats message. Does not implicitly {@link google.cloud.automl.v1beta1.ArrayStats.verify|verify} messages. + * @param message ArrayStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IArrayStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ArrayStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ArrayStats.verify|verify} messages. + * @param message ArrayStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IArrayStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArrayStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArrayStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ArrayStats; + + /** + * Decodes an ArrayStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArrayStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ArrayStats; + + /** + * Verifies an ArrayStats message. + * @param message Plain 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 ArrayStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ArrayStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ArrayStats; + + /** + * Creates a plain object from an ArrayStats message. Also converts values to other types if specified. + * @param message ArrayStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ArrayStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ArrayStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ArrayStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StructStats. */ + interface IStructStats { + + /** StructStats fieldStats */ + fieldStats?: ({ [k: string]: google.cloud.automl.v1beta1.IDataStats }|null); + } + + /** Represents a StructStats. */ + class StructStats implements IStructStats { + + /** + * Constructs a new StructStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IStructStats); + + /** StructStats fieldStats. */ + public fieldStats: { [k: string]: google.cloud.automl.v1beta1.IDataStats }; + + /** + * Creates a new StructStats instance using the specified properties. + * @param [properties] Properties to set + * @returns StructStats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IStructStats): google.cloud.automl.v1beta1.StructStats; + + /** + * Encodes the specified StructStats message. Does not implicitly {@link google.cloud.automl.v1beta1.StructStats.verify|verify} messages. + * @param message StructStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IStructStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StructStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.StructStats.verify|verify} messages. + * @param message StructStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IStructStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StructStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StructStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.StructStats; + + /** + * Decodes a StructStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StructStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.StructStats; + + /** + * Verifies a StructStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StructStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StructStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.StructStats; + + /** + * Creates a plain object from a StructStats message. Also converts values to other types if specified. + * @param message StructStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.StructStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StructStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StructStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CategoryStats. */ + interface ICategoryStats { + + /** CategoryStats topCategoryStats */ + topCategoryStats?: (google.cloud.automl.v1beta1.CategoryStats.ISingleCategoryStats[]|null); + } + + /** Represents a CategoryStats. */ + class CategoryStats implements ICategoryStats { + + /** + * Constructs a new CategoryStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ICategoryStats); + + /** CategoryStats topCategoryStats. */ + public topCategoryStats: google.cloud.automl.v1beta1.CategoryStats.ISingleCategoryStats[]; + + /** + * Creates a new CategoryStats instance using the specified properties. + * @param [properties] Properties to set + * @returns CategoryStats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ICategoryStats): google.cloud.automl.v1beta1.CategoryStats; + + /** + * Encodes the specified CategoryStats message. Does not implicitly {@link google.cloud.automl.v1beta1.CategoryStats.verify|verify} messages. + * @param message CategoryStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ICategoryStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CategoryStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CategoryStats.verify|verify} messages. + * @param message CategoryStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ICategoryStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CategoryStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CategoryStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.CategoryStats; + + /** + * Decodes a CategoryStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CategoryStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.CategoryStats; + + /** + * Verifies a CategoryStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CategoryStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CategoryStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.CategoryStats; + + /** + * Creates a plain object from a CategoryStats message. Also converts values to other types if specified. + * @param message CategoryStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.CategoryStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CategoryStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CategoryStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CategoryStats { + + /** Properties of a SingleCategoryStats. */ + interface ISingleCategoryStats { + + /** SingleCategoryStats value */ + value?: (string|null); + + /** SingleCategoryStats count */ + count?: (number|Long|string|null); + } + + /** Represents a SingleCategoryStats. */ + class SingleCategoryStats implements ISingleCategoryStats { + + /** + * Constructs a new SingleCategoryStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.CategoryStats.ISingleCategoryStats); + + /** SingleCategoryStats value. */ + public value: string; + + /** SingleCategoryStats count. */ + public count: (number|Long|string); + + /** + * Creates a new SingleCategoryStats instance using the specified properties. + * @param [properties] Properties to set + * @returns SingleCategoryStats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.CategoryStats.ISingleCategoryStats): google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats; + + /** + * Encodes the specified SingleCategoryStats message. Does not implicitly {@link google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.verify|verify} messages. + * @param message SingleCategoryStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.CategoryStats.ISingleCategoryStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SingleCategoryStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.verify|verify} messages. + * @param message SingleCategoryStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.CategoryStats.ISingleCategoryStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SingleCategoryStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SingleCategoryStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats; + + /** + * Decodes a SingleCategoryStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SingleCategoryStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats; + + /** + * Verifies a SingleCategoryStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SingleCategoryStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SingleCategoryStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats; + + /** + * Creates a plain object from a SingleCategoryStats message. Also converts values to other types if specified. + * @param message SingleCategoryStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SingleCategoryStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SingleCategoryStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CorrelationStats. */ + interface ICorrelationStats { + + /** CorrelationStats cramersV */ + cramersV?: (number|null); + } + + /** Represents a CorrelationStats. */ + class CorrelationStats implements ICorrelationStats { + + /** + * Constructs a new CorrelationStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ICorrelationStats); + + /** CorrelationStats cramersV. */ + public cramersV: number; + + /** + * Creates a new CorrelationStats instance using the specified properties. + * @param [properties] Properties to set + * @returns CorrelationStats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ICorrelationStats): google.cloud.automl.v1beta1.CorrelationStats; + + /** + * Encodes the specified CorrelationStats message. Does not implicitly {@link google.cloud.automl.v1beta1.CorrelationStats.verify|verify} messages. + * @param message CorrelationStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ICorrelationStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CorrelationStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CorrelationStats.verify|verify} messages. + * @param message CorrelationStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ICorrelationStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CorrelationStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CorrelationStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.CorrelationStats; + + /** + * Decodes a CorrelationStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CorrelationStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.CorrelationStats; + + /** + * Verifies a CorrelationStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CorrelationStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CorrelationStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.CorrelationStats; + + /** + * Creates a plain object from a CorrelationStats message. Also converts values to other types if specified. + * @param message CorrelationStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.CorrelationStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CorrelationStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CorrelationStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** TypeCode enum. */ + enum TypeCode { + TYPE_CODE_UNSPECIFIED = 0, + FLOAT64 = 3, + TIMESTAMP = 4, + STRING = 6, + ARRAY = 8, + STRUCT = 9, + CATEGORY = 10 + } + + /** Properties of a DataType. */ + interface IDataType { + + /** DataType listElementType */ + listElementType?: (google.cloud.automl.v1beta1.IDataType|null); + + /** DataType structType */ + structType?: (google.cloud.automl.v1beta1.IStructType|null); + + /** DataType timeFormat */ + timeFormat?: (string|null); + + /** DataType typeCode */ + typeCode?: (google.cloud.automl.v1beta1.TypeCode|keyof typeof google.cloud.automl.v1beta1.TypeCode|null); + + /** DataType nullable */ + nullable?: (boolean|null); + } + + /** Represents a DataType. */ + class DataType implements IDataType { + + /** + * Constructs a new DataType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDataType); + + /** DataType listElementType. */ + public listElementType?: (google.cloud.automl.v1beta1.IDataType|null); + + /** DataType structType. */ + public structType?: (google.cloud.automl.v1beta1.IStructType|null); + + /** DataType timeFormat. */ + public timeFormat?: (string|null); + + /** DataType typeCode. */ + public typeCode: (google.cloud.automl.v1beta1.TypeCode|keyof typeof google.cloud.automl.v1beta1.TypeCode); + + /** DataType nullable. */ + public nullable: boolean; + + /** DataType details. */ + public details?: ("listElementType"|"structType"|"timeFormat"); + + /** + * Creates a new DataType instance using the specified properties. + * @param [properties] Properties to set + * @returns DataType instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDataType): google.cloud.automl.v1beta1.DataType; + + /** + * Encodes the specified DataType message. Does not implicitly {@link google.cloud.automl.v1beta1.DataType.verify|verify} messages. + * @param message DataType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDataType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataType message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DataType.verify|verify} messages. + * @param message DataType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDataType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.DataType; + + /** + * Decodes a DataType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.DataType; + + /** + * Verifies a DataType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.DataType; + + /** + * Creates a plain object from a DataType message. Also converts values to other types if specified. + * @param message DataType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.DataType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StructType. */ + interface IStructType { + + /** StructType fields */ + fields?: ({ [k: string]: google.cloud.automl.v1beta1.IDataType }|null); + } + + /** Represents a StructType. */ + class StructType implements IStructType { + + /** + * Constructs a new StructType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IStructType); + + /** StructType fields. */ + public fields: { [k: string]: google.cloud.automl.v1beta1.IDataType }; + + /** + * Creates a new StructType instance using the specified properties. + * @param [properties] Properties to set + * @returns StructType instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IStructType): google.cloud.automl.v1beta1.StructType; + + /** + * Encodes the specified StructType message. Does not implicitly {@link google.cloud.automl.v1beta1.StructType.verify|verify} messages. + * @param message StructType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IStructType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StructType message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.StructType.verify|verify} messages. + * @param message StructType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IStructType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StructType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.StructType; + + /** + * Decodes a StructType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.StructType; + + /** + * Verifies a StructType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StructType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StructType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.StructType; + + /** + * Creates a plain object from a StructType message. Also converts values to other types if specified. + * @param message StructType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.StructType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StructType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StructType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Image. */ + interface IImage { + + /** Image imageBytes */ + imageBytes?: (Uint8Array|string|null); + + /** Image inputConfig */ + inputConfig?: (google.cloud.automl.v1beta1.IInputConfig|null); + + /** Image thumbnailUri */ + thumbnailUri?: (string|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImage); + + /** Image imageBytes. */ + public imageBytes?: (Uint8Array|string|null); + + /** Image inputConfig. */ + public inputConfig?: (google.cloud.automl.v1beta1.IInputConfig|null); + + /** Image thumbnailUri. */ + public thumbnailUri: string; + + /** Image data. */ + public data?: ("imageBytes"|"inputConfig"); + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImage): google.cloud.automl.v1beta1.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.automl.v1beta1.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Image message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.Image; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.Image; + + /** + * Verifies an Image message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Image + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.Image; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @param message Image + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Image + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSnippet. */ + interface ITextSnippet { + + /** TextSnippet content */ + content?: (string|null); + + /** TextSnippet mimeType */ + mimeType?: (string|null); + + /** TextSnippet contentUri */ + contentUri?: (string|null); + } + + /** Represents a TextSnippet. */ + class TextSnippet implements ITextSnippet { + + /** + * Constructs a new TextSnippet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextSnippet); + + /** TextSnippet content. */ + public content: string; + + /** TextSnippet mimeType. */ + public mimeType: string; + + /** TextSnippet contentUri. */ + public contentUri: string; + + /** + * Creates a new TextSnippet instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSnippet instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextSnippet): google.cloud.automl.v1beta1.TextSnippet; + + /** + * Encodes the specified TextSnippet message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSnippet.verify|verify} messages. + * @param message TextSnippet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextSnippet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSnippet message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSnippet.verify|verify} messages. + * @param message TextSnippet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextSnippet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSnippet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TextSnippet; + + /** + * Decodes a TextSnippet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TextSnippet; + + /** + * Verifies a TextSnippet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSnippet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSnippet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextSnippet; + + /** + * Creates a plain object from a TextSnippet message. Also converts values to other types if specified. + * @param message TextSnippet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextSnippet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSnippet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSnippet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DocumentDimensions. */ + interface IDocumentDimensions { + + /** DocumentDimensions unit */ + unit?: (google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit|keyof typeof google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit|null); + + /** DocumentDimensions width */ + width?: (number|null); + + /** DocumentDimensions height */ + height?: (number|null); + } + + /** Represents a DocumentDimensions. */ + class DocumentDimensions implements IDocumentDimensions { + + /** + * Constructs a new DocumentDimensions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDocumentDimensions); + + /** DocumentDimensions unit. */ + public unit: (google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit|keyof typeof google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit); + + /** DocumentDimensions width. */ + public width: number; + + /** DocumentDimensions height. */ + public height: number; + + /** + * Creates a new DocumentDimensions instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentDimensions instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDocumentDimensions): google.cloud.automl.v1beta1.DocumentDimensions; + + /** + * Encodes the specified DocumentDimensions message. Does not implicitly {@link google.cloud.automl.v1beta1.DocumentDimensions.verify|verify} messages. + * @param message DocumentDimensions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDocumentDimensions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentDimensions message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DocumentDimensions.verify|verify} messages. + * @param message DocumentDimensions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDocumentDimensions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentDimensions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentDimensions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.DocumentDimensions; + + /** + * Decodes a DocumentDimensions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentDimensions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.DocumentDimensions; + + /** + * Verifies a DocumentDimensions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DocumentDimensions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentDimensions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.DocumentDimensions; + + /** + * Creates a plain object from a DocumentDimensions message. Also converts values to other types if specified. + * @param message DocumentDimensions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.DocumentDimensions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentDimensions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentDimensions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DocumentDimensions { + + /** DocumentDimensionUnit enum. */ + enum DocumentDimensionUnit { + DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0, + INCH = 1, + CENTIMETER = 2, + POINT = 3 + } + } + + /** Properties of a Document. */ + interface IDocument { + + /** Document inputConfig */ + inputConfig?: (google.cloud.automl.v1beta1.IDocumentInputConfig|null); + + /** Document documentText */ + documentText?: (google.cloud.automl.v1beta1.ITextSnippet|null); + + /** Document layout */ + layout?: (google.cloud.automl.v1beta1.Document.ILayout[]|null); + + /** Document documentDimensions */ + documentDimensions?: (google.cloud.automl.v1beta1.IDocumentDimensions|null); + + /** Document pageCount */ + pageCount?: (number|null); + } + + /** Represents a Document. */ + class Document implements IDocument { + + /** + * Constructs a new Document. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDocument); + + /** Document inputConfig. */ + public inputConfig?: (google.cloud.automl.v1beta1.IDocumentInputConfig|null); + + /** Document documentText. */ + public documentText?: (google.cloud.automl.v1beta1.ITextSnippet|null); + + /** Document layout. */ + public layout: google.cloud.automl.v1beta1.Document.ILayout[]; + + /** Document documentDimensions. */ + public documentDimensions?: (google.cloud.automl.v1beta1.IDocumentDimensions|null); + + /** Document pageCount. */ + public pageCount: number; + + /** + * Creates a new Document instance using the specified properties. + * @param [properties] Properties to set + * @returns Document instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDocument): google.cloud.automl.v1beta1.Document; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.automl.v1beta1.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Document message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.Document; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.Document; + + /** + * Verifies a Document message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Document + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.Document; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @param message Document + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Document to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Document + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Document { + + /** Properties of a Layout. */ + interface ILayout { + + /** Layout textSegment */ + textSegment?: (google.cloud.automl.v1beta1.ITextSegment|null); + + /** Layout pageNumber */ + pageNumber?: (number|null); + + /** Layout boundingPoly */ + boundingPoly?: (google.cloud.automl.v1beta1.IBoundingPoly|null); + + /** Layout textSegmentType */ + textSegmentType?: (google.cloud.automl.v1beta1.Document.Layout.TextSegmentType|keyof typeof google.cloud.automl.v1beta1.Document.Layout.TextSegmentType|null); + } + + /** Represents a Layout. */ + class Layout implements ILayout { + + /** + * Constructs a new Layout. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.Document.ILayout); + + /** Layout textSegment. */ + public textSegment?: (google.cloud.automl.v1beta1.ITextSegment|null); + + /** Layout pageNumber. */ + public pageNumber: number; + + /** Layout boundingPoly. */ + public boundingPoly?: (google.cloud.automl.v1beta1.IBoundingPoly|null); + + /** Layout textSegmentType. */ + public textSegmentType: (google.cloud.automl.v1beta1.Document.Layout.TextSegmentType|keyof typeof google.cloud.automl.v1beta1.Document.Layout.TextSegmentType); + + /** + * Creates a new Layout instance using the specified properties. + * @param [properties] Properties to set + * @returns Layout instance + */ + public static create(properties?: google.cloud.automl.v1beta1.Document.ILayout): google.cloud.automl.v1beta1.Document.Layout; + + /** + * Encodes the specified Layout message. Does not implicitly {@link google.cloud.automl.v1beta1.Document.Layout.verify|verify} messages. + * @param message Layout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.Document.ILayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Layout message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Document.Layout.verify|verify} messages. + * @param message Layout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.Document.ILayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Layout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Layout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.Document.Layout; + + /** + * Decodes a Layout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Layout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.Document.Layout; + + /** + * Verifies a Layout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Layout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Layout + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.Document.Layout; + + /** + * Creates a plain object from a Layout message. Also converts values to other types if specified. + * @param message Layout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.Document.Layout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Layout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Layout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Layout { + + /** TextSegmentType enum. */ + enum TextSegmentType { + TEXT_SEGMENT_TYPE_UNSPECIFIED = 0, + TOKEN = 1, + PARAGRAPH = 2, + FORM_FIELD = 3, + FORM_FIELD_NAME = 4, + FORM_FIELD_CONTENTS = 5, + TABLE = 6, + TABLE_HEADER = 7, + TABLE_ROW = 8, + TABLE_CELL = 9 + } + } + } + + /** Properties of a Row. */ + interface IRow { + + /** Row columnSpecIds */ + columnSpecIds?: (string[]|null); + + /** Row values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a Row. */ + class Row implements IRow { + + /** + * Constructs a new Row. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IRow); + + /** Row columnSpecIds. */ + public columnSpecIds: string[]; + + /** Row values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new Row instance using the specified properties. + * @param [properties] Properties to set + * @returns Row instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IRow): google.cloud.automl.v1beta1.Row; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.cloud.automl.v1beta1.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.automl.v1beta1.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.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.automl.v1beta1.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.automl.v1beta1.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.automl.v1beta1.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.automl.v1beta1.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.automl.v1beta1.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 ExamplePayload. */ + interface IExamplePayload { + + /** ExamplePayload image */ + image?: (google.cloud.automl.v1beta1.IImage|null); + + /** ExamplePayload textSnippet */ + textSnippet?: (google.cloud.automl.v1beta1.ITextSnippet|null); + + /** ExamplePayload document */ + document?: (google.cloud.automl.v1beta1.IDocument|null); + + /** ExamplePayload row */ + row?: (google.cloud.automl.v1beta1.IRow|null); + } + + /** Represents an ExamplePayload. */ + class ExamplePayload implements IExamplePayload { + + /** + * Constructs a new ExamplePayload. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IExamplePayload); + + /** ExamplePayload image. */ + public image?: (google.cloud.automl.v1beta1.IImage|null); + + /** ExamplePayload textSnippet. */ + public textSnippet?: (google.cloud.automl.v1beta1.ITextSnippet|null); + + /** ExamplePayload document. */ + public document?: (google.cloud.automl.v1beta1.IDocument|null); + + /** ExamplePayload row. */ + public row?: (google.cloud.automl.v1beta1.IRow|null); + + /** ExamplePayload payload. */ + public payload?: ("image"|"textSnippet"|"document"|"row"); + + /** + * Creates a new ExamplePayload instance using the specified properties. + * @param [properties] Properties to set + * @returns ExamplePayload instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IExamplePayload): google.cloud.automl.v1beta1.ExamplePayload; + + /** + * Encodes the specified ExamplePayload message. Does not implicitly {@link google.cloud.automl.v1beta1.ExamplePayload.verify|verify} messages. + * @param message ExamplePayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IExamplePayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExamplePayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExamplePayload.verify|verify} messages. + * @param message ExamplePayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IExamplePayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExamplePayload message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExamplePayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ExamplePayload; + + /** + * Decodes an ExamplePayload message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExamplePayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ExamplePayload; + + /** + * Verifies an ExamplePayload message. + * @param message Plain 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 ExamplePayload message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExamplePayload + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ExamplePayload; + + /** + * Creates a plain object from an ExamplePayload message. Also converts values to other types if specified. + * @param message ExamplePayload + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ExamplePayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExamplePayload to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExamplePayload + * @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 gcsSource */ + gcsSource?: (google.cloud.automl.v1beta1.IGcsSource|null); + + /** InputConfig bigquerySource */ + bigquerySource?: (google.cloud.automl.v1beta1.IBigQuerySource|null); + + /** InputConfig params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents an InputConfig. */ + class InputConfig implements IInputConfig { + + /** + * Constructs a new InputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IInputConfig); + + /** InputConfig gcsSource. */ + public gcsSource?: (google.cloud.automl.v1beta1.IGcsSource|null); + + /** InputConfig bigquerySource. */ + public bigquerySource?: (google.cloud.automl.v1beta1.IBigQuerySource|null); + + /** InputConfig params. */ + public params: { [k: string]: string }; + + /** 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.automl.v1beta1.IInputConfig): google.cloud.automl.v1beta1.InputConfig; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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 BatchPredictInputConfig. */ + interface IBatchPredictInputConfig { + + /** BatchPredictInputConfig gcsSource */ + gcsSource?: (google.cloud.automl.v1beta1.IGcsSource|null); + + /** BatchPredictInputConfig bigquerySource */ + bigquerySource?: (google.cloud.automl.v1beta1.IBigQuerySource|null); + } + + /** Represents a BatchPredictInputConfig. */ + class BatchPredictInputConfig implements IBatchPredictInputConfig { + + /** + * Constructs a new BatchPredictInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IBatchPredictInputConfig); + + /** BatchPredictInputConfig gcsSource. */ + public gcsSource?: (google.cloud.automl.v1beta1.IGcsSource|null); + + /** BatchPredictInputConfig bigquerySource. */ + public bigquerySource?: (google.cloud.automl.v1beta1.IBigQuerySource|null); + + /** BatchPredictInputConfig source. */ + public source?: ("gcsSource"|"bigquerySource"); + + /** + * Creates a new BatchPredictInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictInputConfig instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IBatchPredictInputConfig): google.cloud.automl.v1beta1.BatchPredictInputConfig; + + /** + * Encodes the specified BatchPredictInputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictInputConfig.verify|verify} messages. + * @param message BatchPredictInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IBatchPredictInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictInputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictInputConfig.verify|verify} messages. + * @param message BatchPredictInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IBatchPredictInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.BatchPredictInputConfig; + + /** + * Decodes a BatchPredictInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.BatchPredictInputConfig; + + /** + * Verifies a BatchPredictInputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BatchPredictInputConfig; + + /** + * Creates a plain object from a BatchPredictInputConfig message. Also converts values to other types if specified. + * @param message BatchPredictInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.BatchPredictInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictInputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DocumentInputConfig. */ + interface IDocumentInputConfig { + + /** DocumentInputConfig gcsSource */ + gcsSource?: (google.cloud.automl.v1beta1.IGcsSource|null); + } + + /** Represents a DocumentInputConfig. */ + class DocumentInputConfig implements IDocumentInputConfig { + + /** + * Constructs a new DocumentInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDocumentInputConfig); + + /** DocumentInputConfig gcsSource. */ + public gcsSource?: (google.cloud.automl.v1beta1.IGcsSource|null); + + /** + * Creates a new DocumentInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentInputConfig instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDocumentInputConfig): google.cloud.automl.v1beta1.DocumentInputConfig; + + /** + * Encodes the specified DocumentInputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.DocumentInputConfig.verify|verify} messages. + * @param message DocumentInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDocumentInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentInputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DocumentInputConfig.verify|verify} messages. + * @param message DocumentInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDocumentInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.DocumentInputConfig; + + /** + * Decodes a DocumentInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.DocumentInputConfig; + + /** + * Verifies a DocumentInputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DocumentInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.DocumentInputConfig; + + /** + * Creates a plain object from a DocumentInputConfig message. Also converts values to other types if specified. + * @param message DocumentInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.DocumentInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentInputConfig + * @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.automl.v1beta1.IGcsDestination|null); + + /** OutputConfig bigqueryDestination */ + bigqueryDestination?: (google.cloud.automl.v1beta1.IBigQueryDestination|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.automl.v1beta1.IGcsDestination|null); + + /** OutputConfig bigqueryDestination. */ + public bigqueryDestination?: (google.cloud.automl.v1beta1.IBigQueryDestination|null); + + /** OutputConfig destination. */ + public destination?: ("gcsDestination"|"bigqueryDestination"); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IOutputConfig): google.cloud.automl.v1beta1.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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 BatchPredictOutputConfig. */ + interface IBatchPredictOutputConfig { + + /** BatchPredictOutputConfig gcsDestination */ + gcsDestination?: (google.cloud.automl.v1beta1.IGcsDestination|null); + + /** BatchPredictOutputConfig bigqueryDestination */ + bigqueryDestination?: (google.cloud.automl.v1beta1.IBigQueryDestination|null); + } + + /** Represents a BatchPredictOutputConfig. */ + class BatchPredictOutputConfig implements IBatchPredictOutputConfig { + + /** + * Constructs a new BatchPredictOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IBatchPredictOutputConfig); + + /** BatchPredictOutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.automl.v1beta1.IGcsDestination|null); + + /** BatchPredictOutputConfig bigqueryDestination. */ + public bigqueryDestination?: (google.cloud.automl.v1beta1.IBigQueryDestination|null); + + /** BatchPredictOutputConfig destination. */ + public destination?: ("gcsDestination"|"bigqueryDestination"); + + /** + * Creates a new BatchPredictOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictOutputConfig instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IBatchPredictOutputConfig): google.cloud.automl.v1beta1.BatchPredictOutputConfig; + + /** + * Encodes the specified BatchPredictOutputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOutputConfig.verify|verify} messages. + * @param message BatchPredictOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IBatchPredictOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOutputConfig.verify|verify} messages. + * @param message BatchPredictOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IBatchPredictOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.BatchPredictOutputConfig; + + /** + * Decodes a BatchPredictOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.BatchPredictOutputConfig; + + /** + * Verifies a BatchPredictOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BatchPredictOutputConfig; + + /** + * Creates a plain object from a BatchPredictOutputConfig message. Also converts values to other types if specified. + * @param message BatchPredictOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.BatchPredictOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModelExportOutputConfig. */ + interface IModelExportOutputConfig { + + /** ModelExportOutputConfig gcsDestination */ + gcsDestination?: (google.cloud.automl.v1beta1.IGcsDestination|null); + + /** ModelExportOutputConfig gcrDestination */ + gcrDestination?: (google.cloud.automl.v1beta1.IGcrDestination|null); + + /** ModelExportOutputConfig modelFormat */ + modelFormat?: (string|null); + + /** ModelExportOutputConfig params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents a ModelExportOutputConfig. */ + class ModelExportOutputConfig implements IModelExportOutputConfig { + + /** + * Constructs a new ModelExportOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IModelExportOutputConfig); + + /** ModelExportOutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.automl.v1beta1.IGcsDestination|null); + + /** ModelExportOutputConfig gcrDestination. */ + public gcrDestination?: (google.cloud.automl.v1beta1.IGcrDestination|null); + + /** ModelExportOutputConfig modelFormat. */ + public modelFormat: string; + + /** ModelExportOutputConfig params. */ + public params: { [k: string]: string }; + + /** ModelExportOutputConfig destination. */ + public destination?: ("gcsDestination"|"gcrDestination"); + + /** + * Creates a new ModelExportOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelExportOutputConfig instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IModelExportOutputConfig): google.cloud.automl.v1beta1.ModelExportOutputConfig; + + /** + * Encodes the specified ModelExportOutputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.ModelExportOutputConfig.verify|verify} messages. + * @param message ModelExportOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IModelExportOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelExportOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ModelExportOutputConfig.verify|verify} messages. + * @param message ModelExportOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IModelExportOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelExportOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelExportOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ModelExportOutputConfig; + + /** + * Decodes a ModelExportOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelExportOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ModelExportOutputConfig; + + /** + * Verifies a ModelExportOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelExportOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelExportOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ModelExportOutputConfig; + + /** + * Creates a plain object from a ModelExportOutputConfig message. Also converts values to other types if specified. + * @param message ModelExportOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ModelExportOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelExportOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelExportOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportEvaluatedExamplesOutputConfig. */ + interface IExportEvaluatedExamplesOutputConfig { + + /** ExportEvaluatedExamplesOutputConfig bigqueryDestination */ + bigqueryDestination?: (google.cloud.automl.v1beta1.IBigQueryDestination|null); + } + + /** Represents an ExportEvaluatedExamplesOutputConfig. */ + class ExportEvaluatedExamplesOutputConfig implements IExportEvaluatedExamplesOutputConfig { + + /** + * Constructs a new ExportEvaluatedExamplesOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig); + + /** ExportEvaluatedExamplesOutputConfig bigqueryDestination. */ + public bigqueryDestination?: (google.cloud.automl.v1beta1.IBigQueryDestination|null); + + /** ExportEvaluatedExamplesOutputConfig destination. */ + public destination?: "bigqueryDestination"; + + /** + * Creates a new ExportEvaluatedExamplesOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEvaluatedExamplesOutputConfig instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig): google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig; + + /** + * Encodes the specified ExportEvaluatedExamplesOutputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.verify|verify} messages. + * @param message ExportEvaluatedExamplesOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportEvaluatedExamplesOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.verify|verify} messages. + * @param message ExportEvaluatedExamplesOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportEvaluatedExamplesOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEvaluatedExamplesOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig; + + /** + * Decodes an ExportEvaluatedExamplesOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEvaluatedExamplesOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig; + + /** + * Verifies an ExportEvaluatedExamplesOutputConfig message. + * @param message Plain 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 ExportEvaluatedExamplesOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEvaluatedExamplesOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig; + + /** + * Creates a plain object from an ExportEvaluatedExamplesOutputConfig message. Also converts values to other types if specified. + * @param message ExportEvaluatedExamplesOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportEvaluatedExamplesOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportEvaluatedExamplesOutputConfig + * @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 inputUris */ + inputUris?: (string[]|null); + } + + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { + + /** + * Constructs a new GcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IGcsSource); + + /** GcsSource inputUris. */ + public inputUris: string[]; + + /** + * Creates a new GcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSource instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IGcsSource): google.cloud.automl.v1beta1.GcsSource; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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.automl.v1beta1.IBigQuerySource): google.cloud.automl.v1beta1.BigQuerySource; + + /** + * Encodes the specified BigQuerySource message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.IBigQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQuerySource message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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 a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination outputUriPrefix */ + outputUriPrefix?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IGcsDestination); + + /** GcsDestination outputUriPrefix. */ + public outputUriPrefix: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IGcsDestination): google.cloud.automl.v1beta1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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 BigQueryDestination. */ + interface IBigQueryDestination { + + /** BigQueryDestination outputUri */ + outputUri?: (string|null); + } + + /** Represents a BigQueryDestination. */ + class BigQueryDestination implements IBigQueryDestination { + + /** + * Constructs a new BigQueryDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IBigQueryDestination); + + /** BigQueryDestination outputUri. */ + public outputUri: string; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryDestination instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IBigQueryDestination): google.cloud.automl.v1beta1.BigQueryDestination; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.automl.v1beta1.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.BigQueryDestination; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.BigQueryDestination; + + /** + * Verifies a BigQueryDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BigQueryDestination; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @param message BigQueryDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcrDestination. */ + interface IGcrDestination { + + /** GcrDestination outputUri */ + outputUri?: (string|null); + } + + /** Represents a GcrDestination. */ + class GcrDestination implements IGcrDestination { + + /** + * Constructs a new GcrDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IGcrDestination); + + /** GcrDestination outputUri. */ + public outputUri: string; + + /** + * Creates a new GcrDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcrDestination instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IGcrDestination): google.cloud.automl.v1beta1.GcrDestination; + + /** + * Encodes the specified GcrDestination message. Does not implicitly {@link google.cloud.automl.v1beta1.GcrDestination.verify|verify} messages. + * @param message GcrDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IGcrDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcrDestination message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GcrDestination.verify|verify} messages. + * @param message GcrDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IGcrDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcrDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcrDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.GcrDestination; + + /** + * Decodes a GcrDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcrDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.GcrDestination; + + /** + * Verifies a GcrDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcrDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcrDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.GcrDestination; + + /** + * Creates a plain object from a GcrDestination message. Also converts values to other types if specified. + * @param message GcrDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.GcrDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcrDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcrDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSegment. */ + interface ITextSegment { + + /** TextSegment content */ + content?: (string|null); + + /** TextSegment startOffset */ + startOffset?: (number|Long|string|null); + + /** TextSegment endOffset */ + endOffset?: (number|Long|string|null); + } + + /** Represents a TextSegment. */ + class TextSegment implements ITextSegment { + + /** + * Constructs a new TextSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextSegment); + + /** TextSegment content. */ + public content: string; + + /** TextSegment startOffset. */ + public startOffset: (number|Long|string); + + /** TextSegment endOffset. */ + public endOffset: (number|Long|string); + + /** + * Creates a new TextSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSegment instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextSegment): google.cloud.automl.v1beta1.TextSegment; + + /** + * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSegment.verify|verify} messages. + * @param message TextSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSegment.verify|verify} messages. + * @param message TextSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TextSegment; + + /** + * Decodes a TextSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TextSegment; + + /** + * Verifies a TextSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextSegment; + + /** + * Creates a plain object from a TextSegment message. Also converts values to other types if specified. + * @param message TextSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleRange. */ + interface IDoubleRange { + + /** DoubleRange start */ + start?: (number|null); + + /** DoubleRange end */ + end?: (number|null); + } + + /** Represents a DoubleRange. */ + class DoubleRange implements IDoubleRange { + + /** + * Constructs a new DoubleRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDoubleRange); + + /** DoubleRange start. */ + public start: number; + + /** DoubleRange end. */ + public end: number; + + /** + * Creates a new DoubleRange instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleRange instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDoubleRange): google.cloud.automl.v1beta1.DoubleRange; + + /** + * Encodes the specified DoubleRange message. Does not implicitly {@link google.cloud.automl.v1beta1.DoubleRange.verify|verify} messages. + * @param message DoubleRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDoubleRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleRange message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DoubleRange.verify|verify} messages. + * @param message DoubleRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDoubleRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.DoubleRange; + + /** + * Decodes a DoubleRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.DoubleRange; + + /** + * Verifies a DoubleRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.DoubleRange; + + /** + * Creates a plain object from a DoubleRange message. Also converts values to other types if specified. + * @param message DoubleRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.DoubleRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RegressionEvaluationMetrics. */ + interface IRegressionEvaluationMetrics { + + /** RegressionEvaluationMetrics rootMeanSquaredError */ + rootMeanSquaredError?: (number|null); + + /** RegressionEvaluationMetrics meanAbsoluteError */ + meanAbsoluteError?: (number|null); + + /** RegressionEvaluationMetrics meanAbsolutePercentageError */ + meanAbsolutePercentageError?: (number|null); + + /** RegressionEvaluationMetrics rSquared */ + rSquared?: (number|null); + + /** RegressionEvaluationMetrics rootMeanSquaredLogError */ + rootMeanSquaredLogError?: (number|null); + } + + /** Represents a RegressionEvaluationMetrics. */ + class RegressionEvaluationMetrics implements IRegressionEvaluationMetrics { + + /** + * Constructs a new RegressionEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IRegressionEvaluationMetrics); + + /** RegressionEvaluationMetrics rootMeanSquaredError. */ + public rootMeanSquaredError: number; + + /** RegressionEvaluationMetrics meanAbsoluteError. */ + public meanAbsoluteError: number; + + /** RegressionEvaluationMetrics meanAbsolutePercentageError. */ + public meanAbsolutePercentageError: number; + + /** RegressionEvaluationMetrics rSquared. */ + public rSquared: number; + + /** RegressionEvaluationMetrics rootMeanSquaredLogError. */ + public rootMeanSquaredLogError: number; + + /** + * Creates a new RegressionEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns RegressionEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IRegressionEvaluationMetrics): google.cloud.automl.v1beta1.RegressionEvaluationMetrics; + + /** + * Encodes the specified RegressionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.RegressionEvaluationMetrics.verify|verify} messages. + * @param message RegressionEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IRegressionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegressionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.RegressionEvaluationMetrics.verify|verify} messages. + * @param message RegressionEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IRegressionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegressionEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegressionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.RegressionEvaluationMetrics; + + /** + * Decodes a RegressionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegressionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.RegressionEvaluationMetrics; + + /** + * Verifies a RegressionEvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegressionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegressionEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.RegressionEvaluationMetrics; + + /** + * Creates a plain object from a RegressionEvaluationMetrics message. Also converts values to other types if specified. + * @param message RegressionEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.RegressionEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegressionEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RegressionEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextExtractionAnnotation. */ + interface ITextExtractionAnnotation { + + /** TextExtractionAnnotation textSegment */ + textSegment?: (google.cloud.automl.v1beta1.ITextSegment|null); + + /** TextExtractionAnnotation score */ + score?: (number|null); + } + + /** Represents a TextExtractionAnnotation. */ + class TextExtractionAnnotation implements ITextExtractionAnnotation { + + /** + * Constructs a new TextExtractionAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextExtractionAnnotation); + + /** TextExtractionAnnotation textSegment. */ + public textSegment?: (google.cloud.automl.v1beta1.ITextSegment|null); + + /** TextExtractionAnnotation score. */ + public score: number; + + /** TextExtractionAnnotation annotation. */ + public annotation?: "textSegment"; + + /** + * Creates a new TextExtractionAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TextExtractionAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextExtractionAnnotation): google.cloud.automl.v1beta1.TextExtractionAnnotation; + + /** + * Encodes the specified TextExtractionAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionAnnotation.verify|verify} messages. + * @param message TextExtractionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextExtractionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextExtractionAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionAnnotation.verify|verify} messages. + * @param message TextExtractionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextExtractionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextExtractionAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextExtractionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TextExtractionAnnotation; + + /** + * Decodes a TextExtractionAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextExtractionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TextExtractionAnnotation; + + /** + * Verifies a TextExtractionAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextExtractionAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextExtractionAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextExtractionAnnotation; + + /** + * Creates a plain object from a TextExtractionAnnotation message. Also converts values to other types if specified. + * @param message TextExtractionAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextExtractionAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextExtractionAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextExtractionAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextExtractionEvaluationMetrics. */ + interface ITextExtractionEvaluationMetrics { + + /** TextExtractionEvaluationMetrics auPrc */ + auPrc?: (number|null); + + /** TextExtractionEvaluationMetrics confidenceMetricsEntries */ + confidenceMetricsEntries?: (google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry[]|null); + } + + /** Represents a TextExtractionEvaluationMetrics. */ + class TextExtractionEvaluationMetrics implements ITextExtractionEvaluationMetrics { + + /** + * Constructs a new TextExtractionEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics); + + /** TextExtractionEvaluationMetrics auPrc. */ + public auPrc: number; + + /** TextExtractionEvaluationMetrics confidenceMetricsEntries. */ + public confidenceMetricsEntries: google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry[]; + + /** + * Creates a new TextExtractionEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns TextExtractionEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics): google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics; + + /** + * Encodes the specified TextExtractionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.verify|verify} messages. + * @param message TextExtractionEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextExtractionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.verify|verify} messages. + * @param message TextExtractionEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextExtractionEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextExtractionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics; + + /** + * Decodes a TextExtractionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextExtractionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics; + + /** + * Verifies a TextExtractionEvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextExtractionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextExtractionEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics; + + /** + * Creates a plain object from a TextExtractionEvaluationMetrics message. Also converts values to other types if specified. + * @param message TextExtractionEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextExtractionEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextExtractionEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TextExtractionEvaluationMetrics { + + /** 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); + } + + /** Represents a ConfidenceMetricsEntry. */ + class ConfidenceMetricsEntry implements IConfidenceMetricsEntry { + + /** + * Constructs a new ConfidenceMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry); + + /** ConfidenceMetricsEntry confidenceThreshold. */ + public confidenceThreshold: number; + + /** ConfidenceMetricsEntry recall. */ + public recall: number; + + /** ConfidenceMetricsEntry precision. */ + public precision: number; + + /** ConfidenceMetricsEntry f1Score. */ + public f1Score: number; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidenceMetricsEntry instance + */ + public static create(properties?: google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry): google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.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.automl.v1beta1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.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.automl.v1beta1.TextExtractionEvaluationMetrics.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.automl.v1beta1.TextExtractionEvaluationMetrics.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.automl.v1beta1.TextExtractionEvaluationMetrics.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.automl.v1beta1.TextExtractionEvaluationMetrics.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.automl.v1beta1.TextExtractionEvaluationMetrics.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 TextSentimentAnnotation. */ + interface ITextSentimentAnnotation { + + /** TextSentimentAnnotation sentiment */ + sentiment?: (number|null); + } + + /** Represents a TextSentimentAnnotation. */ + class TextSentimentAnnotation implements ITextSentimentAnnotation { + + /** + * Constructs a new TextSentimentAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextSentimentAnnotation); + + /** TextSentimentAnnotation sentiment. */ + public sentiment: number; + + /** + * Creates a new TextSentimentAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSentimentAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextSentimentAnnotation): google.cloud.automl.v1beta1.TextSentimentAnnotation; + + /** + * Encodes the specified TextSentimentAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentAnnotation.verify|verify} messages. + * @param message TextSentimentAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextSentimentAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSentimentAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentAnnotation.verify|verify} messages. + * @param message TextSentimentAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextSentimentAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSentimentAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSentimentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TextSentimentAnnotation; + + /** + * Decodes a TextSentimentAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSentimentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TextSentimentAnnotation; + + /** + * Verifies a TextSentimentAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSentimentAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSentimentAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextSentimentAnnotation; + + /** + * Creates a plain object from a TextSentimentAnnotation message. Also converts values to other types if specified. + * @param message TextSentimentAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextSentimentAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSentimentAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSentimentAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSentimentEvaluationMetrics. */ + interface ITextSentimentEvaluationMetrics { + + /** TextSentimentEvaluationMetrics precision */ + precision?: (number|null); + + /** TextSentimentEvaluationMetrics recall */ + recall?: (number|null); + + /** TextSentimentEvaluationMetrics f1Score */ + f1Score?: (number|null); + + /** TextSentimentEvaluationMetrics meanAbsoluteError */ + meanAbsoluteError?: (number|null); + + /** TextSentimentEvaluationMetrics meanSquaredError */ + meanSquaredError?: (number|null); + + /** TextSentimentEvaluationMetrics linearKappa */ + linearKappa?: (number|null); + + /** TextSentimentEvaluationMetrics quadraticKappa */ + quadraticKappa?: (number|null); + + /** TextSentimentEvaluationMetrics confusionMatrix */ + confusionMatrix?: (google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix|null); + + /** TextSentimentEvaluationMetrics annotationSpecId */ + annotationSpecId?: (string[]|null); + } + + /** Represents a TextSentimentEvaluationMetrics. */ + class TextSentimentEvaluationMetrics implements ITextSentimentEvaluationMetrics { + + /** + * Constructs a new TextSentimentEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics); + + /** TextSentimentEvaluationMetrics precision. */ + public precision: number; + + /** TextSentimentEvaluationMetrics recall. */ + public recall: number; + + /** TextSentimentEvaluationMetrics f1Score. */ + public f1Score: number; + + /** TextSentimentEvaluationMetrics meanAbsoluteError. */ + public meanAbsoluteError: number; + + /** TextSentimentEvaluationMetrics meanSquaredError. */ + public meanSquaredError: number; + + /** TextSentimentEvaluationMetrics linearKappa. */ + public linearKappa: number; + + /** TextSentimentEvaluationMetrics quadraticKappa. */ + public quadraticKappa: number; + + /** TextSentimentEvaluationMetrics confusionMatrix. */ + public confusionMatrix?: (google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix|null); + + /** TextSentimentEvaluationMetrics annotationSpecId. */ + public annotationSpecId: string[]; + + /** + * Creates a new TextSentimentEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSentimentEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics): google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics; + + /** + * Encodes the specified TextSentimentEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.verify|verify} messages. + * @param message TextSentimentEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSentimentEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.verify|verify} messages. + * @param message TextSentimentEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSentimentEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSentimentEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics; + + /** + * Decodes a TextSentimentEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSentimentEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics; + + /** + * Verifies a TextSentimentEvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSentimentEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSentimentEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics; + + /** + * Creates a plain object from a TextSentimentEvaluationMetrics message. Also converts values to other types if specified. + * @param message TextSentimentEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSentimentEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSentimentEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TranslationDatasetMetadata. */ + interface ITranslationDatasetMetadata { + + /** TranslationDatasetMetadata sourceLanguageCode */ + sourceLanguageCode?: (string|null); + + /** TranslationDatasetMetadata targetLanguageCode */ + targetLanguageCode?: (string|null); + } + + /** Represents a TranslationDatasetMetadata. */ + class TranslationDatasetMetadata implements ITranslationDatasetMetadata { + + /** + * Constructs a new TranslationDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITranslationDatasetMetadata); + + /** TranslationDatasetMetadata sourceLanguageCode. */ + public sourceLanguageCode: string; + + /** TranslationDatasetMetadata targetLanguageCode. */ + public targetLanguageCode: string; + + /** + * Creates a new TranslationDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITranslationDatasetMetadata): google.cloud.automl.v1beta1.TranslationDatasetMetadata; + + /** + * Encodes the specified TranslationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationDatasetMetadata.verify|verify} messages. + * @param message TranslationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITranslationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationDatasetMetadata.verify|verify} messages. + * @param message TranslationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITranslationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TranslationDatasetMetadata; + + /** + * Decodes a TranslationDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TranslationDatasetMetadata; + + /** + * Verifies a TranslationDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TranslationDatasetMetadata; + + /** + * Creates a plain object from a TranslationDatasetMetadata message. Also converts values to other types if specified. + * @param message TranslationDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TranslationDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslationDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TranslationEvaluationMetrics. */ + interface ITranslationEvaluationMetrics { + + /** TranslationEvaluationMetrics bleuScore */ + bleuScore?: (number|null); + + /** TranslationEvaluationMetrics baseBleuScore */ + baseBleuScore?: (number|null); + } + + /** Represents a TranslationEvaluationMetrics. */ + class TranslationEvaluationMetrics implements ITranslationEvaluationMetrics { + + /** + * Constructs a new TranslationEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITranslationEvaluationMetrics); + + /** TranslationEvaluationMetrics bleuScore. */ + public bleuScore: number; + + /** TranslationEvaluationMetrics baseBleuScore. */ + public baseBleuScore: number; + + /** + * Creates a new TranslationEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITranslationEvaluationMetrics): google.cloud.automl.v1beta1.TranslationEvaluationMetrics; + + /** + * Encodes the specified TranslationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationEvaluationMetrics.verify|verify} messages. + * @param message TranslationEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITranslationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationEvaluationMetrics.verify|verify} messages. + * @param message TranslationEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITranslationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TranslationEvaluationMetrics; + + /** + * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TranslationEvaluationMetrics; + + /** + * Verifies a TranslationEvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TranslationEvaluationMetrics; + + /** + * Creates a plain object from a TranslationEvaluationMetrics message. Also converts values to other types if specified. + * @param message TranslationEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TranslationEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslationEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TranslationModelMetadata. */ + interface ITranslationModelMetadata { + + /** TranslationModelMetadata baseModel */ + baseModel?: (string|null); + + /** TranslationModelMetadata sourceLanguageCode */ + sourceLanguageCode?: (string|null); + + /** TranslationModelMetadata targetLanguageCode */ + targetLanguageCode?: (string|null); + } + + /** Represents a TranslationModelMetadata. */ + class TranslationModelMetadata implements ITranslationModelMetadata { + + /** + * Constructs a new TranslationModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITranslationModelMetadata); + + /** TranslationModelMetadata baseModel. */ + public baseModel: string; + + /** TranslationModelMetadata sourceLanguageCode. */ + public sourceLanguageCode: string; + + /** TranslationModelMetadata targetLanguageCode. */ + public targetLanguageCode: string; + + /** + * Creates a new TranslationModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITranslationModelMetadata): google.cloud.automl.v1beta1.TranslationModelMetadata; + + /** + * Encodes the specified TranslationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationModelMetadata.verify|verify} messages. + * @param message TranslationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITranslationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationModelMetadata.verify|verify} messages. + * @param message TranslationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITranslationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TranslationModelMetadata; + + /** + * Decodes a TranslationModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TranslationModelMetadata; + + /** + * Verifies a TranslationModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TranslationModelMetadata; + + /** + * Creates a plain object from a TranslationModelMetadata message. Also converts values to other types if specified. + * @param message TranslationModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TranslationModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslationModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TranslationAnnotation. */ + interface ITranslationAnnotation { + + /** TranslationAnnotation translatedContent */ + translatedContent?: (google.cloud.automl.v1beta1.ITextSnippet|null); + } + + /** Represents a TranslationAnnotation. */ + class TranslationAnnotation implements ITranslationAnnotation { + + /** + * Constructs a new TranslationAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITranslationAnnotation); + + /** TranslationAnnotation translatedContent. */ + public translatedContent?: (google.cloud.automl.v1beta1.ITextSnippet|null); + + /** + * Creates a new TranslationAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITranslationAnnotation): google.cloud.automl.v1beta1.TranslationAnnotation; + + /** + * Encodes the specified TranslationAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationAnnotation.verify|verify} messages. + * @param message TranslationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITranslationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationAnnotation.verify|verify} messages. + * @param message TranslationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITranslationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TranslationAnnotation; + + /** + * Decodes a TranslationAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TranslationAnnotation; + + /** + * Verifies a TranslationAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslationAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TranslationAnnotation; + + /** + * Creates a plain object from a TranslationAnnotation message. Also converts values to other types if specified. + * @param message TranslationAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TranslationAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslationAnnotation + * @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 name */ + name?: (string|null); + + /** AnnotationSpec displayName */ + displayName?: (string|null); + + /** AnnotationSpec exampleCount */ + exampleCount?: (number|null); + } + + /** Represents an AnnotationSpec. */ + class AnnotationSpec implements IAnnotationSpec { + + /** + * Constructs a new AnnotationSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IAnnotationSpec); + + /** AnnotationSpec name. */ + public name: string; + + /** AnnotationSpec displayName. */ + public displayName: string; + + /** AnnotationSpec exampleCount. */ + public exampleCount: number; + + /** + * Creates a new AnnotationSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotationSpec instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IAnnotationSpec): google.cloud.automl.v1beta1.AnnotationSpec; + + /** + * Encodes the specified AnnotationSpec message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.IAnnotationSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotationSpec message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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; + } + + /** Properties of a Dataset. */ + interface IDataset { + + /** Dataset translationDatasetMetadata */ + translationDatasetMetadata?: (google.cloud.automl.v1beta1.ITranslationDatasetMetadata|null); + + /** Dataset imageClassificationDatasetMetadata */ + imageClassificationDatasetMetadata?: (google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata|null); + + /** Dataset textClassificationDatasetMetadata */ + textClassificationDatasetMetadata?: (google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata|null); + + /** Dataset imageObjectDetectionDatasetMetadata */ + imageObjectDetectionDatasetMetadata?: (google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata|null); + + /** Dataset videoClassificationDatasetMetadata */ + videoClassificationDatasetMetadata?: (google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata|null); + + /** Dataset videoObjectTrackingDatasetMetadata */ + videoObjectTrackingDatasetMetadata?: (google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata|null); + + /** Dataset textExtractionDatasetMetadata */ + textExtractionDatasetMetadata?: (google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata|null); + + /** Dataset textSentimentDatasetMetadata */ + textSentimentDatasetMetadata?: (google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata|null); + + /** Dataset tablesDatasetMetadata */ + tablesDatasetMetadata?: (google.cloud.automl.v1beta1.ITablesDatasetMetadata|null); + + /** Dataset name */ + name?: (string|null); + + /** Dataset displayName */ + displayName?: (string|null); + + /** Dataset description */ + description?: (string|null); + + /** Dataset exampleCount */ + exampleCount?: (number|null); + + /** Dataset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Dataset etag */ + etag?: (string|null); + } + + /** Represents a Dataset. */ + class Dataset implements IDataset { + + /** + * Constructs a new Dataset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDataset); + + /** Dataset translationDatasetMetadata. */ + public translationDatasetMetadata?: (google.cloud.automl.v1beta1.ITranslationDatasetMetadata|null); + + /** Dataset imageClassificationDatasetMetadata. */ + public imageClassificationDatasetMetadata?: (google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata|null); + + /** Dataset textClassificationDatasetMetadata. */ + public textClassificationDatasetMetadata?: (google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata|null); + + /** Dataset imageObjectDetectionDatasetMetadata. */ + public imageObjectDetectionDatasetMetadata?: (google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata|null); + + /** Dataset videoClassificationDatasetMetadata. */ + public videoClassificationDatasetMetadata?: (google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata|null); + + /** Dataset videoObjectTrackingDatasetMetadata. */ + public videoObjectTrackingDatasetMetadata?: (google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata|null); + + /** Dataset textExtractionDatasetMetadata. */ + public textExtractionDatasetMetadata?: (google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata|null); + + /** Dataset textSentimentDatasetMetadata. */ + public textSentimentDatasetMetadata?: (google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata|null); + + /** Dataset tablesDatasetMetadata. */ + public tablesDatasetMetadata?: (google.cloud.automl.v1beta1.ITablesDatasetMetadata|null); + + /** Dataset name. */ + public name: string; + + /** Dataset displayName. */ + public displayName: string; + + /** Dataset description. */ + public description: string; + + /** Dataset exampleCount. */ + public exampleCount: number; + + /** Dataset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Dataset etag. */ + public etag: string; + + /** Dataset datasetMetadata. */ + public datasetMetadata?: ("translationDatasetMetadata"|"imageClassificationDatasetMetadata"|"textClassificationDatasetMetadata"|"imageObjectDetectionDatasetMetadata"|"videoClassificationDatasetMetadata"|"videoObjectTrackingDatasetMetadata"|"textExtractionDatasetMetadata"|"textSentimentDatasetMetadata"|"tablesDatasetMetadata"); + + /** + * Creates a new Dataset instance using the specified properties. + * @param [properties] Properties to set + * @returns Dataset instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDataset): google.cloud.automl.v1beta1.Dataset; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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 ImageClassificationDatasetMetadata. */ + interface IImageClassificationDatasetMetadata { + + /** ImageClassificationDatasetMetadata classificationType */ + classificationType?: (google.cloud.automl.v1beta1.ClassificationType|keyof typeof google.cloud.automl.v1beta1.ClassificationType|null); + } + + /** Represents an ImageClassificationDatasetMetadata. */ + class ImageClassificationDatasetMetadata implements IImageClassificationDatasetMetadata { + + /** + * Constructs a new ImageClassificationDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata); + + /** ImageClassificationDatasetMetadata classificationType. */ + public classificationType: (google.cloud.automl.v1beta1.ClassificationType|keyof typeof google.cloud.automl.v1beta1.ClassificationType); + + /** + * Creates a new ImageClassificationDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageClassificationDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata): google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata; + + /** + * Encodes the specified ImageClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.verify|verify} messages. + * @param message ImageClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.verify|verify} messages. + * @param message ImageClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageClassificationDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata; + + /** + * Decodes an ImageClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata; + + /** + * Verifies an ImageClassificationDatasetMetadata message. + * @param message Plain 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 ImageClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageClassificationDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata; + + /** + * Creates a plain object from an ImageClassificationDatasetMetadata message. Also converts values to other types if specified. + * @param message ImageClassificationDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageClassificationDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageClassificationDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageObjectDetectionDatasetMetadata. */ + interface IImageObjectDetectionDatasetMetadata { + } + + /** Represents an ImageObjectDetectionDatasetMetadata. */ + class ImageObjectDetectionDatasetMetadata implements IImageObjectDetectionDatasetMetadata { + + /** + * Constructs a new ImageObjectDetectionDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata); + + /** + * Creates a new ImageObjectDetectionDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata): google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata; + + /** + * Encodes the specified ImageObjectDetectionDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata.verify|verify} messages. + * @param message ImageObjectDetectionDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata.verify|verify} messages. + * @param message ImageObjectDetectionDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata; + + /** + * Decodes an ImageObjectDetectionDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata; + + /** + * Verifies an ImageObjectDetectionDatasetMetadata message. + * @param message Plain 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 ImageObjectDetectionDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata; + + /** + * Creates a plain object from an ImageObjectDetectionDatasetMetadata message. Also converts values to other types if specified. + * @param message ImageObjectDetectionDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageClassificationModelMetadata. */ + interface IImageClassificationModelMetadata { + + /** ImageClassificationModelMetadata baseModelId */ + baseModelId?: (string|null); + + /** ImageClassificationModelMetadata trainBudget */ + trainBudget?: (number|Long|string|null); + + /** ImageClassificationModelMetadata trainCost */ + trainCost?: (number|Long|string|null); + + /** ImageClassificationModelMetadata stopReason */ + stopReason?: (string|null); + + /** ImageClassificationModelMetadata modelType */ + modelType?: (string|null); + + /** ImageClassificationModelMetadata nodeQps */ + nodeQps?: (number|null); + + /** ImageClassificationModelMetadata nodeCount */ + nodeCount?: (number|Long|string|null); + } + + /** Represents an ImageClassificationModelMetadata. */ + class ImageClassificationModelMetadata implements IImageClassificationModelMetadata { + + /** + * Constructs a new ImageClassificationModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImageClassificationModelMetadata); + + /** ImageClassificationModelMetadata baseModelId. */ + public baseModelId: string; + + /** ImageClassificationModelMetadata trainBudget. */ + public trainBudget: (number|Long|string); + + /** ImageClassificationModelMetadata trainCost. */ + public trainCost: (number|Long|string); + + /** ImageClassificationModelMetadata stopReason. */ + public stopReason: string; + + /** ImageClassificationModelMetadata modelType. */ + public modelType: string; + + /** ImageClassificationModelMetadata nodeQps. */ + public nodeQps: number; + + /** ImageClassificationModelMetadata nodeCount. */ + public nodeCount: (number|Long|string); + + /** + * Creates a new ImageClassificationModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageClassificationModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImageClassificationModelMetadata): google.cloud.automl.v1beta1.ImageClassificationModelMetadata; + + /** + * Encodes the specified ImageClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationModelMetadata.verify|verify} messages. + * @param message ImageClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IImageClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationModelMetadata.verify|verify} messages. + * @param message ImageClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IImageClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageClassificationModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ImageClassificationModelMetadata; + + /** + * Decodes an ImageClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ImageClassificationModelMetadata; + + /** + * Verifies an ImageClassificationModelMetadata message. + * @param message Plain 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 ImageClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageClassificationModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ImageClassificationModelMetadata; + + /** + * Creates a plain object from an ImageClassificationModelMetadata message. Also converts values to other types if specified. + * @param message ImageClassificationModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ImageClassificationModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageClassificationModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageClassificationModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageObjectDetectionModelMetadata. */ + interface IImageObjectDetectionModelMetadata { + + /** ImageObjectDetectionModelMetadata modelType */ + modelType?: (string|null); + + /** ImageObjectDetectionModelMetadata nodeCount */ + nodeCount?: (number|Long|string|null); + + /** ImageObjectDetectionModelMetadata nodeQps */ + nodeQps?: (number|null); + + /** ImageObjectDetectionModelMetadata stopReason */ + stopReason?: (string|null); + + /** ImageObjectDetectionModelMetadata trainBudgetMilliNodeHours */ + trainBudgetMilliNodeHours?: (number|Long|string|null); + + /** ImageObjectDetectionModelMetadata trainCostMilliNodeHours */ + trainCostMilliNodeHours?: (number|Long|string|null); + } + + /** Represents an ImageObjectDetectionModelMetadata. */ + class ImageObjectDetectionModelMetadata implements IImageObjectDetectionModelMetadata { + + /** + * Constructs a new ImageObjectDetectionModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata); + + /** ImageObjectDetectionModelMetadata modelType. */ + public modelType: string; + + /** ImageObjectDetectionModelMetadata nodeCount. */ + public nodeCount: (number|Long|string); + + /** ImageObjectDetectionModelMetadata nodeQps. */ + public nodeQps: number; + + /** ImageObjectDetectionModelMetadata stopReason. */ + public stopReason: string; + + /** ImageObjectDetectionModelMetadata trainBudgetMilliNodeHours. */ + public trainBudgetMilliNodeHours: (number|Long|string); + + /** ImageObjectDetectionModelMetadata trainCostMilliNodeHours. */ + public trainCostMilliNodeHours: (number|Long|string); + + /** + * Creates a new ImageObjectDetectionModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata): google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata; + + /** + * Encodes the specified ImageObjectDetectionModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.verify|verify} messages. + * @param message ImageObjectDetectionModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.verify|verify} messages. + * @param message ImageObjectDetectionModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata; + + /** + * Decodes an ImageObjectDetectionModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata; + + /** + * Verifies an ImageObjectDetectionModelMetadata message. + * @param message Plain 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 ImageObjectDetectionModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata; + + /** + * Creates a plain object from an ImageObjectDetectionModelMetadata message. Also converts values to other types if specified. + * @param message ImageObjectDetectionModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageClassificationModelDeploymentMetadata. */ + interface IImageClassificationModelDeploymentMetadata { + + /** ImageClassificationModelDeploymentMetadata nodeCount */ + nodeCount?: (number|Long|string|null); + } + + /** Represents an ImageClassificationModelDeploymentMetadata. */ + class ImageClassificationModelDeploymentMetadata implements IImageClassificationModelDeploymentMetadata { + + /** + * Constructs a new ImageClassificationModelDeploymentMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata); + + /** ImageClassificationModelDeploymentMetadata nodeCount. */ + public nodeCount: (number|Long|string); + + /** + * Creates a new ImageClassificationModelDeploymentMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageClassificationModelDeploymentMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata): google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata; + + /** + * Encodes the specified ImageClassificationModelDeploymentMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata.verify|verify} messages. + * @param message ImageClassificationModelDeploymentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageClassificationModelDeploymentMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata.verify|verify} messages. + * @param message ImageClassificationModelDeploymentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageClassificationModelDeploymentMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageClassificationModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata; + + /** + * Decodes an ImageClassificationModelDeploymentMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageClassificationModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata; + + /** + * Verifies an ImageClassificationModelDeploymentMetadata message. + * @param message Plain 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 ImageClassificationModelDeploymentMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageClassificationModelDeploymentMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata; + + /** + * Creates a plain object from an ImageClassificationModelDeploymentMetadata message. Also converts values to other types if specified. + * @param message ImageClassificationModelDeploymentMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageClassificationModelDeploymentMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageClassificationModelDeploymentMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageObjectDetectionModelDeploymentMetadata. */ + interface IImageObjectDetectionModelDeploymentMetadata { + + /** ImageObjectDetectionModelDeploymentMetadata nodeCount */ + nodeCount?: (number|Long|string|null); + } + + /** Represents an ImageObjectDetectionModelDeploymentMetadata. */ + class ImageObjectDetectionModelDeploymentMetadata implements IImageObjectDetectionModelDeploymentMetadata { + + /** + * Constructs a new ImageObjectDetectionModelDeploymentMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata); + + /** ImageObjectDetectionModelDeploymentMetadata nodeCount. */ + public nodeCount: (number|Long|string); + + /** + * Creates a new ImageObjectDetectionModelDeploymentMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionModelDeploymentMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata): google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata; + + /** + * Encodes the specified ImageObjectDetectionModelDeploymentMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.verify|verify} messages. + * @param message ImageObjectDetectionModelDeploymentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionModelDeploymentMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.verify|verify} messages. + * @param message ImageObjectDetectionModelDeploymentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionModelDeploymentMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata; + + /** + * Decodes an ImageObjectDetectionModelDeploymentMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata; + + /** + * Verifies an ImageObjectDetectionModelDeploymentMetadata message. + * @param message Plain 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 ImageObjectDetectionModelDeploymentMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionModelDeploymentMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata; + + /** + * Creates a plain object from an ImageObjectDetectionModelDeploymentMetadata message. Also converts values to other types if specified. + * @param message ImageObjectDetectionModelDeploymentMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionModelDeploymentMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionModelDeploymentMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextClassificationDatasetMetadata. */ + interface ITextClassificationDatasetMetadata { + + /** TextClassificationDatasetMetadata classificationType */ + classificationType?: (google.cloud.automl.v1beta1.ClassificationType|keyof typeof google.cloud.automl.v1beta1.ClassificationType|null); + } + + /** Represents a TextClassificationDatasetMetadata. */ + class TextClassificationDatasetMetadata implements ITextClassificationDatasetMetadata { + + /** + * Constructs a new TextClassificationDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata); + + /** TextClassificationDatasetMetadata classificationType. */ + public classificationType: (google.cloud.automl.v1beta1.ClassificationType|keyof typeof google.cloud.automl.v1beta1.ClassificationType); + + /** + * Creates a new TextClassificationDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextClassificationDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata): google.cloud.automl.v1beta1.TextClassificationDatasetMetadata; + + /** + * Encodes the specified TextClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.verify|verify} messages. + * @param message TextClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.verify|verify} messages. + * @param message TextClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextClassificationDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TextClassificationDatasetMetadata; + + /** + * Decodes a TextClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TextClassificationDatasetMetadata; + + /** + * Verifies a TextClassificationDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextClassificationDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextClassificationDatasetMetadata; + + /** + * Creates a plain object from a TextClassificationDatasetMetadata message. Also converts values to other types if specified. + * @param message TextClassificationDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextClassificationDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextClassificationDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextClassificationDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextClassificationModelMetadata. */ + interface ITextClassificationModelMetadata { + + /** TextClassificationModelMetadata classificationType */ + classificationType?: (google.cloud.automl.v1beta1.ClassificationType|keyof typeof google.cloud.automl.v1beta1.ClassificationType|null); + } + + /** Represents a TextClassificationModelMetadata. */ + class TextClassificationModelMetadata implements ITextClassificationModelMetadata { + + /** + * Constructs a new TextClassificationModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextClassificationModelMetadata); + + /** TextClassificationModelMetadata classificationType. */ + public classificationType: (google.cloud.automl.v1beta1.ClassificationType|keyof typeof google.cloud.automl.v1beta1.ClassificationType); + + /** + * Creates a new TextClassificationModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextClassificationModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextClassificationModelMetadata): google.cloud.automl.v1beta1.TextClassificationModelMetadata; + + /** + * Encodes the specified TextClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextClassificationModelMetadata.verify|verify} messages. + * @param message TextClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextClassificationModelMetadata.verify|verify} messages. + * @param message TextClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextClassificationModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TextClassificationModelMetadata; + + /** + * Decodes a TextClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TextClassificationModelMetadata; + + /** + * Verifies a TextClassificationModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextClassificationModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextClassificationModelMetadata; + + /** + * Creates a plain object from a TextClassificationModelMetadata message. Also converts values to other types if specified. + * @param message TextClassificationModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextClassificationModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextClassificationModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextClassificationModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextExtractionDatasetMetadata. */ + interface ITextExtractionDatasetMetadata { + } + + /** Represents a TextExtractionDatasetMetadata. */ + class TextExtractionDatasetMetadata implements ITextExtractionDatasetMetadata { + + /** + * Constructs a new TextExtractionDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata); + + /** + * Creates a new TextExtractionDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextExtractionDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata): google.cloud.automl.v1beta1.TextExtractionDatasetMetadata; + + /** + * Encodes the specified TextExtractionDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionDatasetMetadata.verify|verify} messages. + * @param message TextExtractionDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextExtractionDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionDatasetMetadata.verify|verify} messages. + * @param message TextExtractionDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextExtractionDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextExtractionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TextExtractionDatasetMetadata; + + /** + * Decodes a TextExtractionDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextExtractionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TextExtractionDatasetMetadata; + + /** + * Verifies a TextExtractionDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextExtractionDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextExtractionDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextExtractionDatasetMetadata; + + /** + * Creates a plain object from a TextExtractionDatasetMetadata message. Also converts values to other types if specified. + * @param message TextExtractionDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextExtractionDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextExtractionDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextExtractionDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextExtractionModelMetadata. */ + interface ITextExtractionModelMetadata { + + /** TextExtractionModelMetadata modelHint */ + modelHint?: (string|null); + } + + /** Represents a TextExtractionModelMetadata. */ + class TextExtractionModelMetadata implements ITextExtractionModelMetadata { + + /** + * Constructs a new TextExtractionModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextExtractionModelMetadata); + + /** TextExtractionModelMetadata modelHint. */ + public modelHint: string; + + /** + * Creates a new TextExtractionModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextExtractionModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextExtractionModelMetadata): google.cloud.automl.v1beta1.TextExtractionModelMetadata; + + /** + * Encodes the specified TextExtractionModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionModelMetadata.verify|verify} messages. + * @param message TextExtractionModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextExtractionModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextExtractionModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionModelMetadata.verify|verify} messages. + * @param message TextExtractionModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextExtractionModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextExtractionModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextExtractionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TextExtractionModelMetadata; + + /** + * Decodes a TextExtractionModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextExtractionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TextExtractionModelMetadata; + + /** + * Verifies a TextExtractionModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextExtractionModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextExtractionModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextExtractionModelMetadata; + + /** + * Creates a plain object from a TextExtractionModelMetadata message. Also converts values to other types if specified. + * @param message TextExtractionModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextExtractionModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextExtractionModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextExtractionModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSentimentDatasetMetadata. */ + interface ITextSentimentDatasetMetadata { + + /** TextSentimentDatasetMetadata sentimentMax */ + sentimentMax?: (number|null); + } + + /** Represents a TextSentimentDatasetMetadata. */ + class TextSentimentDatasetMetadata implements ITextSentimentDatasetMetadata { + + /** + * Constructs a new TextSentimentDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata); + + /** TextSentimentDatasetMetadata sentimentMax. */ + public sentimentMax: number; + + /** + * Creates a new TextSentimentDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSentimentDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata): google.cloud.automl.v1beta1.TextSentimentDatasetMetadata; + + /** + * Encodes the specified TextSentimentDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentDatasetMetadata.verify|verify} messages. + * @param message TextSentimentDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSentimentDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentDatasetMetadata.verify|verify} messages. + * @param message TextSentimentDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSentimentDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSentimentDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TextSentimentDatasetMetadata; + + /** + * Decodes a TextSentimentDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSentimentDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TextSentimentDatasetMetadata; + + /** + * Verifies a TextSentimentDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSentimentDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSentimentDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextSentimentDatasetMetadata; + + /** + * Creates a plain object from a TextSentimentDatasetMetadata message. Also converts values to other types if specified. + * @param message TextSentimentDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextSentimentDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSentimentDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSentimentDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSentimentModelMetadata. */ + interface ITextSentimentModelMetadata { + } + + /** Represents a TextSentimentModelMetadata. */ + class TextSentimentModelMetadata implements ITextSentimentModelMetadata { + + /** + * Constructs a new TextSentimentModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextSentimentModelMetadata); + + /** + * Creates a new TextSentimentModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSentimentModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextSentimentModelMetadata): google.cloud.automl.v1beta1.TextSentimentModelMetadata; + + /** + * Encodes the specified TextSentimentModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentModelMetadata.verify|verify} messages. + * @param message TextSentimentModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextSentimentModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSentimentModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentModelMetadata.verify|verify} messages. + * @param message TextSentimentModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextSentimentModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSentimentModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSentimentModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TextSentimentModelMetadata; + + /** + * Decodes a TextSentimentModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSentimentModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TextSentimentModelMetadata; + + /** + * Verifies a TextSentimentModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSentimentModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSentimentModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextSentimentModelMetadata; + + /** + * Creates a plain object from a TextSentimentModelMetadata message. Also converts values to other types if specified. + * @param message TextSentimentModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextSentimentModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSentimentModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSentimentModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoClassificationDatasetMetadata. */ + interface IVideoClassificationDatasetMetadata { + } + + /** Represents a VideoClassificationDatasetMetadata. */ + class VideoClassificationDatasetMetadata implements IVideoClassificationDatasetMetadata { + + /** + * Constructs a new VideoClassificationDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata); + + /** + * Creates a new VideoClassificationDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoClassificationDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata): google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata; + + /** + * Encodes the specified VideoClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata.verify|verify} messages. + * @param message VideoClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata.verify|verify} messages. + * @param message VideoClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoClassificationDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata; + + /** + * Decodes a VideoClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata; + + /** + * Verifies a VideoClassificationDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoClassificationDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata; + + /** + * Creates a plain object from a VideoClassificationDatasetMetadata message. Also converts values to other types if specified. + * @param message VideoClassificationDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoClassificationDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoClassificationDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoObjectTrackingDatasetMetadata. */ + interface IVideoObjectTrackingDatasetMetadata { + } + + /** Represents a VideoObjectTrackingDatasetMetadata. */ + class VideoObjectTrackingDatasetMetadata implements IVideoObjectTrackingDatasetMetadata { + + /** + * Constructs a new VideoObjectTrackingDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata); + + /** + * Creates a new VideoObjectTrackingDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoObjectTrackingDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata): google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata; + + /** + * Encodes the specified VideoObjectTrackingDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata.verify|verify} messages. + * @param message VideoObjectTrackingDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoObjectTrackingDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata.verify|verify} messages. + * @param message VideoObjectTrackingDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoObjectTrackingDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoObjectTrackingDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata; + + /** + * Decodes a VideoObjectTrackingDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoObjectTrackingDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata; + + /** + * Verifies a VideoObjectTrackingDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoObjectTrackingDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoObjectTrackingDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata; + + /** + * Creates a plain object from a VideoObjectTrackingDatasetMetadata message. Also converts values to other types if specified. + * @param message VideoObjectTrackingDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoObjectTrackingDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoObjectTrackingDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoClassificationModelMetadata. */ + interface IVideoClassificationModelMetadata { + } + + /** Represents a VideoClassificationModelMetadata. */ + class VideoClassificationModelMetadata implements IVideoClassificationModelMetadata { + + /** + * Constructs a new VideoClassificationModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IVideoClassificationModelMetadata); + + /** + * Creates a new VideoClassificationModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoClassificationModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IVideoClassificationModelMetadata): google.cloud.automl.v1beta1.VideoClassificationModelMetadata; + + /** + * Encodes the specified VideoClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationModelMetadata.verify|verify} messages. + * @param message VideoClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IVideoClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationModelMetadata.verify|verify} messages. + * @param message VideoClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IVideoClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoClassificationModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.VideoClassificationModelMetadata; + + /** + * Decodes a VideoClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.VideoClassificationModelMetadata; + + /** + * Verifies a VideoClassificationModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoClassificationModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.VideoClassificationModelMetadata; + + /** + * Creates a plain object from a VideoClassificationModelMetadata message. Also converts values to other types if specified. + * @param message VideoClassificationModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.VideoClassificationModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoClassificationModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoClassificationModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoObjectTrackingModelMetadata. */ + interface IVideoObjectTrackingModelMetadata { + } + + /** Represents a VideoObjectTrackingModelMetadata. */ + class VideoObjectTrackingModelMetadata implements IVideoObjectTrackingModelMetadata { + + /** + * Constructs a new VideoObjectTrackingModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata); + + /** + * Creates a new VideoObjectTrackingModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoObjectTrackingModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata): google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata; + + /** + * Encodes the specified VideoObjectTrackingModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata.verify|verify} messages. + * @param message VideoObjectTrackingModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoObjectTrackingModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata.verify|verify} messages. + * @param message VideoObjectTrackingModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoObjectTrackingModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoObjectTrackingModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata; + + /** + * Decodes a VideoObjectTrackingModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoObjectTrackingModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata; + + /** + * Verifies a VideoObjectTrackingModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoObjectTrackingModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoObjectTrackingModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata; + + /** + * Creates a plain object from a VideoObjectTrackingModelMetadata message. Also converts values to other types if specified. + * @param message VideoObjectTrackingModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoObjectTrackingModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoObjectTrackingModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Model. */ + interface IModel { + + /** Model translationModelMetadata */ + translationModelMetadata?: (google.cloud.automl.v1beta1.ITranslationModelMetadata|null); + + /** Model imageClassificationModelMetadata */ + imageClassificationModelMetadata?: (google.cloud.automl.v1beta1.IImageClassificationModelMetadata|null); + + /** Model textClassificationModelMetadata */ + textClassificationModelMetadata?: (google.cloud.automl.v1beta1.ITextClassificationModelMetadata|null); + + /** Model imageObjectDetectionModelMetadata */ + imageObjectDetectionModelMetadata?: (google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata|null); + + /** Model videoClassificationModelMetadata */ + videoClassificationModelMetadata?: (google.cloud.automl.v1beta1.IVideoClassificationModelMetadata|null); + + /** Model videoObjectTrackingModelMetadata */ + videoObjectTrackingModelMetadata?: (google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata|null); + + /** Model textExtractionModelMetadata */ + textExtractionModelMetadata?: (google.cloud.automl.v1beta1.ITextExtractionModelMetadata|null); + + /** Model tablesModelMetadata */ + tablesModelMetadata?: (google.cloud.automl.v1beta1.ITablesModelMetadata|null); + + /** Model textSentimentModelMetadata */ + textSentimentModelMetadata?: (google.cloud.automl.v1beta1.ITextSentimentModelMetadata|null); + + /** Model name */ + name?: (string|null); + + /** Model displayName */ + displayName?: (string|null); + + /** Model datasetId */ + datasetId?: (string|null); + + /** Model createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Model updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Model deploymentState */ + deploymentState?: (google.cloud.automl.v1beta1.Model.DeploymentState|keyof typeof google.cloud.automl.v1beta1.Model.DeploymentState|null); + } + + /** Represents a Model. */ + class Model implements IModel { + + /** + * Constructs a new Model. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IModel); + + /** Model translationModelMetadata. */ + public translationModelMetadata?: (google.cloud.automl.v1beta1.ITranslationModelMetadata|null); + + /** Model imageClassificationModelMetadata. */ + public imageClassificationModelMetadata?: (google.cloud.automl.v1beta1.IImageClassificationModelMetadata|null); + + /** Model textClassificationModelMetadata. */ + public textClassificationModelMetadata?: (google.cloud.automl.v1beta1.ITextClassificationModelMetadata|null); + + /** Model imageObjectDetectionModelMetadata. */ + public imageObjectDetectionModelMetadata?: (google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata|null); + + /** Model videoClassificationModelMetadata. */ + public videoClassificationModelMetadata?: (google.cloud.automl.v1beta1.IVideoClassificationModelMetadata|null); + + /** Model videoObjectTrackingModelMetadata. */ + public videoObjectTrackingModelMetadata?: (google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata|null); + + /** Model textExtractionModelMetadata. */ + public textExtractionModelMetadata?: (google.cloud.automl.v1beta1.ITextExtractionModelMetadata|null); + + /** Model tablesModelMetadata. */ + public tablesModelMetadata?: (google.cloud.automl.v1beta1.ITablesModelMetadata|null); + + /** Model textSentimentModelMetadata. */ + public textSentimentModelMetadata?: (google.cloud.automl.v1beta1.ITextSentimentModelMetadata|null); + + /** Model name. */ + public name: string; + + /** Model displayName. */ + public displayName: string; + + /** Model datasetId. */ + public datasetId: string; + + /** Model createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Model updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Model deploymentState. */ + public deploymentState: (google.cloud.automl.v1beta1.Model.DeploymentState|keyof typeof google.cloud.automl.v1beta1.Model.DeploymentState); + + /** Model modelMetadata. */ + public modelMetadata?: ("translationModelMetadata"|"imageClassificationModelMetadata"|"textClassificationModelMetadata"|"imageObjectDetectionModelMetadata"|"videoClassificationModelMetadata"|"videoObjectTrackingModelMetadata"|"textExtractionModelMetadata"|"tablesModelMetadata"|"textSentimentModelMetadata"); + + /** + * Creates a new Model instance using the specified properties. + * @param [properties] Properties to set + * @returns Model instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IModel): google.cloud.automl.v1beta1.Model; + + /** + * Encodes the specified Model message. Does not implicitly {@link google.cloud.automl.v1beta1.Model.verify|verify} messages. + * @param message Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Model.verify|verify} messages. + * @param message Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Model message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.Model; + + /** + * Decodes a Model message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.Model; + + /** + * Verifies a Model message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Model message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Model + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.Model; + + /** + * Creates a plain object from a Model message. Also converts values to other types if specified. + * @param message Model + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.Model, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Model to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Model + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Model { + + /** DeploymentState enum. */ + enum DeploymentState { + DEPLOYMENT_STATE_UNSPECIFIED = 0, + DEPLOYED = 1, + UNDEPLOYED = 2 + } + } + + /** Properties of a ModelEvaluation. */ + interface IModelEvaluation { + + /** ModelEvaluation classificationEvaluationMetrics */ + classificationEvaluationMetrics?: (google.cloud.automl.v1beta1.IClassificationEvaluationMetrics|null); + + /** ModelEvaluation regressionEvaluationMetrics */ + regressionEvaluationMetrics?: (google.cloud.automl.v1beta1.IRegressionEvaluationMetrics|null); + + /** ModelEvaluation translationEvaluationMetrics */ + translationEvaluationMetrics?: (google.cloud.automl.v1beta1.ITranslationEvaluationMetrics|null); + + /** ModelEvaluation imageObjectDetectionEvaluationMetrics */ + imageObjectDetectionEvaluationMetrics?: (google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics|null); + + /** ModelEvaluation videoObjectTrackingEvaluationMetrics */ + videoObjectTrackingEvaluationMetrics?: (google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics|null); + + /** ModelEvaluation textSentimentEvaluationMetrics */ + textSentimentEvaluationMetrics?: (google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics|null); + + /** ModelEvaluation textExtractionEvaluationMetrics */ + textExtractionEvaluationMetrics?: (google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics|null); + + /** ModelEvaluation name */ + name?: (string|null); + + /** ModelEvaluation annotationSpecId */ + annotationSpecId?: (string|null); + + /** ModelEvaluation displayName */ + displayName?: (string|null); + + /** ModelEvaluation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ModelEvaluation evaluatedExampleCount */ + evaluatedExampleCount?: (number|null); + } + + /** Represents a ModelEvaluation. */ + class ModelEvaluation implements IModelEvaluation { + + /** + * Constructs a new ModelEvaluation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IModelEvaluation); + + /** ModelEvaluation classificationEvaluationMetrics. */ + public classificationEvaluationMetrics?: (google.cloud.automl.v1beta1.IClassificationEvaluationMetrics|null); + + /** ModelEvaluation regressionEvaluationMetrics. */ + public regressionEvaluationMetrics?: (google.cloud.automl.v1beta1.IRegressionEvaluationMetrics|null); + + /** ModelEvaluation translationEvaluationMetrics. */ + public translationEvaluationMetrics?: (google.cloud.automl.v1beta1.ITranslationEvaluationMetrics|null); + + /** ModelEvaluation imageObjectDetectionEvaluationMetrics. */ + public imageObjectDetectionEvaluationMetrics?: (google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics|null); + + /** ModelEvaluation videoObjectTrackingEvaluationMetrics. */ + public videoObjectTrackingEvaluationMetrics?: (google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics|null); + + /** ModelEvaluation textSentimentEvaluationMetrics. */ + public textSentimentEvaluationMetrics?: (google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics|null); + + /** ModelEvaluation textExtractionEvaluationMetrics. */ + public textExtractionEvaluationMetrics?: (google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics|null); + + /** ModelEvaluation name. */ + public name: string; + + /** ModelEvaluation annotationSpecId. */ + public annotationSpecId: string; + + /** ModelEvaluation displayName. */ + public displayName: string; + + /** ModelEvaluation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ModelEvaluation evaluatedExampleCount. */ + public evaluatedExampleCount: number; + + /** ModelEvaluation metrics. */ + public metrics?: ("classificationEvaluationMetrics"|"regressionEvaluationMetrics"|"translationEvaluationMetrics"|"imageObjectDetectionEvaluationMetrics"|"videoObjectTrackingEvaluationMetrics"|"textSentimentEvaluationMetrics"|"textExtractionEvaluationMetrics"); + + /** + * Creates a new ModelEvaluation instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelEvaluation instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IModelEvaluation): google.cloud.automl.v1beta1.ModelEvaluation; + + /** + * Encodes the specified ModelEvaluation message. Does not implicitly {@link google.cloud.automl.v1beta1.ModelEvaluation.verify|verify} messages. + * @param message ModelEvaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IModelEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelEvaluation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ModelEvaluation.verify|verify} messages. + * @param message ModelEvaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IModelEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ModelEvaluation; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ModelEvaluation; + + /** + * Verifies a ModelEvaluation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelEvaluation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelEvaluation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ModelEvaluation; + + /** + * Creates a plain object from a ModelEvaluation message. Also converts values to other types if specified. + * @param message ModelEvaluation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ModelEvaluation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelEvaluation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelEvaluation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata deleteDetails */ + deleteDetails?: (google.cloud.automl.v1beta1.IDeleteOperationMetadata|null); + + /** OperationMetadata deployModelDetails */ + deployModelDetails?: (google.cloud.automl.v1beta1.IDeployModelOperationMetadata|null); + + /** OperationMetadata undeployModelDetails */ + undeployModelDetails?: (google.cloud.automl.v1beta1.IUndeployModelOperationMetadata|null); + + /** OperationMetadata createModelDetails */ + createModelDetails?: (google.cloud.automl.v1beta1.ICreateModelOperationMetadata|null); + + /** OperationMetadata importDataDetails */ + importDataDetails?: (google.cloud.automl.v1beta1.IImportDataOperationMetadata|null); + + /** OperationMetadata batchPredictDetails */ + batchPredictDetails?: (google.cloud.automl.v1beta1.IBatchPredictOperationMetadata|null); + + /** OperationMetadata exportDataDetails */ + exportDataDetails?: (google.cloud.automl.v1beta1.IExportDataOperationMetadata|null); + + /** OperationMetadata exportModelDetails */ + exportModelDetails?: (google.cloud.automl.v1beta1.IExportModelOperationMetadata|null); + + /** OperationMetadata exportEvaluatedExamplesDetails */ + exportEvaluatedExamplesDetails?: (google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata|null); + + /** OperationMetadata progressPercent */ + progressPercent?: (number|null); + + /** OperationMetadata partialFailures */ + partialFailures?: (google.rpc.IStatus[]|null); + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IOperationMetadata); + + /** OperationMetadata deleteDetails. */ + public deleteDetails?: (google.cloud.automl.v1beta1.IDeleteOperationMetadata|null); + + /** OperationMetadata deployModelDetails. */ + public deployModelDetails?: (google.cloud.automl.v1beta1.IDeployModelOperationMetadata|null); + + /** OperationMetadata undeployModelDetails. */ + public undeployModelDetails?: (google.cloud.automl.v1beta1.IUndeployModelOperationMetadata|null); + + /** OperationMetadata createModelDetails. */ + public createModelDetails?: (google.cloud.automl.v1beta1.ICreateModelOperationMetadata|null); + + /** OperationMetadata importDataDetails. */ + public importDataDetails?: (google.cloud.automl.v1beta1.IImportDataOperationMetadata|null); + + /** OperationMetadata batchPredictDetails. */ + public batchPredictDetails?: (google.cloud.automl.v1beta1.IBatchPredictOperationMetadata|null); + + /** OperationMetadata exportDataDetails. */ + public exportDataDetails?: (google.cloud.automl.v1beta1.IExportDataOperationMetadata|null); + + /** OperationMetadata exportModelDetails. */ + public exportModelDetails?: (google.cloud.automl.v1beta1.IExportModelOperationMetadata|null); + + /** OperationMetadata exportEvaluatedExamplesDetails. */ + public exportEvaluatedExamplesDetails?: (google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata|null); + + /** OperationMetadata progressPercent. */ + public progressPercent: number; + + /** OperationMetadata partialFailures. */ + public partialFailures: google.rpc.IStatus[]; + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata details. */ + public details?: ("deleteDetails"|"deployModelDetails"|"undeployModelDetails"|"createModelDetails"|"importDataDetails"|"batchPredictDetails"|"exportDataDetails"|"exportModelDetails"|"exportEvaluatedExamplesDetails"); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IOperationMetadata): google.cloud.automl.v1beta1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationMetadata. */ + interface IDeleteOperationMetadata { + } + + /** Represents a DeleteOperationMetadata. */ + class DeleteOperationMetadata implements IDeleteOperationMetadata { + + /** + * Constructs a new DeleteOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDeleteOperationMetadata); + + /** + * Creates a new DeleteOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDeleteOperationMetadata): google.cloud.automl.v1beta1.DeleteOperationMetadata; + + /** + * Encodes the specified DeleteOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteOperationMetadata.verify|verify} messages. + * @param message DeleteOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDeleteOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteOperationMetadata.verify|verify} messages. + * @param message DeleteOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDeleteOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.DeleteOperationMetadata; + + /** + * Decodes a DeleteOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.DeleteOperationMetadata; + + /** + * Verifies a DeleteOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.DeleteOperationMetadata; + + /** + * Creates a plain object from a DeleteOperationMetadata message. Also converts values to other types if specified. + * @param message DeleteOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.DeleteOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployModelOperationMetadata. */ + interface IDeployModelOperationMetadata { + } + + /** Represents a DeployModelOperationMetadata. */ + class DeployModelOperationMetadata implements IDeployModelOperationMetadata { + + /** + * Constructs a new DeployModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDeployModelOperationMetadata); + + /** + * Creates a new DeployModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployModelOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDeployModelOperationMetadata): google.cloud.automl.v1beta1.DeployModelOperationMetadata; + + /** + * Encodes the specified DeployModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.DeployModelOperationMetadata.verify|verify} messages. + * @param message DeployModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDeployModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DeployModelOperationMetadata.verify|verify} messages. + * @param message DeployModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDeployModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.DeployModelOperationMetadata; + + /** + * Decodes a DeployModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.DeployModelOperationMetadata; + + /** + * Verifies a DeployModelOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.DeployModelOperationMetadata; + + /** + * Creates a plain object from a DeployModelOperationMetadata message. Also converts values to other types if specified. + * @param message DeployModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.DeployModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployModelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeployModelOperationMetadata. */ + interface IUndeployModelOperationMetadata { + } + + /** Represents an UndeployModelOperationMetadata. */ + class UndeployModelOperationMetadata implements IUndeployModelOperationMetadata { + + /** + * Constructs a new UndeployModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IUndeployModelOperationMetadata); + + /** + * Creates a new UndeployModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeployModelOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IUndeployModelOperationMetadata): google.cloud.automl.v1beta1.UndeployModelOperationMetadata; + + /** + * Encodes the specified UndeployModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.UndeployModelOperationMetadata.verify|verify} messages. + * @param message UndeployModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IUndeployModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeployModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.UndeployModelOperationMetadata.verify|verify} messages. + * @param message UndeployModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IUndeployModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeployModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.UndeployModelOperationMetadata; + + /** + * Decodes an UndeployModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.UndeployModelOperationMetadata; + + /** + * Verifies an UndeployModelOperationMetadata message. + * @param message Plain 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 UndeployModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeployModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.UndeployModelOperationMetadata; + + /** + * Creates a plain object from an UndeployModelOperationMetadata message. Also converts values to other types if specified. + * @param message UndeployModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.UndeployModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeployModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeployModelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateModelOperationMetadata. */ + interface ICreateModelOperationMetadata { + } + + /** Represents a CreateModelOperationMetadata. */ + class CreateModelOperationMetadata implements ICreateModelOperationMetadata { + + /** + * Constructs a new CreateModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ICreateModelOperationMetadata); + + /** + * Creates a new CreateModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateModelOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ICreateModelOperationMetadata): google.cloud.automl.v1beta1.CreateModelOperationMetadata; + + /** + * Encodes the specified CreateModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.CreateModelOperationMetadata.verify|verify} messages. + * @param message CreateModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ICreateModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CreateModelOperationMetadata.verify|verify} messages. + * @param message CreateModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ICreateModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.CreateModelOperationMetadata; + + /** + * Decodes a CreateModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.CreateModelOperationMetadata; + + /** + * Verifies a CreateModelOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.CreateModelOperationMetadata; + + /** + * Creates a plain object from a CreateModelOperationMetadata message. Also converts values to other types if specified. + * @param message CreateModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.CreateModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateModelOperationMetadata + * @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 { + } + + /** Represents an ImportDataOperationMetadata. */ + class ImportDataOperationMetadata implements IImportDataOperationMetadata { + + /** + * Constructs a new ImportDataOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImportDataOperationMetadata); + + /** + * Creates a new ImportDataOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDataOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImportDataOperationMetadata): google.cloud.automl.v1beta1.ImportDataOperationMetadata; + + /** + * Encodes the specified ImportDataOperationMetadata message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.IImportDataOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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 outputInfo */ + outputInfo?: (google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo|null); + } + + /** Represents an ExportDataOperationMetadata. */ + class ExportDataOperationMetadata implements IExportDataOperationMetadata { + + /** + * Constructs a new ExportDataOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IExportDataOperationMetadata); + + /** ExportDataOperationMetadata outputInfo. */ + public outputInfo?: (google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo|null); + + /** + * Creates a new ExportDataOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IExportDataOperationMetadata): google.cloud.automl.v1beta1.ExportDataOperationMetadata; + + /** + * Encodes the specified ExportDataOperationMetadata message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.IExportDataOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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; + } + + namespace ExportDataOperationMetadata { + + /** Properties of an ExportDataOutputInfo. */ + interface IExportDataOutputInfo { + + /** ExportDataOutputInfo gcsOutputDirectory */ + gcsOutputDirectory?: (string|null); + + /** ExportDataOutputInfo bigqueryOutputDataset */ + bigqueryOutputDataset?: (string|null); + } + + /** Represents an ExportDataOutputInfo. */ + class ExportDataOutputInfo implements IExportDataOutputInfo { + + /** + * Constructs a new ExportDataOutputInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo); + + /** ExportDataOutputInfo gcsOutputDirectory. */ + public gcsOutputDirectory?: (string|null); + + /** ExportDataOutputInfo bigqueryOutputDataset. */ + public bigqueryOutputDataset?: (string|null); + + /** ExportDataOutputInfo outputLocation. */ + public outputLocation?: ("gcsOutputDirectory"|"bigqueryOutputDataset"); + + /** + * Creates a new ExportDataOutputInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataOutputInfo instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo): google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo; + + /** + * Encodes the specified ExportDataOutputInfo message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.verify|verify} messages. + * @param message ExportDataOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.verify|verify} messages. + * @param message ExportDataOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportDataOutputInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportDataOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo; + + /** + * Decodes an ExportDataOutputInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportDataOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo; + + /** + * Verifies an ExportDataOutputInfo message. + * @param message Plain 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 ExportDataOutputInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportDataOutputInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo; + + /** + * Creates a plain object from an ExportDataOutputInfo message. Also converts values to other types if specified. + * @param message ExportDataOutputInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportDataOutputInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportDataOutputInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a BatchPredictOperationMetadata. */ + interface IBatchPredictOperationMetadata { + + /** BatchPredictOperationMetadata inputConfig */ + inputConfig?: (google.cloud.automl.v1beta1.IBatchPredictInputConfig|null); + + /** BatchPredictOperationMetadata outputInfo */ + outputInfo?: (google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo|null); + } + + /** Represents a BatchPredictOperationMetadata. */ + class BatchPredictOperationMetadata implements IBatchPredictOperationMetadata { + + /** + * Constructs a new BatchPredictOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IBatchPredictOperationMetadata); + + /** BatchPredictOperationMetadata inputConfig. */ + public inputConfig?: (google.cloud.automl.v1beta1.IBatchPredictInputConfig|null); + + /** BatchPredictOperationMetadata outputInfo. */ + public outputInfo?: (google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo|null); + + /** + * Creates a new BatchPredictOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IBatchPredictOperationMetadata): google.cloud.automl.v1beta1.BatchPredictOperationMetadata; + + /** + * Encodes the specified BatchPredictOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOperationMetadata.verify|verify} messages. + * @param message BatchPredictOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IBatchPredictOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOperationMetadata.verify|verify} messages. + * @param message BatchPredictOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IBatchPredictOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.BatchPredictOperationMetadata; + + /** + * Decodes a BatchPredictOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.BatchPredictOperationMetadata; + + /** + * Verifies a BatchPredictOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BatchPredictOperationMetadata; + + /** + * Creates a plain object from a BatchPredictOperationMetadata message. Also converts values to other types if specified. + * @param message BatchPredictOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.BatchPredictOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchPredictOperationMetadata { + + /** Properties of a BatchPredictOutputInfo. */ + interface IBatchPredictOutputInfo { + + /** BatchPredictOutputInfo gcsOutputDirectory */ + gcsOutputDirectory?: (string|null); + + /** BatchPredictOutputInfo bigqueryOutputDataset */ + bigqueryOutputDataset?: (string|null); + } + + /** Represents a BatchPredictOutputInfo. */ + class BatchPredictOutputInfo implements IBatchPredictOutputInfo { + + /** + * Constructs a new BatchPredictOutputInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo); + + /** BatchPredictOutputInfo gcsOutputDirectory. */ + public gcsOutputDirectory?: (string|null); + + /** BatchPredictOutputInfo bigqueryOutputDataset. */ + public bigqueryOutputDataset?: (string|null); + + /** BatchPredictOutputInfo outputLocation. */ + public outputLocation?: ("gcsOutputDirectory"|"bigqueryOutputDataset"); + + /** + * Creates a new BatchPredictOutputInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictOutputInfo instance + */ + public static create(properties?: google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo): google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo; + + /** + * Encodes the specified BatchPredictOutputInfo message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify|verify} messages. + * @param message BatchPredictOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify|verify} messages. + * @param message BatchPredictOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictOutputInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo; + + /** + * Decodes a BatchPredictOutputInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo; + + /** + * Verifies a BatchPredictOutputInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictOutputInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictOutputInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo; + + /** + * Creates a plain object from a BatchPredictOutputInfo message. Also converts values to other types if specified. + * @param message BatchPredictOutputInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictOutputInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictOutputInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExportModelOperationMetadata. */ + interface IExportModelOperationMetadata { + + /** ExportModelOperationMetadata outputInfo */ + outputInfo?: (google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo|null); + } + + /** Represents an ExportModelOperationMetadata. */ + class ExportModelOperationMetadata implements IExportModelOperationMetadata { + + /** + * Constructs a new ExportModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IExportModelOperationMetadata); + + /** ExportModelOperationMetadata outputInfo. */ + public outputInfo?: (google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo|null); + + /** + * Creates a new ExportModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportModelOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IExportModelOperationMetadata): google.cloud.automl.v1beta1.ExportModelOperationMetadata; + + /** + * Encodes the specified ExportModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelOperationMetadata.verify|verify} messages. + * @param message ExportModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IExportModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelOperationMetadata.verify|verify} messages. + * @param message ExportModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IExportModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ExportModelOperationMetadata; + + /** + * Decodes an ExportModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ExportModelOperationMetadata; + + /** + * Verifies an ExportModelOperationMetadata message. + * @param message Plain 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 ExportModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ExportModelOperationMetadata; + + /** + * Creates a plain object from an ExportModelOperationMetadata message. Also converts values to other types if specified. + * @param message ExportModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ExportModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportModelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportModelOperationMetadata { + + /** Properties of an ExportModelOutputInfo. */ + interface IExportModelOutputInfo { + + /** ExportModelOutputInfo gcsOutputDirectory */ + gcsOutputDirectory?: (string|null); + } + + /** Represents an ExportModelOutputInfo. */ + class ExportModelOutputInfo implements IExportModelOutputInfo { + + /** + * Constructs a new ExportModelOutputInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo); + + /** ExportModelOutputInfo gcsOutputDirectory. */ + public gcsOutputDirectory: string; + + /** + * Creates a new ExportModelOutputInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportModelOutputInfo instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo): google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo; + + /** + * Encodes the specified ExportModelOutputInfo message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo.verify|verify} messages. + * @param message ExportModelOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportModelOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo.verify|verify} messages. + * @param message ExportModelOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportModelOutputInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportModelOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo; + + /** + * Decodes an ExportModelOutputInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportModelOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo; + + /** + * Verifies an ExportModelOutputInfo message. + * @param message Plain 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 ExportModelOutputInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportModelOutputInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo; + + /** + * Creates a plain object from an ExportModelOutputInfo message. Also converts values to other types if specified. + * @param message ExportModelOutputInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportModelOutputInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportModelOutputInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExportEvaluatedExamplesOperationMetadata. */ + interface IExportEvaluatedExamplesOperationMetadata { + + /** ExportEvaluatedExamplesOperationMetadata outputInfo */ + outputInfo?: (google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo|null); + } + + /** Represents an ExportEvaluatedExamplesOperationMetadata. */ + class ExportEvaluatedExamplesOperationMetadata implements IExportEvaluatedExamplesOperationMetadata { + + /** + * Constructs a new ExportEvaluatedExamplesOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata); + + /** ExportEvaluatedExamplesOperationMetadata outputInfo. */ + public outputInfo?: (google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo|null); + + /** + * Creates a new ExportEvaluatedExamplesOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEvaluatedExamplesOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata): google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata; + + /** + * Encodes the specified ExportEvaluatedExamplesOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.verify|verify} messages. + * @param message ExportEvaluatedExamplesOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportEvaluatedExamplesOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.verify|verify} messages. + * @param message ExportEvaluatedExamplesOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportEvaluatedExamplesOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEvaluatedExamplesOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata; + + /** + * Decodes an ExportEvaluatedExamplesOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEvaluatedExamplesOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata; + + /** + * Verifies an ExportEvaluatedExamplesOperationMetadata message. + * @param message Plain 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 ExportEvaluatedExamplesOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEvaluatedExamplesOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata; + + /** + * Creates a plain object from an ExportEvaluatedExamplesOperationMetadata message. Also converts values to other types if specified. + * @param message ExportEvaluatedExamplesOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportEvaluatedExamplesOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportEvaluatedExamplesOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportEvaluatedExamplesOperationMetadata { + + /** Properties of an ExportEvaluatedExamplesOutputInfo. */ + interface IExportEvaluatedExamplesOutputInfo { + + /** ExportEvaluatedExamplesOutputInfo bigqueryOutputDataset */ + bigqueryOutputDataset?: (string|null); + } + + /** Represents an ExportEvaluatedExamplesOutputInfo. */ + class ExportEvaluatedExamplesOutputInfo implements IExportEvaluatedExamplesOutputInfo { + + /** + * Constructs a new ExportEvaluatedExamplesOutputInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo); + + /** ExportEvaluatedExamplesOutputInfo bigqueryOutputDataset. */ + public bigqueryOutputDataset: string; + + /** + * Creates a new ExportEvaluatedExamplesOutputInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEvaluatedExamplesOutputInfo instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo): google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo; + + /** + * Encodes the specified ExportEvaluatedExamplesOutputInfo message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo.verify|verify} messages. + * @param message ExportEvaluatedExamplesOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportEvaluatedExamplesOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo.verify|verify} messages. + * @param message ExportEvaluatedExamplesOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportEvaluatedExamplesOutputInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEvaluatedExamplesOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo; + + /** + * Decodes an ExportEvaluatedExamplesOutputInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEvaluatedExamplesOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo; + + /** + * Verifies an ExportEvaluatedExamplesOutputInfo message. + * @param message Plain 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 ExportEvaluatedExamplesOutputInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEvaluatedExamplesOutputInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo; + + /** + * Creates a plain object from an ExportEvaluatedExamplesOutputInfo message. Also converts values to other types if specified. + * @param message ExportEvaluatedExamplesOutputInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportEvaluatedExamplesOutputInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportEvaluatedExamplesOutputInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a PredictionService */ + class PredictionService extends $protobuf.rpc.Service { + + /** + * Constructs a new PredictionService 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 PredictionService 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): PredictionService; + + /** + * Calls Predict. + * @param request PredictRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PredictResponse + */ + public predict(request: google.cloud.automl.v1beta1.IPredictRequest, callback: google.cloud.automl.v1beta1.PredictionService.PredictCallback): void; + + /** + * Calls Predict. + * @param request PredictRequest message or plain object + * @returns Promise + */ + public predict(request: google.cloud.automl.v1beta1.IPredictRequest): Promise; + + /** + * Calls BatchPredict. + * @param request BatchPredictRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchPredict(request: google.cloud.automl.v1beta1.IBatchPredictRequest, callback: google.cloud.automl.v1beta1.PredictionService.BatchPredictCallback): void; + + /** + * Calls BatchPredict. + * @param request BatchPredictRequest message or plain object + * @returns Promise + */ + public batchPredict(request: google.cloud.automl.v1beta1.IBatchPredictRequest): Promise; + } + + namespace PredictionService { + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.PredictionService|predict}. + * @param error Error, if any + * @param [response] PredictResponse + */ + type PredictCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.PredictResponse) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.PredictionService|batchPredict}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchPredictCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a PredictRequest. */ + interface IPredictRequest { + + /** PredictRequest name */ + name?: (string|null); + + /** PredictRequest payload */ + payload?: (google.cloud.automl.v1beta1.IExamplePayload|null); + + /** PredictRequest params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents a PredictRequest. */ + class PredictRequest implements IPredictRequest { + + /** + * Constructs a new PredictRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IPredictRequest); + + /** PredictRequest name. */ + public name: string; + + /** PredictRequest payload. */ + public payload?: (google.cloud.automl.v1beta1.IExamplePayload|null); + + /** PredictRequest params. */ + public params: { [k: string]: string }; + + /** + * Creates a new PredictRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PredictRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IPredictRequest): google.cloud.automl.v1beta1.PredictRequest; + + /** + * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.PredictRequest.verify|verify} messages. + * @param message PredictRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.PredictRequest.verify|verify} messages. + * @param message PredictRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PredictRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.PredictRequest; + + /** + * Decodes a PredictRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.PredictRequest; + + /** + * Verifies a PredictRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PredictRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.PredictRequest; + + /** + * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. + * @param message PredictRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.PredictRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PredictRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PredictRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PredictResponse. */ + interface IPredictResponse { + + /** PredictResponse payload */ + payload?: (google.cloud.automl.v1beta1.IAnnotationPayload[]|null); + + /** PredictResponse preprocessedInput */ + preprocessedInput?: (google.cloud.automl.v1beta1.IExamplePayload|null); + + /** PredictResponse metadata */ + metadata?: ({ [k: string]: string }|null); + } + + /** Represents a PredictResponse. */ + class PredictResponse implements IPredictResponse { + + /** + * Constructs a new PredictResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IPredictResponse); + + /** PredictResponse payload. */ + public payload: google.cloud.automl.v1beta1.IAnnotationPayload[]; + + /** PredictResponse preprocessedInput. */ + public preprocessedInput?: (google.cloud.automl.v1beta1.IExamplePayload|null); + + /** PredictResponse metadata. */ + public metadata: { [k: string]: string }; + + /** + * Creates a new PredictResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PredictResponse instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IPredictResponse): google.cloud.automl.v1beta1.PredictResponse; + + /** + * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.PredictResponse.verify|verify} messages. + * @param message PredictResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.PredictResponse.verify|verify} messages. + * @param message PredictResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PredictResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PredictResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.PredictResponse; + + /** + * Decodes a PredictResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PredictResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.PredictResponse; + + /** + * Verifies a PredictResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PredictResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.PredictResponse; + + /** + * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. + * @param message PredictResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.PredictResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PredictResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PredictResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchPredictRequest. */ + interface IBatchPredictRequest { + + /** BatchPredictRequest name */ + name?: (string|null); + + /** BatchPredictRequest inputConfig */ + inputConfig?: (google.cloud.automl.v1beta1.IBatchPredictInputConfig|null); + + /** BatchPredictRequest outputConfig */ + outputConfig?: (google.cloud.automl.v1beta1.IBatchPredictOutputConfig|null); + + /** BatchPredictRequest params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents a BatchPredictRequest. */ + class BatchPredictRequest implements IBatchPredictRequest { + + /** + * Constructs a new BatchPredictRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IBatchPredictRequest); + + /** BatchPredictRequest name. */ + public name: string; + + /** BatchPredictRequest inputConfig. */ + public inputConfig?: (google.cloud.automl.v1beta1.IBatchPredictInputConfig|null); + + /** BatchPredictRequest outputConfig. */ + public outputConfig?: (google.cloud.automl.v1beta1.IBatchPredictOutputConfig|null); + + /** BatchPredictRequest params. */ + public params: { [k: string]: string }; + + /** + * Creates a new BatchPredictRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IBatchPredictRequest): google.cloud.automl.v1beta1.BatchPredictRequest; + + /** + * Encodes the specified BatchPredictRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictRequest.verify|verify} messages. + * @param message BatchPredictRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IBatchPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictRequest.verify|verify} messages. + * @param message BatchPredictRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IBatchPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.BatchPredictRequest; + + /** + * Decodes a BatchPredictRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.BatchPredictRequest; + + /** + * Verifies a BatchPredictRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BatchPredictRequest; + + /** + * Creates a plain object from a BatchPredictRequest message. Also converts values to other types if specified. + * @param message BatchPredictRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.BatchPredictRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchPredictResult. */ + interface IBatchPredictResult { + + /** BatchPredictResult metadata */ + metadata?: ({ [k: string]: string }|null); + } + + /** Represents a BatchPredictResult. */ + class BatchPredictResult implements IBatchPredictResult { + + /** + * Constructs a new BatchPredictResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IBatchPredictResult); + + /** BatchPredictResult metadata. */ + public metadata: { [k: string]: string }; + + /** + * Creates a new BatchPredictResult instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictResult instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IBatchPredictResult): google.cloud.automl.v1beta1.BatchPredictResult; + + /** + * Encodes the specified BatchPredictResult message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictResult.verify|verify} messages. + * @param message BatchPredictResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IBatchPredictResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictResult message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictResult.verify|verify} messages. + * @param message BatchPredictResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IBatchPredictResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.BatchPredictResult; + + /** + * Decodes a BatchPredictResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.BatchPredictResult; + + /** + * Verifies a BatchPredictResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BatchPredictResult; + + /** + * Creates a plain object from a BatchPredictResult message. Also converts values to other types if specified. + * @param message BatchPredictResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.BatchPredictResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an AutoMl */ + class AutoMl extends $protobuf.rpc.Service { + + /** + * Constructs a new AutoMl 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 AutoMl 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): AutoMl; + + /** + * 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.automl.v1beta1.ICreateDatasetRequest, callback: google.cloud.automl.v1beta1.AutoMl.CreateDatasetCallback): void; + + /** + * Calls CreateDataset. + * @param request CreateDatasetRequest message or plain object + * @returns Promise + */ + public createDataset(request: google.cloud.automl.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.automl.v1beta1.IGetDatasetRequest, callback: google.cloud.automl.v1beta1.AutoMl.GetDatasetCallback): void; + + /** + * Calls GetDataset. + * @param request GetDatasetRequest message or plain object + * @returns Promise + */ + public getDataset(request: google.cloud.automl.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.automl.v1beta1.IListDatasetsRequest, callback: google.cloud.automl.v1beta1.AutoMl.ListDatasetsCallback): void; + + /** + * Calls ListDatasets. + * @param request ListDatasetsRequest message or plain object + * @returns Promise + */ + public listDatasets(request: google.cloud.automl.v1beta1.IListDatasetsRequest): Promise; + + /** + * Calls UpdateDataset. + * @param request UpdateDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dataset + */ + public updateDataset(request: google.cloud.automl.v1beta1.IUpdateDatasetRequest, callback: google.cloud.automl.v1beta1.AutoMl.UpdateDatasetCallback): void; + + /** + * Calls UpdateDataset. + * @param request UpdateDatasetRequest message or plain object + * @returns Promise + */ + public updateDataset(request: google.cloud.automl.v1beta1.IUpdateDatasetRequest): Promise; + + /** + * Calls DeleteDataset. + * @param request DeleteDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteDataset(request: google.cloud.automl.v1beta1.IDeleteDatasetRequest, callback: google.cloud.automl.v1beta1.AutoMl.DeleteDatasetCallback): void; + + /** + * Calls DeleteDataset. + * @param request DeleteDatasetRequest message or plain object + * @returns Promise + */ + public deleteDataset(request: google.cloud.automl.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.automl.v1beta1.IImportDataRequest, callback: google.cloud.automl.v1beta1.AutoMl.ImportDataCallback): void; + + /** + * Calls ImportData. + * @param request ImportDataRequest message or plain object + * @returns Promise + */ + public importData(request: google.cloud.automl.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.automl.v1beta1.IExportDataRequest, callback: google.cloud.automl.v1beta1.AutoMl.ExportDataCallback): void; + + /** + * Calls ExportData. + * @param request ExportDataRequest message or plain object + * @returns Promise + */ + public exportData(request: google.cloud.automl.v1beta1.IExportDataRequest): Promise; + + /** + * Calls GetAnnotationSpec. + * @param request GetAnnotationSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnnotationSpec + */ + public getAnnotationSpec(request: google.cloud.automl.v1beta1.IGetAnnotationSpecRequest, callback: google.cloud.automl.v1beta1.AutoMl.GetAnnotationSpecCallback): void; + + /** + * Calls GetAnnotationSpec. + * @param request GetAnnotationSpecRequest message or plain object + * @returns Promise + */ + public getAnnotationSpec(request: google.cloud.automl.v1beta1.IGetAnnotationSpecRequest): Promise; + + /** + * Calls GetTableSpec. + * @param request GetTableSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TableSpec + */ + public getTableSpec(request: google.cloud.automl.v1beta1.IGetTableSpecRequest, callback: google.cloud.automl.v1beta1.AutoMl.GetTableSpecCallback): void; + + /** + * Calls GetTableSpec. + * @param request GetTableSpecRequest message or plain object + * @returns Promise + */ + public getTableSpec(request: google.cloud.automl.v1beta1.IGetTableSpecRequest): Promise; + + /** + * Calls ListTableSpecs. + * @param request ListTableSpecsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTableSpecsResponse + */ + public listTableSpecs(request: google.cloud.automl.v1beta1.IListTableSpecsRequest, callback: google.cloud.automl.v1beta1.AutoMl.ListTableSpecsCallback): void; + + /** + * Calls ListTableSpecs. + * @param request ListTableSpecsRequest message or plain object + * @returns Promise + */ + public listTableSpecs(request: google.cloud.automl.v1beta1.IListTableSpecsRequest): Promise; + + /** + * Calls UpdateTableSpec. + * @param request UpdateTableSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TableSpec + */ + public updateTableSpec(request: google.cloud.automl.v1beta1.IUpdateTableSpecRequest, callback: google.cloud.automl.v1beta1.AutoMl.UpdateTableSpecCallback): void; + + /** + * Calls UpdateTableSpec. + * @param request UpdateTableSpecRequest message or plain object + * @returns Promise + */ + public updateTableSpec(request: google.cloud.automl.v1beta1.IUpdateTableSpecRequest): Promise; + + /** + * Calls GetColumnSpec. + * @param request GetColumnSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ColumnSpec + */ + public getColumnSpec(request: google.cloud.automl.v1beta1.IGetColumnSpecRequest, callback: google.cloud.automl.v1beta1.AutoMl.GetColumnSpecCallback): void; + + /** + * Calls GetColumnSpec. + * @param request GetColumnSpecRequest message or plain object + * @returns Promise + */ + public getColumnSpec(request: google.cloud.automl.v1beta1.IGetColumnSpecRequest): Promise; + + /** + * Calls ListColumnSpecs. + * @param request ListColumnSpecsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListColumnSpecsResponse + */ + public listColumnSpecs(request: google.cloud.automl.v1beta1.IListColumnSpecsRequest, callback: google.cloud.automl.v1beta1.AutoMl.ListColumnSpecsCallback): void; + + /** + * Calls ListColumnSpecs. + * @param request ListColumnSpecsRequest message or plain object + * @returns Promise + */ + public listColumnSpecs(request: google.cloud.automl.v1beta1.IListColumnSpecsRequest): Promise; + + /** + * Calls UpdateColumnSpec. + * @param request UpdateColumnSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ColumnSpec + */ + public updateColumnSpec(request: google.cloud.automl.v1beta1.IUpdateColumnSpecRequest, callback: google.cloud.automl.v1beta1.AutoMl.UpdateColumnSpecCallback): void; + + /** + * Calls UpdateColumnSpec. + * @param request UpdateColumnSpecRequest message or plain object + * @returns Promise + */ + public updateColumnSpec(request: google.cloud.automl.v1beta1.IUpdateColumnSpecRequest): Promise; + + /** + * Calls CreateModel. + * @param request CreateModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createModel(request: google.cloud.automl.v1beta1.ICreateModelRequest, callback: google.cloud.automl.v1beta1.AutoMl.CreateModelCallback): void; + + /** + * Calls CreateModel. + * @param request CreateModelRequest message or plain object + * @returns Promise + */ + public createModel(request: google.cloud.automl.v1beta1.ICreateModelRequest): Promise; + + /** + * Calls GetModel. + * @param request GetModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Model + */ + public getModel(request: google.cloud.automl.v1beta1.IGetModelRequest, callback: google.cloud.automl.v1beta1.AutoMl.GetModelCallback): void; + + /** + * Calls GetModel. + * @param request GetModelRequest message or plain object + * @returns Promise + */ + public getModel(request: google.cloud.automl.v1beta1.IGetModelRequest): Promise; + + /** + * Calls ListModels. + * @param request ListModelsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListModelsResponse + */ + public listModels(request: google.cloud.automl.v1beta1.IListModelsRequest, callback: google.cloud.automl.v1beta1.AutoMl.ListModelsCallback): void; + + /** + * Calls ListModels. + * @param request ListModelsRequest message or plain object + * @returns Promise + */ + public listModels(request: google.cloud.automl.v1beta1.IListModelsRequest): Promise; + + /** + * Calls DeleteModel. + * @param request DeleteModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteModel(request: google.cloud.automl.v1beta1.IDeleteModelRequest, callback: google.cloud.automl.v1beta1.AutoMl.DeleteModelCallback): void; + + /** + * Calls DeleteModel. + * @param request DeleteModelRequest message or plain object + * @returns Promise + */ + public deleteModel(request: google.cloud.automl.v1beta1.IDeleteModelRequest): Promise; + + /** + * Calls DeployModel. + * @param request DeployModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deployModel(request: google.cloud.automl.v1beta1.IDeployModelRequest, callback: google.cloud.automl.v1beta1.AutoMl.DeployModelCallback): void; + + /** + * Calls DeployModel. + * @param request DeployModelRequest message or plain object + * @returns Promise + */ + public deployModel(request: google.cloud.automl.v1beta1.IDeployModelRequest): Promise; + + /** + * Calls UndeployModel. + * @param request UndeployModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public undeployModel(request: google.cloud.automl.v1beta1.IUndeployModelRequest, callback: google.cloud.automl.v1beta1.AutoMl.UndeployModelCallback): void; + + /** + * Calls UndeployModel. + * @param request UndeployModelRequest message or plain object + * @returns Promise + */ + public undeployModel(request: google.cloud.automl.v1beta1.IUndeployModelRequest): Promise; + + /** + * Calls ExportModel. + * @param request ExportModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportModel(request: google.cloud.automl.v1beta1.IExportModelRequest, callback: google.cloud.automl.v1beta1.AutoMl.ExportModelCallback): void; + + /** + * Calls ExportModel. + * @param request ExportModelRequest message or plain object + * @returns Promise + */ + public exportModel(request: google.cloud.automl.v1beta1.IExportModelRequest): Promise; + + /** + * Calls ExportEvaluatedExamples. + * @param request ExportEvaluatedExamplesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportEvaluatedExamples(request: google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest, callback: google.cloud.automl.v1beta1.AutoMl.ExportEvaluatedExamplesCallback): void; + + /** + * Calls ExportEvaluatedExamples. + * @param request ExportEvaluatedExamplesRequest message or plain object + * @returns Promise + */ + public exportEvaluatedExamples(request: google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest): Promise; + + /** + * Calls GetModelEvaluation. + * @param request GetModelEvaluationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ModelEvaluation + */ + public getModelEvaluation(request: google.cloud.automl.v1beta1.IGetModelEvaluationRequest, callback: google.cloud.automl.v1beta1.AutoMl.GetModelEvaluationCallback): void; + + /** + * Calls GetModelEvaluation. + * @param request GetModelEvaluationRequest message or plain object + * @returns Promise + */ + public getModelEvaluation(request: google.cloud.automl.v1beta1.IGetModelEvaluationRequest): Promise; + + /** + * Calls ListModelEvaluations. + * @param request ListModelEvaluationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListModelEvaluationsResponse + */ + public listModelEvaluations(request: google.cloud.automl.v1beta1.IListModelEvaluationsRequest, callback: google.cloud.automl.v1beta1.AutoMl.ListModelEvaluationsCallback): void; + + /** + * Calls ListModelEvaluations. + * @param request ListModelEvaluationsRequest message or plain object + * @returns Promise + */ + public listModelEvaluations(request: google.cloud.automl.v1beta1.IListModelEvaluationsRequest): Promise; + } + + namespace AutoMl { + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|createDataset}. + * @param error Error, if any + * @param [response] Dataset + */ + type CreateDatasetCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.Dataset) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getDataset}. + * @param error Error, if any + * @param [response] Dataset + */ + type GetDatasetCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.Dataset) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|listDatasets}. + * @param error Error, if any + * @param [response] ListDatasetsResponse + */ + type ListDatasetsCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.ListDatasetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|updateDataset}. + * @param error Error, if any + * @param [response] Dataset + */ + type UpdateDatasetCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.Dataset) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|deleteDataset}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteDatasetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|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.automl.v1beta1.AutoMl|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.automl.v1beta1.AutoMl|getAnnotationSpec}. + * @param error Error, if any + * @param [response] AnnotationSpec + */ + type GetAnnotationSpecCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.AnnotationSpec) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getTableSpec}. + * @param error Error, if any + * @param [response] TableSpec + */ + type GetTableSpecCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.TableSpec) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|listTableSpecs}. + * @param error Error, if any + * @param [response] ListTableSpecsResponse + */ + type ListTableSpecsCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.ListTableSpecsResponse) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|updateTableSpec}. + * @param error Error, if any + * @param [response] TableSpec + */ + type UpdateTableSpecCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.TableSpec) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getColumnSpec}. + * @param error Error, if any + * @param [response] ColumnSpec + */ + type GetColumnSpecCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.ColumnSpec) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|listColumnSpecs}. + * @param error Error, if any + * @param [response] ListColumnSpecsResponse + */ + type ListColumnSpecsCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.ListColumnSpecsResponse) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|updateColumnSpec}. + * @param error Error, if any + * @param [response] ColumnSpec + */ + type UpdateColumnSpecCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.ColumnSpec) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|createModel}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getModel}. + * @param error Error, if any + * @param [response] Model + */ + type GetModelCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.Model) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|listModels}. + * @param error Error, if any + * @param [response] ListModelsResponse + */ + type ListModelsCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.ListModelsResponse) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|deleteModel}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|deployModel}. + * @param error Error, if any + * @param [response] Operation + */ + type DeployModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|undeployModel}. + * @param error Error, if any + * @param [response] Operation + */ + type UndeployModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|exportModel}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|exportEvaluatedExamples}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportEvaluatedExamplesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getModelEvaluation}. + * @param error Error, if any + * @param [response] ModelEvaluation + */ + type GetModelEvaluationCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.ModelEvaluation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|listModelEvaluations}. + * @param error Error, if any + * @param [response] ListModelEvaluationsResponse + */ + type ListModelEvaluationsCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.ListModelEvaluationsResponse) => void; + } + + /** Properties of a CreateDatasetRequest. */ + interface ICreateDatasetRequest { + + /** CreateDatasetRequest parent */ + parent?: (string|null); + + /** CreateDatasetRequest dataset */ + dataset?: (google.cloud.automl.v1beta1.IDataset|null); + } + + /** Represents a CreateDatasetRequest. */ + class CreateDatasetRequest implements ICreateDatasetRequest { + + /** + * Constructs a new CreateDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ICreateDatasetRequest); + + /** CreateDatasetRequest parent. */ + public parent: string; + + /** CreateDatasetRequest dataset. */ + public dataset?: (google.cloud.automl.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.automl.v1beta1.ICreateDatasetRequest): google.cloud.automl.v1beta1.CreateDatasetRequest; + + /** + * Encodes the specified CreateDatasetRequest message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.ICreateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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.automl.v1beta1.IGetDatasetRequest): google.cloud.automl.v1beta1.GetDatasetRequest; + + /** + * Encodes the specified GetDatasetRequest message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.IGetDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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.automl.v1beta1.IListDatasetsRequest): google.cloud.automl.v1beta1.ListDatasetsRequest; + + /** + * Encodes the specified ListDatasetsRequest message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.IListDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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.automl.v1beta1.IListDatasetsResponse); + + /** ListDatasetsResponse datasets. */ + public datasets: google.cloud.automl.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.automl.v1beta1.IListDatasetsResponse): google.cloud.automl.v1beta1.ListDatasetsResponse; + + /** + * Encodes the specified ListDatasetsResponse message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.IListDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatasetsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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 an UpdateDatasetRequest. */ + interface IUpdateDatasetRequest { + + /** UpdateDatasetRequest dataset */ + dataset?: (google.cloud.automl.v1beta1.IDataset|null); + + /** UpdateDatasetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDatasetRequest. */ + class UpdateDatasetRequest implements IUpdateDatasetRequest { + + /** + * Constructs a new UpdateDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IUpdateDatasetRequest); + + /** UpdateDatasetRequest dataset. */ + public dataset?: (google.cloud.automl.v1beta1.IDataset|null); + + /** UpdateDatasetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDatasetRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IUpdateDatasetRequest): google.cloud.automl.v1beta1.UpdateDatasetRequest; + + /** + * Encodes the specified UpdateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateDatasetRequest.verify|verify} messages. + * @param message UpdateDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IUpdateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateDatasetRequest.verify|verify} messages. + * @param message UpdateDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IUpdateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.UpdateDatasetRequest; + + /** + * Decodes an UpdateDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.UpdateDatasetRequest; + + /** + * Verifies an UpdateDatasetRequest message. + * @param message Plain 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 UpdateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.UpdateDatasetRequest; + + /** + * Creates a plain object from an UpdateDatasetRequest message. Also converts values to other types if specified. + * @param message UpdateDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.UpdateDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDatasetRequest + * @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.automl.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.automl.v1beta1.IDeleteDatasetRequest): google.cloud.automl.v1beta1.DeleteDatasetRequest; + + /** + * Encodes the specified DeleteDatasetRequest message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.IDeleteDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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.automl.v1beta1.IInputConfig|null); + } + + /** Represents an ImportDataRequest. */ + class ImportDataRequest implements IImportDataRequest { + + /** + * Constructs a new ImportDataRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImportDataRequest); + + /** ImportDataRequest name. */ + public name: string; + + /** ImportDataRequest inputConfig. */ + public inputConfig?: (google.cloud.automl.v1beta1.IInputConfig|null); + + /** + * Creates a new ImportDataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDataRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImportDataRequest): google.cloud.automl.v1beta1.ImportDataRequest; + + /** + * Encodes the specified ImportDataRequest message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.IImportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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 outputConfig */ + outputConfig?: (google.cloud.automl.v1beta1.IOutputConfig|null); + } + + /** Represents an ExportDataRequest. */ + class ExportDataRequest implements IExportDataRequest { + + /** + * Constructs a new ExportDataRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IExportDataRequest); + + /** ExportDataRequest name. */ + public name: string; + + /** ExportDataRequest outputConfig. */ + public outputConfig?: (google.cloud.automl.v1beta1.IOutputConfig|null); + + /** + * Creates a new ExportDataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IExportDataRequest): google.cloud.automl.v1beta1.ExportDataRequest; + + /** + * Encodes the specified ExportDataRequest message. Does not implicitly {@link google.cloud.automl.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.automl.v1beta1.IExportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.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 GetAnnotationSpecRequest. */ + interface IGetAnnotationSpecRequest { + + /** GetAnnotationSpecRequest name */ + name?: (string|null); + } + + /** Represents a GetAnnotationSpecRequest. */ + class GetAnnotationSpecRequest implements IGetAnnotationSpecRequest { + + /** + * Constructs a new GetAnnotationSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IGetAnnotationSpecRequest); + + /** GetAnnotationSpecRequest name. */ + public name: string; + + /** + * Creates a new GetAnnotationSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAnnotationSpecRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IGetAnnotationSpecRequest): google.cloud.automl.v1beta1.GetAnnotationSpecRequest; + + /** + * Encodes the specified GetAnnotationSpecRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetAnnotationSpecRequest.verify|verify} messages. + * @param message GetAnnotationSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IGetAnnotationSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAnnotationSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetAnnotationSpecRequest.verify|verify} messages. + * @param message GetAnnotationSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IGetAnnotationSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAnnotationSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAnnotationSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.GetAnnotationSpecRequest; + + /** + * Decodes a GetAnnotationSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAnnotationSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.GetAnnotationSpecRequest; + + /** + * Verifies a GetAnnotationSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAnnotationSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAnnotationSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.GetAnnotationSpecRequest; + + /** + * Creates a plain object from a GetAnnotationSpecRequest message. Also converts values to other types if specified. + * @param message GetAnnotationSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.GetAnnotationSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAnnotationSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAnnotationSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTableSpecRequest. */ + interface IGetTableSpecRequest { + + /** GetTableSpecRequest name */ + name?: (string|null); + + /** GetTableSpecRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a GetTableSpecRequest. */ + class GetTableSpecRequest implements IGetTableSpecRequest { + + /** + * Constructs a new GetTableSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IGetTableSpecRequest); + + /** GetTableSpecRequest name. */ + public name: string; + + /** GetTableSpecRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new GetTableSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTableSpecRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IGetTableSpecRequest): google.cloud.automl.v1beta1.GetTableSpecRequest; + + /** + * Encodes the specified GetTableSpecRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetTableSpecRequest.verify|verify} messages. + * @param message GetTableSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IGetTableSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTableSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetTableSpecRequest.verify|verify} messages. + * @param message GetTableSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IGetTableSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTableSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTableSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.GetTableSpecRequest; + + /** + * Decodes a GetTableSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTableSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.GetTableSpecRequest; + + /** + * Verifies a GetTableSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTableSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTableSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.GetTableSpecRequest; + + /** + * Creates a plain object from a GetTableSpecRequest message. Also converts values to other types if specified. + * @param message GetTableSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.GetTableSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTableSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTableSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTableSpecsRequest. */ + interface IListTableSpecsRequest { + + /** ListTableSpecsRequest parent */ + parent?: (string|null); + + /** ListTableSpecsRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListTableSpecsRequest filter */ + filter?: (string|null); + + /** ListTableSpecsRequest pageSize */ + pageSize?: (number|null); + + /** ListTableSpecsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTableSpecsRequest. */ + class ListTableSpecsRequest implements IListTableSpecsRequest { + + /** + * Constructs a new ListTableSpecsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IListTableSpecsRequest); + + /** ListTableSpecsRequest parent. */ + public parent: string; + + /** ListTableSpecsRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListTableSpecsRequest filter. */ + public filter: string; + + /** ListTableSpecsRequest pageSize. */ + public pageSize: number; + + /** ListTableSpecsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTableSpecsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTableSpecsRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IListTableSpecsRequest): google.cloud.automl.v1beta1.ListTableSpecsRequest; + + /** + * Encodes the specified ListTableSpecsRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ListTableSpecsRequest.verify|verify} messages. + * @param message ListTableSpecsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IListTableSpecsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTableSpecsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListTableSpecsRequest.verify|verify} messages. + * @param message ListTableSpecsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IListTableSpecsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTableSpecsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTableSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ListTableSpecsRequest; + + /** + * Decodes a ListTableSpecsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTableSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ListTableSpecsRequest; + + /** + * Verifies a ListTableSpecsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTableSpecsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTableSpecsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ListTableSpecsRequest; + + /** + * Creates a plain object from a ListTableSpecsRequest message. Also converts values to other types if specified. + * @param message ListTableSpecsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ListTableSpecsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTableSpecsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTableSpecsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTableSpecsResponse. */ + interface IListTableSpecsResponse { + + /** ListTableSpecsResponse tableSpecs */ + tableSpecs?: (google.cloud.automl.v1beta1.ITableSpec[]|null); + + /** ListTableSpecsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTableSpecsResponse. */ + class ListTableSpecsResponse implements IListTableSpecsResponse { + + /** + * Constructs a new ListTableSpecsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IListTableSpecsResponse); + + /** ListTableSpecsResponse tableSpecs. */ + public tableSpecs: google.cloud.automl.v1beta1.ITableSpec[]; + + /** ListTableSpecsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTableSpecsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTableSpecsResponse instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IListTableSpecsResponse): google.cloud.automl.v1beta1.ListTableSpecsResponse; + + /** + * Encodes the specified ListTableSpecsResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.ListTableSpecsResponse.verify|verify} messages. + * @param message ListTableSpecsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IListTableSpecsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTableSpecsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListTableSpecsResponse.verify|verify} messages. + * @param message ListTableSpecsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IListTableSpecsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTableSpecsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTableSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ListTableSpecsResponse; + + /** + * Decodes a ListTableSpecsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTableSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ListTableSpecsResponse; + + /** + * Verifies a ListTableSpecsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTableSpecsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTableSpecsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ListTableSpecsResponse; + + /** + * Creates a plain object from a ListTableSpecsResponse message. Also converts values to other types if specified. + * @param message ListTableSpecsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ListTableSpecsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTableSpecsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTableSpecsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTableSpecRequest. */ + interface IUpdateTableSpecRequest { + + /** UpdateTableSpecRequest tableSpec */ + tableSpec?: (google.cloud.automl.v1beta1.ITableSpec|null); + + /** UpdateTableSpecRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateTableSpecRequest. */ + class UpdateTableSpecRequest implements IUpdateTableSpecRequest { + + /** + * Constructs a new UpdateTableSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IUpdateTableSpecRequest); + + /** UpdateTableSpecRequest tableSpec. */ + public tableSpec?: (google.cloud.automl.v1beta1.ITableSpec|null); + + /** UpdateTableSpecRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateTableSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTableSpecRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IUpdateTableSpecRequest): google.cloud.automl.v1beta1.UpdateTableSpecRequest; + + /** + * Encodes the specified UpdateTableSpecRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateTableSpecRequest.verify|verify} messages. + * @param message UpdateTableSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IUpdateTableSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTableSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateTableSpecRequest.verify|verify} messages. + * @param message UpdateTableSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IUpdateTableSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTableSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTableSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.UpdateTableSpecRequest; + + /** + * Decodes an UpdateTableSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTableSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.UpdateTableSpecRequest; + + /** + * Verifies an UpdateTableSpecRequest message. + * @param message Plain 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 UpdateTableSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTableSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.UpdateTableSpecRequest; + + /** + * Creates a plain object from an UpdateTableSpecRequest message. Also converts values to other types if specified. + * @param message UpdateTableSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.UpdateTableSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTableSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTableSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetColumnSpecRequest. */ + interface IGetColumnSpecRequest { + + /** GetColumnSpecRequest name */ + name?: (string|null); + + /** GetColumnSpecRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a GetColumnSpecRequest. */ + class GetColumnSpecRequest implements IGetColumnSpecRequest { + + /** + * Constructs a new GetColumnSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IGetColumnSpecRequest); + + /** GetColumnSpecRequest name. */ + public name: string; + + /** GetColumnSpecRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new GetColumnSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetColumnSpecRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IGetColumnSpecRequest): google.cloud.automl.v1beta1.GetColumnSpecRequest; + + /** + * Encodes the specified GetColumnSpecRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetColumnSpecRequest.verify|verify} messages. + * @param message GetColumnSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IGetColumnSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetColumnSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetColumnSpecRequest.verify|verify} messages. + * @param message GetColumnSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IGetColumnSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetColumnSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetColumnSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.GetColumnSpecRequest; + + /** + * Decodes a GetColumnSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetColumnSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.GetColumnSpecRequest; + + /** + * Verifies a GetColumnSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetColumnSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetColumnSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.GetColumnSpecRequest; + + /** + * Creates a plain object from a GetColumnSpecRequest message. Also converts values to other types if specified. + * @param message GetColumnSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.GetColumnSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetColumnSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetColumnSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListColumnSpecsRequest. */ + interface IListColumnSpecsRequest { + + /** ListColumnSpecsRequest parent */ + parent?: (string|null); + + /** ListColumnSpecsRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListColumnSpecsRequest filter */ + filter?: (string|null); + + /** ListColumnSpecsRequest pageSize */ + pageSize?: (number|null); + + /** ListColumnSpecsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListColumnSpecsRequest. */ + class ListColumnSpecsRequest implements IListColumnSpecsRequest { + + /** + * Constructs a new ListColumnSpecsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IListColumnSpecsRequest); + + /** ListColumnSpecsRequest parent. */ + public parent: string; + + /** ListColumnSpecsRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListColumnSpecsRequest filter. */ + public filter: string; + + /** ListColumnSpecsRequest pageSize. */ + public pageSize: number; + + /** ListColumnSpecsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListColumnSpecsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListColumnSpecsRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IListColumnSpecsRequest): google.cloud.automl.v1beta1.ListColumnSpecsRequest; + + /** + * Encodes the specified ListColumnSpecsRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ListColumnSpecsRequest.verify|verify} messages. + * @param message ListColumnSpecsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IListColumnSpecsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListColumnSpecsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListColumnSpecsRequest.verify|verify} messages. + * @param message ListColumnSpecsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IListColumnSpecsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListColumnSpecsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListColumnSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ListColumnSpecsRequest; + + /** + * Decodes a ListColumnSpecsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListColumnSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ListColumnSpecsRequest; + + /** + * Verifies a ListColumnSpecsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListColumnSpecsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListColumnSpecsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ListColumnSpecsRequest; + + /** + * Creates a plain object from a ListColumnSpecsRequest message. Also converts values to other types if specified. + * @param message ListColumnSpecsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ListColumnSpecsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListColumnSpecsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListColumnSpecsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListColumnSpecsResponse. */ + interface IListColumnSpecsResponse { + + /** ListColumnSpecsResponse columnSpecs */ + columnSpecs?: (google.cloud.automl.v1beta1.IColumnSpec[]|null); + + /** ListColumnSpecsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListColumnSpecsResponse. */ + class ListColumnSpecsResponse implements IListColumnSpecsResponse { + + /** + * Constructs a new ListColumnSpecsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IListColumnSpecsResponse); + + /** ListColumnSpecsResponse columnSpecs. */ + public columnSpecs: google.cloud.automl.v1beta1.IColumnSpec[]; + + /** ListColumnSpecsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListColumnSpecsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListColumnSpecsResponse instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IListColumnSpecsResponse): google.cloud.automl.v1beta1.ListColumnSpecsResponse; + + /** + * Encodes the specified ListColumnSpecsResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.ListColumnSpecsResponse.verify|verify} messages. + * @param message ListColumnSpecsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IListColumnSpecsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListColumnSpecsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListColumnSpecsResponse.verify|verify} messages. + * @param message ListColumnSpecsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IListColumnSpecsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListColumnSpecsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListColumnSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ListColumnSpecsResponse; + + /** + * Decodes a ListColumnSpecsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListColumnSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ListColumnSpecsResponse; + + /** + * Verifies a ListColumnSpecsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListColumnSpecsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListColumnSpecsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ListColumnSpecsResponse; + + /** + * Creates a plain object from a ListColumnSpecsResponse message. Also converts values to other types if specified. + * @param message ListColumnSpecsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ListColumnSpecsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListColumnSpecsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListColumnSpecsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateColumnSpecRequest. */ + interface IUpdateColumnSpecRequest { + + /** UpdateColumnSpecRequest columnSpec */ + columnSpec?: (google.cloud.automl.v1beta1.IColumnSpec|null); + + /** UpdateColumnSpecRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateColumnSpecRequest. */ + class UpdateColumnSpecRequest implements IUpdateColumnSpecRequest { + + /** + * Constructs a new UpdateColumnSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IUpdateColumnSpecRequest); + + /** UpdateColumnSpecRequest columnSpec. */ + public columnSpec?: (google.cloud.automl.v1beta1.IColumnSpec|null); + + /** UpdateColumnSpecRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateColumnSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateColumnSpecRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IUpdateColumnSpecRequest): google.cloud.automl.v1beta1.UpdateColumnSpecRequest; + + /** + * Encodes the specified UpdateColumnSpecRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateColumnSpecRequest.verify|verify} messages. + * @param message UpdateColumnSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IUpdateColumnSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateColumnSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateColumnSpecRequest.verify|verify} messages. + * @param message UpdateColumnSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IUpdateColumnSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateColumnSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateColumnSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.UpdateColumnSpecRequest; + + /** + * Decodes an UpdateColumnSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateColumnSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.UpdateColumnSpecRequest; + + /** + * Verifies an UpdateColumnSpecRequest message. + * @param message Plain 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 UpdateColumnSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateColumnSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.UpdateColumnSpecRequest; + + /** + * Creates a plain object from an UpdateColumnSpecRequest message. Also converts values to other types if specified. + * @param message UpdateColumnSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.UpdateColumnSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateColumnSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateColumnSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateModelRequest. */ + interface ICreateModelRequest { + + /** CreateModelRequest parent */ + parent?: (string|null); + + /** CreateModelRequest model */ + model?: (google.cloud.automl.v1beta1.IModel|null); + } + + /** Represents a CreateModelRequest. */ + class CreateModelRequest implements ICreateModelRequest { + + /** + * Constructs a new CreateModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ICreateModelRequest); + + /** CreateModelRequest parent. */ + public parent: string; + + /** CreateModelRequest model. */ + public model?: (google.cloud.automl.v1beta1.IModel|null); + + /** + * Creates a new CreateModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ICreateModelRequest): google.cloud.automl.v1beta1.CreateModelRequest; + + /** + * Encodes the specified CreateModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.CreateModelRequest.verify|verify} messages. + * @param message CreateModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ICreateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CreateModelRequest.verify|verify} messages. + * @param message CreateModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ICreateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.CreateModelRequest; + + /** + * Decodes a CreateModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.CreateModelRequest; + + /** + * Verifies a CreateModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.CreateModelRequest; + + /** + * Creates a plain object from a CreateModelRequest message. Also converts values to other types if specified. + * @param message CreateModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.CreateModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetModelRequest. */ + interface IGetModelRequest { + + /** GetModelRequest name */ + name?: (string|null); + } + + /** Represents a GetModelRequest. */ + class GetModelRequest implements IGetModelRequest { + + /** + * Constructs a new GetModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IGetModelRequest); + + /** GetModelRequest name. */ + public name: string; + + /** + * Creates a new GetModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IGetModelRequest): google.cloud.automl.v1beta1.GetModelRequest; + + /** + * Encodes the specified GetModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetModelRequest.verify|verify} messages. + * @param message GetModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetModelRequest.verify|verify} messages. + * @param message GetModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.GetModelRequest; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.GetModelRequest; + + /** + * Verifies a GetModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.GetModelRequest; + + /** + * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified. + * @param message GetModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.GetModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelsRequest. */ + interface IListModelsRequest { + + /** ListModelsRequest parent */ + parent?: (string|null); + + /** ListModelsRequest filter */ + filter?: (string|null); + + /** ListModelsRequest pageSize */ + pageSize?: (number|null); + + /** ListModelsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListModelsRequest. */ + class ListModelsRequest implements IListModelsRequest { + + /** + * Constructs a new ListModelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IListModelsRequest); + + /** ListModelsRequest parent. */ + public parent: string; + + /** ListModelsRequest filter. */ + public filter: string; + + /** ListModelsRequest pageSize. */ + public pageSize: number; + + /** ListModelsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListModelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelsRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IListModelsRequest): google.cloud.automl.v1beta1.ListModelsRequest; + + /** + * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelsRequest.verify|verify} messages. + * @param message ListModelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelsRequest.verify|verify} messages. + * @param message ListModelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ListModelsRequest; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ListModelsRequest; + + /** + * Verifies a ListModelsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ListModelsRequest; + + /** + * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified. + * @param message ListModelsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ListModelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelsResponse. */ + interface IListModelsResponse { + + /** ListModelsResponse model */ + model?: (google.cloud.automl.v1beta1.IModel[]|null); + + /** ListModelsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListModelsResponse. */ + class ListModelsResponse implements IListModelsResponse { + + /** + * Constructs a new ListModelsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IListModelsResponse); + + /** ListModelsResponse model. */ + public model: google.cloud.automl.v1beta1.IModel[]; + + /** ListModelsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListModelsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelsResponse instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IListModelsResponse): google.cloud.automl.v1beta1.ListModelsResponse; + + /** + * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelsResponse.verify|verify} messages. + * @param message ListModelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelsResponse.verify|verify} messages. + * @param message ListModelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ListModelsResponse; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ListModelsResponse; + + /** + * Verifies a ListModelsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ListModelsResponse; + + /** + * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. + * @param message ListModelsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ListModelsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteModelRequest. */ + interface IDeleteModelRequest { + + /** DeleteModelRequest name */ + name?: (string|null); + } + + /** Represents a DeleteModelRequest. */ + class DeleteModelRequest implements IDeleteModelRequest { + + /** + * Constructs a new DeleteModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDeleteModelRequest); + + /** DeleteModelRequest name. */ + public name: string; + + /** + * Creates a new DeleteModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDeleteModelRequest): google.cloud.automl.v1beta1.DeleteModelRequest; + + /** + * Encodes the specified DeleteModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteModelRequest.verify|verify} messages. + * @param message DeleteModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDeleteModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteModelRequest.verify|verify} messages. + * @param message DeleteModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDeleteModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.DeleteModelRequest; + + /** + * Decodes a DeleteModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.DeleteModelRequest; + + /** + * Verifies a DeleteModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.DeleteModelRequest; + + /** + * Creates a plain object from a DeleteModelRequest message. Also converts values to other types if specified. + * @param message DeleteModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.DeleteModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployModelRequest. */ + interface IDeployModelRequest { + + /** DeployModelRequest imageObjectDetectionModelDeploymentMetadata */ + imageObjectDetectionModelDeploymentMetadata?: (google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata|null); + + /** DeployModelRequest imageClassificationModelDeploymentMetadata */ + imageClassificationModelDeploymentMetadata?: (google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata|null); + + /** DeployModelRequest name */ + name?: (string|null); + } + + /** Represents a DeployModelRequest. */ + class DeployModelRequest implements IDeployModelRequest { + + /** + * Constructs a new DeployModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDeployModelRequest); + + /** DeployModelRequest imageObjectDetectionModelDeploymentMetadata. */ + public imageObjectDetectionModelDeploymentMetadata?: (google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata|null); + + /** DeployModelRequest imageClassificationModelDeploymentMetadata. */ + public imageClassificationModelDeploymentMetadata?: (google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata|null); + + /** DeployModelRequest name. */ + public name: string; + + /** DeployModelRequest modelDeploymentMetadata. */ + public modelDeploymentMetadata?: ("imageObjectDetectionModelDeploymentMetadata"|"imageClassificationModelDeploymentMetadata"); + + /** + * Creates a new DeployModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDeployModelRequest): google.cloud.automl.v1beta1.DeployModelRequest; + + /** + * Encodes the specified DeployModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.DeployModelRequest.verify|verify} messages. + * @param message DeployModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDeployModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DeployModelRequest.verify|verify} messages. + * @param message DeployModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDeployModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.DeployModelRequest; + + /** + * Decodes a DeployModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.DeployModelRequest; + + /** + * Verifies a DeployModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.DeployModelRequest; + + /** + * Creates a plain object from a DeployModelRequest message. Also converts values to other types if specified. + * @param message DeployModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.DeployModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeployModelRequest. */ + interface IUndeployModelRequest { + + /** UndeployModelRequest name */ + name?: (string|null); + } + + /** Represents an UndeployModelRequest. */ + class UndeployModelRequest implements IUndeployModelRequest { + + /** + * Constructs a new UndeployModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IUndeployModelRequest); + + /** UndeployModelRequest name. */ + public name: string; + + /** + * Creates a new UndeployModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeployModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IUndeployModelRequest): google.cloud.automl.v1beta1.UndeployModelRequest; + + /** + * Encodes the specified UndeployModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.UndeployModelRequest.verify|verify} messages. + * @param message UndeployModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IUndeployModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeployModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.UndeployModelRequest.verify|verify} messages. + * @param message UndeployModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IUndeployModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeployModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.UndeployModelRequest; + + /** + * Decodes an UndeployModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.UndeployModelRequest; + + /** + * Verifies an UndeployModelRequest message. + * @param message Plain 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 UndeployModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeployModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.UndeployModelRequest; + + /** + * Creates a plain object from an UndeployModelRequest message. Also converts values to other types if specified. + * @param message UndeployModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.UndeployModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeployModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeployModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportModelRequest. */ + interface IExportModelRequest { + + /** ExportModelRequest name */ + name?: (string|null); + + /** ExportModelRequest outputConfig */ + outputConfig?: (google.cloud.automl.v1beta1.IModelExportOutputConfig|null); + } + + /** Represents an ExportModelRequest. */ + class ExportModelRequest implements IExportModelRequest { + + /** + * Constructs a new ExportModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IExportModelRequest); + + /** ExportModelRequest name. */ + public name: string; + + /** ExportModelRequest outputConfig. */ + public outputConfig?: (google.cloud.automl.v1beta1.IModelExportOutputConfig|null); + + /** + * Creates a new ExportModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IExportModelRequest): google.cloud.automl.v1beta1.ExportModelRequest; + + /** + * Encodes the specified ExportModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelRequest.verify|verify} messages. + * @param message ExportModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IExportModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelRequest.verify|verify} messages. + * @param message ExportModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IExportModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ExportModelRequest; + + /** + * Decodes an ExportModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ExportModelRequest; + + /** + * Verifies an ExportModelRequest message. + * @param message Plain 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 ExportModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ExportModelRequest; + + /** + * Creates a plain object from an ExportModelRequest message. Also converts values to other types if specified. + * @param message ExportModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ExportModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportEvaluatedExamplesRequest. */ + interface IExportEvaluatedExamplesRequest { + + /** ExportEvaluatedExamplesRequest name */ + name?: (string|null); + + /** ExportEvaluatedExamplesRequest outputConfig */ + outputConfig?: (google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig|null); + } + + /** Represents an ExportEvaluatedExamplesRequest. */ + class ExportEvaluatedExamplesRequest implements IExportEvaluatedExamplesRequest { + + /** + * Constructs a new ExportEvaluatedExamplesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest); + + /** ExportEvaluatedExamplesRequest name. */ + public name: string; + + /** ExportEvaluatedExamplesRequest outputConfig. */ + public outputConfig?: (google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig|null); + + /** + * Creates a new ExportEvaluatedExamplesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEvaluatedExamplesRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest): google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest; + + /** + * Encodes the specified ExportEvaluatedExamplesRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest.verify|verify} messages. + * @param message ExportEvaluatedExamplesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportEvaluatedExamplesRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest.verify|verify} messages. + * @param message ExportEvaluatedExamplesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportEvaluatedExamplesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEvaluatedExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest; + + /** + * Decodes an ExportEvaluatedExamplesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEvaluatedExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest; + + /** + * Verifies an ExportEvaluatedExamplesRequest message. + * @param message Plain 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 ExportEvaluatedExamplesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEvaluatedExamplesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest; + + /** + * Creates a plain object from an ExportEvaluatedExamplesRequest message. Also converts values to other types if specified. + * @param message ExportEvaluatedExamplesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportEvaluatedExamplesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportEvaluatedExamplesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetModelEvaluationRequest. */ + interface IGetModelEvaluationRequest { + + /** GetModelEvaluationRequest name */ + name?: (string|null); + } + + /** Represents a GetModelEvaluationRequest. */ + class GetModelEvaluationRequest implements IGetModelEvaluationRequest { + + /** + * Constructs a new GetModelEvaluationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IGetModelEvaluationRequest); + + /** GetModelEvaluationRequest name. */ + public name: string; + + /** + * Creates a new GetModelEvaluationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetModelEvaluationRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IGetModelEvaluationRequest): google.cloud.automl.v1beta1.GetModelEvaluationRequest; + + /** + * Encodes the specified GetModelEvaluationRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetModelEvaluationRequest.verify|verify} messages. + * @param message GetModelEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IGetModelEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetModelEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetModelEvaluationRequest.verify|verify} messages. + * @param message GetModelEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IGetModelEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetModelEvaluationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetModelEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.GetModelEvaluationRequest; + + /** + * Decodes a GetModelEvaluationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetModelEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.GetModelEvaluationRequest; + + /** + * Verifies a GetModelEvaluationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetModelEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetModelEvaluationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.GetModelEvaluationRequest; + + /** + * Creates a plain object from a GetModelEvaluationRequest message. Also converts values to other types if specified. + * @param message GetModelEvaluationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.GetModelEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetModelEvaluationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetModelEvaluationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelEvaluationsRequest. */ + interface IListModelEvaluationsRequest { + + /** ListModelEvaluationsRequest parent */ + parent?: (string|null); + + /** ListModelEvaluationsRequest filter */ + filter?: (string|null); + + /** ListModelEvaluationsRequest pageSize */ + pageSize?: (number|null); + + /** ListModelEvaluationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListModelEvaluationsRequest. */ + class ListModelEvaluationsRequest implements IListModelEvaluationsRequest { + + /** + * Constructs a new ListModelEvaluationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IListModelEvaluationsRequest); + + /** ListModelEvaluationsRequest parent. */ + public parent: string; + + /** ListModelEvaluationsRequest filter. */ + public filter: string; + + /** ListModelEvaluationsRequest pageSize. */ + public pageSize: number; + + /** ListModelEvaluationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListModelEvaluationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelEvaluationsRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IListModelEvaluationsRequest): google.cloud.automl.v1beta1.ListModelEvaluationsRequest; + + /** + * Encodes the specified ListModelEvaluationsRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelEvaluationsRequest.verify|verify} messages. + * @param message ListModelEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IListModelEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelEvaluationsRequest.verify|verify} messages. + * @param message ListModelEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IListModelEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ListModelEvaluationsRequest; + + /** + * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ListModelEvaluationsRequest; + + /** + * Verifies a ListModelEvaluationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelEvaluationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ListModelEvaluationsRequest; + + /** + * Creates a plain object from a ListModelEvaluationsRequest message. Also converts values to other types if specified. + * @param message ListModelEvaluationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ListModelEvaluationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelEvaluationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelEvaluationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelEvaluationsResponse. */ + interface IListModelEvaluationsResponse { + + /** ListModelEvaluationsResponse modelEvaluation */ + modelEvaluation?: (google.cloud.automl.v1beta1.IModelEvaluation[]|null); + + /** ListModelEvaluationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListModelEvaluationsResponse. */ + class ListModelEvaluationsResponse implements IListModelEvaluationsResponse { + + /** + * Constructs a new ListModelEvaluationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IListModelEvaluationsResponse); + + /** ListModelEvaluationsResponse modelEvaluation. */ + public modelEvaluation: google.cloud.automl.v1beta1.IModelEvaluation[]; + + /** ListModelEvaluationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListModelEvaluationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelEvaluationsResponse instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IListModelEvaluationsResponse): google.cloud.automl.v1beta1.ListModelEvaluationsResponse; + + /** + * Encodes the specified ListModelEvaluationsResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelEvaluationsResponse.verify|verify} messages. + * @param message ListModelEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IListModelEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelEvaluationsResponse.verify|verify} messages. + * @param message ListModelEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IListModelEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.ListModelEvaluationsResponse; + + /** + * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.ListModelEvaluationsResponse; + + /** + * Verifies a ListModelEvaluationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelEvaluationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ListModelEvaluationsResponse; + + /** + * Creates a plain object from a ListModelEvaluationsResponse message. Also converts values to other types if specified. + * @param message ListModelEvaluationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ListModelEvaluationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelEvaluationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelEvaluationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TableSpec. */ + interface ITableSpec { + + /** TableSpec name */ + name?: (string|null); + + /** TableSpec timeColumnSpecId */ + timeColumnSpecId?: (string|null); + + /** TableSpec rowCount */ + rowCount?: (number|Long|string|null); + + /** TableSpec validRowCount */ + validRowCount?: (number|Long|string|null); + + /** TableSpec columnCount */ + columnCount?: (number|Long|string|null); + + /** TableSpec inputConfigs */ + inputConfigs?: (google.cloud.automl.v1beta1.IInputConfig[]|null); + + /** TableSpec etag */ + etag?: (string|null); + } + + /** Represents a TableSpec. */ + class TableSpec implements ITableSpec { + + /** + * Constructs a new TableSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITableSpec); + + /** TableSpec name. */ + public name: string; + + /** TableSpec timeColumnSpecId. */ + public timeColumnSpecId: string; + + /** TableSpec rowCount. */ + public rowCount: (number|Long|string); + + /** TableSpec validRowCount. */ + public validRowCount: (number|Long|string); + + /** TableSpec columnCount. */ + public columnCount: (number|Long|string); + + /** TableSpec inputConfigs. */ + public inputConfigs: google.cloud.automl.v1beta1.IInputConfig[]; + + /** TableSpec etag. */ + public etag: string; + + /** + * Creates a new TableSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns TableSpec instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITableSpec): google.cloud.automl.v1beta1.TableSpec; + + /** + * Encodes the specified TableSpec message. Does not implicitly {@link google.cloud.automl.v1beta1.TableSpec.verify|verify} messages. + * @param message TableSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITableSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableSpec message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TableSpec.verify|verify} messages. + * @param message TableSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITableSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.TableSpec; + + /** + * Decodes a TableSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.TableSpec; + + /** + * Verifies a TableSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TableSpec; + + /** + * Creates a plain object from a TableSpec message. Also converts values to other types if specified. + * @param message TableSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TableSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not 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.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload 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.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not 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.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload 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.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not 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.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload 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.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not 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.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload 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.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not 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.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload 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.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not 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.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload 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.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not 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.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload 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.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not 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.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload 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.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not 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.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload 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.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not 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.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload 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.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not 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.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload 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.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not 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.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload 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.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not 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.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload 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.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + } + + /** 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 deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (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 deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: 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 debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions target */ + target?: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions target. */ + public target: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType); + + /** 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 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + } + + /** 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 deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (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 deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a 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; + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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-automl/protos/protos.js b/packages/google-cloud-automl/protos/protos.js new file mode 100644 index 00000000000..406b847bda6 --- /dev/null +++ b/packages/google-cloud-automl/protos/protos.js @@ -0,0 +1,80974 @@ +// Copyright 2023 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_automl_protos || ($protobuf.roots._google_cloud_automl_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.automl = (function() { + + /** + * Namespace automl. + * @memberof google.cloud + * @namespace + */ + var automl = {}; + + automl.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.automl + * @namespace + */ + var v1 = {}; + + v1.AnnotationPayload = (function() { + + /** + * Properties of an AnnotationPayload. + * @memberof google.cloud.automl.v1 + * @interface IAnnotationPayload + * @property {google.cloud.automl.v1.ITranslationAnnotation|null} [translation] AnnotationPayload translation + * @property {google.cloud.automl.v1.IClassificationAnnotation|null} [classification] AnnotationPayload classification + * @property {google.cloud.automl.v1.IImageObjectDetectionAnnotation|null} [imageObjectDetection] AnnotationPayload imageObjectDetection + * @property {google.cloud.automl.v1.ITextExtractionAnnotation|null} [textExtraction] AnnotationPayload textExtraction + * @property {google.cloud.automl.v1.ITextSentimentAnnotation|null} [textSentiment] AnnotationPayload textSentiment + * @property {string|null} [annotationSpecId] AnnotationPayload annotationSpecId + * @property {string|null} [displayName] AnnotationPayload displayName + */ + + /** + * Constructs a new AnnotationPayload. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an AnnotationPayload. + * @implements IAnnotationPayload + * @constructor + * @param {google.cloud.automl.v1.IAnnotationPayload=} [properties] Properties to set + */ + function AnnotationPayload(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotationPayload translation. + * @member {google.cloud.automl.v1.ITranslationAnnotation|null|undefined} translation + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.translation = null; + + /** + * AnnotationPayload classification. + * @member {google.cloud.automl.v1.IClassificationAnnotation|null|undefined} classification + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.classification = null; + + /** + * AnnotationPayload imageObjectDetection. + * @member {google.cloud.automl.v1.IImageObjectDetectionAnnotation|null|undefined} imageObjectDetection + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.imageObjectDetection = null; + + /** + * AnnotationPayload textExtraction. + * @member {google.cloud.automl.v1.ITextExtractionAnnotation|null|undefined} textExtraction + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.textExtraction = null; + + /** + * AnnotationPayload textSentiment. + * @member {google.cloud.automl.v1.ITextSentimentAnnotation|null|undefined} textSentiment + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.textSentiment = null; + + /** + * AnnotationPayload annotationSpecId. + * @member {string} annotationSpecId + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.annotationSpecId = ""; + + /** + * AnnotationPayload displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.displayName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AnnotationPayload detail. + * @member {"translation"|"classification"|"imageObjectDetection"|"textExtraction"|"textSentiment"|undefined} detail + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + Object.defineProperty(AnnotationPayload.prototype, "detail", { + get: $util.oneOfGetter($oneOfFields = ["translation", "classification", "imageObjectDetection", "textExtraction", "textSentiment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AnnotationPayload instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {google.cloud.automl.v1.IAnnotationPayload=} [properties] Properties to set + * @returns {google.cloud.automl.v1.AnnotationPayload} AnnotationPayload instance + */ + AnnotationPayload.create = function create(properties) { + return new AnnotationPayload(properties); + }; + + /** + * Encodes the specified AnnotationPayload message. Does not implicitly {@link google.cloud.automl.v1.AnnotationPayload.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {google.cloud.automl.v1.IAnnotationPayload} message AnnotationPayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationPayload.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpecId != null && Object.hasOwnProperty.call(message, "annotationSpecId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotationSpecId); + if (message.translation != null && Object.hasOwnProperty.call(message, "translation")) + $root.google.cloud.automl.v1.TranslationAnnotation.encode(message.translation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.classification != null && Object.hasOwnProperty.call(message, "classification")) + $root.google.cloud.automl.v1.ClassificationAnnotation.encode(message.classification, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.imageObjectDetection != null && Object.hasOwnProperty.call(message, "imageObjectDetection")) + $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation.encode(message.imageObjectDetection, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + if (message.textExtraction != null && Object.hasOwnProperty.call(message, "textExtraction")) + $root.google.cloud.automl.v1.TextExtractionAnnotation.encode(message.textExtraction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.textSentiment != null && Object.hasOwnProperty.call(message, "textSentiment")) + $root.google.cloud.automl.v1.TextSentimentAnnotation.encode(message.textSentiment, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotationPayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1.AnnotationPayload.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {google.cloud.automl.v1.IAnnotationPayload} message AnnotationPayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationPayload.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotationPayload message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.AnnotationPayload} AnnotationPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationPayload.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.AnnotationPayload(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.translation = $root.google.cloud.automl.v1.TranslationAnnotation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.classification = $root.google.cloud.automl.v1.ClassificationAnnotation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.imageObjectDetection = $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation.decode(reader, reader.uint32()); + break; + } + case 6: { + message.textExtraction = $root.google.cloud.automl.v1.TextExtractionAnnotation.decode(reader, reader.uint32()); + break; + } + case 7: { + message.textSentiment = $root.google.cloud.automl.v1.TextSentimentAnnotation.decode(reader, reader.uint32()); + break; + } + case 1: { + message.annotationSpecId = reader.string(); + break; + } + case 5: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotationPayload message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.AnnotationPayload} AnnotationPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationPayload.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotationPayload message. + * @function verify + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotationPayload.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.translation != null && message.hasOwnProperty("translation")) { + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1.TranslationAnnotation.verify(message.translation); + if (error) + return "translation." + error; + } + } + if (message.classification != null && message.hasOwnProperty("classification")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1.ClassificationAnnotation.verify(message.classification); + if (error) + return "classification." + error; + } + } + if (message.imageObjectDetection != null && message.hasOwnProperty("imageObjectDetection")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation.verify(message.imageObjectDetection); + if (error) + return "imageObjectDetection." + error; + } + } + if (message.textExtraction != null && message.hasOwnProperty("textExtraction")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1.TextExtractionAnnotation.verify(message.textExtraction); + if (error) + return "textExtraction." + error; + } + } + if (message.textSentiment != null && message.hasOwnProperty("textSentiment")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1.TextSentimentAnnotation.verify(message.textSentiment); + if (error) + return "textSentiment." + error; + } + } + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + if (!$util.isString(message.annotationSpecId)) + return "annotationSpecId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates an AnnotationPayload message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.AnnotationPayload} AnnotationPayload + */ + AnnotationPayload.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.AnnotationPayload) + return object; + var message = new $root.google.cloud.automl.v1.AnnotationPayload(); + if (object.translation != null) { + if (typeof object.translation !== "object") + throw TypeError(".google.cloud.automl.v1.AnnotationPayload.translation: object expected"); + message.translation = $root.google.cloud.automl.v1.TranslationAnnotation.fromObject(object.translation); + } + if (object.classification != null) { + if (typeof object.classification !== "object") + throw TypeError(".google.cloud.automl.v1.AnnotationPayload.classification: object expected"); + message.classification = $root.google.cloud.automl.v1.ClassificationAnnotation.fromObject(object.classification); + } + if (object.imageObjectDetection != null) { + if (typeof object.imageObjectDetection !== "object") + throw TypeError(".google.cloud.automl.v1.AnnotationPayload.imageObjectDetection: object expected"); + message.imageObjectDetection = $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation.fromObject(object.imageObjectDetection); + } + if (object.textExtraction != null) { + if (typeof object.textExtraction !== "object") + throw TypeError(".google.cloud.automl.v1.AnnotationPayload.textExtraction: object expected"); + message.textExtraction = $root.google.cloud.automl.v1.TextExtractionAnnotation.fromObject(object.textExtraction); + } + if (object.textSentiment != null) { + if (typeof object.textSentiment !== "object") + throw TypeError(".google.cloud.automl.v1.AnnotationPayload.textSentiment: object expected"); + message.textSentiment = $root.google.cloud.automl.v1.TextSentimentAnnotation.fromObject(object.textSentiment); + } + if (object.annotationSpecId != null) + message.annotationSpecId = String(object.annotationSpecId); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from an AnnotationPayload message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {google.cloud.automl.v1.AnnotationPayload} message AnnotationPayload + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotationPayload.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.annotationSpecId = ""; + object.displayName = ""; + } + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + object.annotationSpecId = message.annotationSpecId; + if (message.translation != null && message.hasOwnProperty("translation")) { + object.translation = $root.google.cloud.automl.v1.TranslationAnnotation.toObject(message.translation, options); + if (options.oneofs) + object.detail = "translation"; + } + if (message.classification != null && message.hasOwnProperty("classification")) { + object.classification = $root.google.cloud.automl.v1.ClassificationAnnotation.toObject(message.classification, options); + if (options.oneofs) + object.detail = "classification"; + } + if (message.imageObjectDetection != null && message.hasOwnProperty("imageObjectDetection")) { + object.imageObjectDetection = $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation.toObject(message.imageObjectDetection, options); + if (options.oneofs) + object.detail = "imageObjectDetection"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.textExtraction != null && message.hasOwnProperty("textExtraction")) { + object.textExtraction = $root.google.cloud.automl.v1.TextExtractionAnnotation.toObject(message.textExtraction, options); + if (options.oneofs) + object.detail = "textExtraction"; + } + if (message.textSentiment != null && message.hasOwnProperty("textSentiment")) { + object.textSentiment = $root.google.cloud.automl.v1.TextSentimentAnnotation.toObject(message.textSentiment, options); + if (options.oneofs) + object.detail = "textSentiment"; + } + return object; + }; + + /** + * Converts this AnnotationPayload to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + * @returns {Object.} JSON object + */ + AnnotationPayload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotationPayload + * @function getTypeUrl + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotationPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.AnnotationPayload"; + }; + + return AnnotationPayload; + })(); + + /** + * ClassificationType enum. + * @name google.cloud.automl.v1.ClassificationType + * @enum {number} + * @property {number} CLASSIFICATION_TYPE_UNSPECIFIED=0 CLASSIFICATION_TYPE_UNSPECIFIED value + * @property {number} MULTICLASS=1 MULTICLASS value + * @property {number} MULTILABEL=2 MULTILABEL value + */ + v1.ClassificationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLASSIFICATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MULTICLASS"] = 1; + values[valuesById[2] = "MULTILABEL"] = 2; + return values; + })(); + + v1.ClassificationAnnotation = (function() { + + /** + * Properties of a ClassificationAnnotation. + * @memberof google.cloud.automl.v1 + * @interface IClassificationAnnotation + * @property {number|null} [score] ClassificationAnnotation score + */ + + /** + * Constructs a new ClassificationAnnotation. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ClassificationAnnotation. + * @implements IClassificationAnnotation + * @constructor + * @param {google.cloud.automl.v1.IClassificationAnnotation=} [properties] Properties to set + */ + function ClassificationAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClassificationAnnotation score. + * @member {number} score + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @instance + */ + ClassificationAnnotation.prototype.score = 0; + + /** + * Creates a new ClassificationAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {google.cloud.automl.v1.IClassificationAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ClassificationAnnotation} ClassificationAnnotation instance + */ + ClassificationAnnotation.create = function create(properties) { + return new ClassificationAnnotation(properties); + }; + + /** + * Encodes the specified ClassificationAnnotation message. Does not implicitly {@link google.cloud.automl.v1.ClassificationAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {google.cloud.automl.v1.IClassificationAnnotation} message ClassificationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationAnnotation.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); + return writer; + }; + + /** + * Encodes the specified ClassificationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {google.cloud.automl.v1.IClassificationAnnotation} message ClassificationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassificationAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ClassificationAnnotation} ClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ClassificationAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassificationAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ClassificationAnnotation} ClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassificationAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassificationAnnotation.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"; + return null; + }; + + /** + * Creates a ClassificationAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ClassificationAnnotation} ClassificationAnnotation + */ + ClassificationAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ClassificationAnnotation) + return object; + var message = new $root.google.cloud.automl.v1.ClassificationAnnotation(); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a ClassificationAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {google.cloud.automl.v1.ClassificationAnnotation} message ClassificationAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassificationAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.score = 0; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this ClassificationAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @instance + * @returns {Object.} JSON object + */ + ClassificationAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassificationAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassificationAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ClassificationAnnotation"; + }; + + return ClassificationAnnotation; + })(); + + v1.ClassificationEvaluationMetrics = (function() { + + /** + * Properties of a ClassificationEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @interface IClassificationEvaluationMetrics + * @property {number|null} [auPrc] ClassificationEvaluationMetrics auPrc + * @property {number|null} [auRoc] ClassificationEvaluationMetrics auRoc + * @property {number|null} [logLoss] ClassificationEvaluationMetrics logLoss + * @property {Array.|null} [confidenceMetricsEntry] ClassificationEvaluationMetrics confidenceMetricsEntry + * @property {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null} [confusionMatrix] ClassificationEvaluationMetrics confusionMatrix + * @property {Array.|null} [annotationSpecId] ClassificationEvaluationMetrics annotationSpecId + */ + + /** + * Constructs a new ClassificationEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ClassificationEvaluationMetrics. + * @implements IClassificationEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1.IClassificationEvaluationMetrics=} [properties] Properties to set + */ + function ClassificationEvaluationMetrics(properties) { + this.confidenceMetricsEntry = []; + this.annotationSpecId = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClassificationEvaluationMetrics auPrc. + * @member {number} auPrc + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.auPrc = 0; + + /** + * ClassificationEvaluationMetrics auRoc. + * @member {number} auRoc + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.auRoc = 0; + + /** + * ClassificationEvaluationMetrics logLoss. + * @member {number} logLoss + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.logLoss = 0; + + /** + * ClassificationEvaluationMetrics confidenceMetricsEntry. + * @member {Array.} confidenceMetricsEntry + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.confidenceMetricsEntry = $util.emptyArray; + + /** + * ClassificationEvaluationMetrics confusionMatrix. + * @member {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null|undefined} confusionMatrix + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.confusionMatrix = null; + + /** + * ClassificationEvaluationMetrics annotationSpecId. + * @member {Array.} annotationSpecId + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.annotationSpecId = $util.emptyArray; + + /** + * Creates a new ClassificationEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.IClassificationEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics} ClassificationEvaluationMetrics instance + */ + ClassificationEvaluationMetrics.create = function create(properties) { + return new ClassificationEvaluationMetrics(properties); + }; + + /** + * Encodes the specified ClassificationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.IClassificationEvaluationMetrics} message ClassificationEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.auPrc != null && Object.hasOwnProperty.call(message, "auPrc")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.auPrc); + if (message.confidenceMetricsEntry != null && message.confidenceMetricsEntry.length) + for (var i = 0; i < message.confidenceMetricsEntry.length; ++i) + $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.encode(message.confidenceMetricsEntry[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confusionMatrix != null && Object.hasOwnProperty.call(message, "confusionMatrix")) + $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.encode(message.confusionMatrix, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.annotationSpecId != null && message.annotationSpecId.length) + for (var i = 0; i < message.annotationSpecId.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.annotationSpecId[i]); + if (message.auRoc != null && Object.hasOwnProperty.call(message, "auRoc")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.auRoc); + if (message.logLoss != null && Object.hasOwnProperty.call(message, "logLoss")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.logLoss); + return writer; + }; + + /** + * Encodes the specified ClassificationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.IClassificationEvaluationMetrics} message ClassificationEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassificationEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics} ClassificationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.auPrc = reader.float(); + break; + } + case 6: { + message.auRoc = reader.float(); + break; + } + case 7: { + message.logLoss = reader.float(); + break; + } + case 3: { + if (!(message.confidenceMetricsEntry && message.confidenceMetricsEntry.length)) + message.confidenceMetricsEntry = []; + message.confidenceMetricsEntry.push($root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.decode(reader, reader.uint32())); + break; + } + case 4: { + message.confusionMatrix = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.annotationSpecId && message.annotationSpecId.length)) + message.annotationSpecId = []; + message.annotationSpecId.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassificationEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics} ClassificationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassificationEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassificationEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + if (typeof message.auPrc !== "number") + return "auPrc: number expected"; + if (message.auRoc != null && message.hasOwnProperty("auRoc")) + if (typeof message.auRoc !== "number") + return "auRoc: number expected"; + if (message.logLoss != null && message.hasOwnProperty("logLoss")) + if (typeof message.logLoss !== "number") + return "logLoss: number expected"; + if (message.confidenceMetricsEntry != null && message.hasOwnProperty("confidenceMetricsEntry")) { + if (!Array.isArray(message.confidenceMetricsEntry)) + return "confidenceMetricsEntry: array expected"; + for (var i = 0; i < message.confidenceMetricsEntry.length; ++i) { + var error = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify(message.confidenceMetricsEntry[i]); + if (error) + return "confidenceMetricsEntry." + error; + } + } + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) { + var error = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.verify(message.confusionMatrix); + if (error) + return "confusionMatrix." + error; + } + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) { + if (!Array.isArray(message.annotationSpecId)) + return "annotationSpecId: array expected"; + for (var i = 0; i < message.annotationSpecId.length; ++i) + if (!$util.isString(message.annotationSpecId[i])) + return "annotationSpecId: string[] expected"; + } + return null; + }; + + /** + * Creates a ClassificationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics} ClassificationEvaluationMetrics + */ + ClassificationEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ClassificationEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics(); + if (object.auPrc != null) + message.auPrc = Number(object.auPrc); + if (object.auRoc != null) + message.auRoc = Number(object.auRoc); + if (object.logLoss != null) + message.logLoss = Number(object.logLoss); + if (object.confidenceMetricsEntry) { + if (!Array.isArray(object.confidenceMetricsEntry)) + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.confidenceMetricsEntry: array expected"); + message.confidenceMetricsEntry = []; + for (var i = 0; i < object.confidenceMetricsEntry.length; ++i) { + if (typeof object.confidenceMetricsEntry[i] !== "object") + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.confidenceMetricsEntry: object expected"); + message.confidenceMetricsEntry[i] = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.fromObject(object.confidenceMetricsEntry[i]); + } + } + if (object.confusionMatrix != null) { + if (typeof object.confusionMatrix !== "object") + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.confusionMatrix: object expected"); + message.confusionMatrix = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.fromObject(object.confusionMatrix); + } + if (object.annotationSpecId) { + if (!Array.isArray(object.annotationSpecId)) + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.annotationSpecId: array expected"); + message.annotationSpecId = []; + for (var i = 0; i < object.annotationSpecId.length; ++i) + message.annotationSpecId[i] = String(object.annotationSpecId[i]); + } + return message; + }; + + /** + * Creates a plain object from a ClassificationEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics} message ClassificationEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassificationEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.confidenceMetricsEntry = []; + object.annotationSpecId = []; + } + if (options.defaults) { + object.auPrc = 0; + object.confusionMatrix = null; + object.auRoc = 0; + object.logLoss = 0; + } + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + object.auPrc = options.json && !isFinite(message.auPrc) ? String(message.auPrc) : message.auPrc; + if (message.confidenceMetricsEntry && message.confidenceMetricsEntry.length) { + object.confidenceMetricsEntry = []; + for (var j = 0; j < message.confidenceMetricsEntry.length; ++j) + object.confidenceMetricsEntry[j] = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.toObject(message.confidenceMetricsEntry[j], options); + } + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) + object.confusionMatrix = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.toObject(message.confusionMatrix, options); + if (message.annotationSpecId && message.annotationSpecId.length) { + object.annotationSpecId = []; + for (var j = 0; j < message.annotationSpecId.length; ++j) + object.annotationSpecId[j] = message.annotationSpecId[j]; + } + if (message.auRoc != null && message.hasOwnProperty("auRoc")) + object.auRoc = options.json && !isFinite(message.auRoc) ? String(message.auRoc) : message.auRoc; + if (message.logLoss != null && message.hasOwnProperty("logLoss")) + object.logLoss = options.json && !isFinite(message.logLoss) ? String(message.logLoss) : message.logLoss; + return object; + }; + + /** + * Converts this ClassificationEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + ClassificationEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassificationEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassificationEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ClassificationEvaluationMetrics"; + }; + + ClassificationEvaluationMetrics.ConfidenceMetricsEntry = (function() { + + /** + * Properties of a ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @interface IConfidenceMetricsEntry + * @property {number|null} [confidenceThreshold] ConfidenceMetricsEntry confidenceThreshold + * @property {number|null} [positionThreshold] ConfidenceMetricsEntry positionThreshold + * @property {number|null} [recall] ConfidenceMetricsEntry recall + * @property {number|null} [precision] ConfidenceMetricsEntry precision + * @property {number|null} [falsePositiveRate] ConfidenceMetricsEntry falsePositiveRate + * @property {number|null} [f1Score] ConfidenceMetricsEntry f1Score + * @property {number|null} [recallAt1] ConfidenceMetricsEntry recallAt1 + * @property {number|null} [precisionAt1] ConfidenceMetricsEntry precisionAt1 + * @property {number|null} [falsePositiveRateAt1] ConfidenceMetricsEntry falsePositiveRateAt1 + * @property {number|null} [f1ScoreAt1] ConfidenceMetricsEntry f1ScoreAt1 + * @property {number|Long|null} [truePositiveCount] ConfidenceMetricsEntry truePositiveCount + * @property {number|Long|null} [falsePositiveCount] ConfidenceMetricsEntry falsePositiveCount + * @property {number|Long|null} [falseNegativeCount] ConfidenceMetricsEntry falseNegativeCount + * @property {number|Long|null} [trueNegativeCount] ConfidenceMetricsEntry trueNegativeCount + */ + + /** + * Constructs a new ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @classdesc Represents a ConfidenceMetricsEntry. + * @implements IConfidenceMetricsEntry + * @constructor + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.confidenceThreshold = 0; + + /** + * ConfidenceMetricsEntry positionThreshold. + * @member {number} positionThreshold + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.positionThreshold = 0; + + /** + * ConfidenceMetricsEntry recall. + * @member {number} recall + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recall = 0; + + /** + * ConfidenceMetricsEntry precision. + * @member {number} precision + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precision = 0; + + /** + * ConfidenceMetricsEntry falsePositiveRate. + * @member {number} falsePositiveRate + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.falsePositiveRate = 0; + + /** + * ConfidenceMetricsEntry f1Score. + * @member {number} f1Score + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1Score = 0; + + /** + * ConfidenceMetricsEntry recallAt1. + * @member {number} recallAt1 + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recallAt1 = 0; + + /** + * ConfidenceMetricsEntry precisionAt1. + * @member {number} precisionAt1 + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precisionAt1 = 0; + + /** + * ConfidenceMetricsEntry falsePositiveRateAt1. + * @member {number} falsePositiveRateAt1 + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.falsePositiveRateAt1 = 0; + + /** + * ConfidenceMetricsEntry f1ScoreAt1. + * @member {number} f1ScoreAt1 + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1ScoreAt1 = 0; + + /** + * ConfidenceMetricsEntry truePositiveCount. + * @member {number|Long} truePositiveCount + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.truePositiveCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ConfidenceMetricsEntry falsePositiveCount. + * @member {number|Long} falsePositiveCount + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.falsePositiveCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ConfidenceMetricsEntry falseNegativeCount. + * @member {number|Long} falseNegativeCount + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.falseNegativeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ConfidenceMetricsEntry trueNegativeCount. + * @member {number|Long} trueNegativeCount + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.trueNegativeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry instance + */ + ConfidenceMetricsEntry.create = function create(properties) { + return new ConfidenceMetricsEntry(properties); + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.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.falsePositiveRate != null && Object.hasOwnProperty.call(message, "falsePositiveRate")) + writer.uint32(/* id 8, wireType 5 =*/69).float(message.falsePositiveRate); + if (message.falsePositiveRateAt1 != null && Object.hasOwnProperty.call(message, "falsePositiveRateAt1")) + writer.uint32(/* id 9, wireType 5 =*/77).float(message.falsePositiveRateAt1); + if (message.truePositiveCount != null && Object.hasOwnProperty.call(message, "truePositiveCount")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.truePositiveCount); + if (message.falsePositiveCount != null && Object.hasOwnProperty.call(message, "falsePositiveCount")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.falsePositiveCount); + if (message.falseNegativeCount != null && Object.hasOwnProperty.call(message, "falseNegativeCount")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.falseNegativeCount); + if (message.trueNegativeCount != null && Object.hasOwnProperty.call(message, "trueNegativeCount")) + writer.uint32(/* id 13, wireType 0 =*/104).int64(message.trueNegativeCount); + if (message.positionThreshold != null && Object.hasOwnProperty.call(message, "positionThreshold")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.positionThreshold); + return writer; + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.confidenceThreshold = reader.float(); + break; + } + case 14: { + message.positionThreshold = reader.int32(); + break; + } + case 2: { + message.recall = reader.float(); + break; + } + case 3: { + message.precision = reader.float(); + break; + } + case 8: { + message.falsePositiveRate = 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 9: { + message.falsePositiveRateAt1 = reader.float(); + break; + } + case 7: { + message.f1ScoreAt1 = reader.float(); + break; + } + case 10: { + message.truePositiveCount = reader.int64(); + break; + } + case 11: { + message.falsePositiveCount = reader.int64(); + break; + } + case 12: { + message.falseNegativeCount = reader.int64(); + break; + } + case 13: { + message.trueNegativeCount = reader.int64(); + 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.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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.positionThreshold != null && message.hasOwnProperty("positionThreshold")) + if (!$util.isInteger(message.positionThreshold)) + return "positionThreshold: integer 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.falsePositiveRate != null && message.hasOwnProperty("falsePositiveRate")) + if (typeof message.falsePositiveRate !== "number") + return "falsePositiveRate: 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.falsePositiveRateAt1 != null && message.hasOwnProperty("falsePositiveRateAt1")) + if (typeof message.falsePositiveRateAt1 !== "number") + return "falsePositiveRateAt1: number expected"; + if (message.f1ScoreAt1 != null && message.hasOwnProperty("f1ScoreAt1")) + if (typeof message.f1ScoreAt1 !== "number") + return "f1ScoreAt1: number expected"; + if (message.truePositiveCount != null && message.hasOwnProperty("truePositiveCount")) + if (!$util.isInteger(message.truePositiveCount) && !(message.truePositiveCount && $util.isInteger(message.truePositiveCount.low) && $util.isInteger(message.truePositiveCount.high))) + return "truePositiveCount: integer|Long expected"; + if (message.falsePositiveCount != null && message.hasOwnProperty("falsePositiveCount")) + if (!$util.isInteger(message.falsePositiveCount) && !(message.falsePositiveCount && $util.isInteger(message.falsePositiveCount.low) && $util.isInteger(message.falsePositiveCount.high))) + return "falsePositiveCount: integer|Long expected"; + if (message.falseNegativeCount != null && message.hasOwnProperty("falseNegativeCount")) + if (!$util.isInteger(message.falseNegativeCount) && !(message.falseNegativeCount && $util.isInteger(message.falseNegativeCount.low) && $util.isInteger(message.falseNegativeCount.high))) + return "falseNegativeCount: integer|Long expected"; + if (message.trueNegativeCount != null && message.hasOwnProperty("trueNegativeCount")) + if (!$util.isInteger(message.trueNegativeCount) && !(message.trueNegativeCount && $util.isInteger(message.trueNegativeCount.low) && $util.isInteger(message.trueNegativeCount.high))) + return "trueNegativeCount: integer|Long expected"; + return null; + }; + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + */ + ConfidenceMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) + return object; + var message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry(); + if (object.confidenceThreshold != null) + message.confidenceThreshold = Number(object.confidenceThreshold); + if (object.positionThreshold != null) + message.positionThreshold = object.positionThreshold | 0; + if (object.recall != null) + message.recall = Number(object.recall); + if (object.precision != null) + message.precision = Number(object.precision); + if (object.falsePositiveRate != null) + message.falsePositiveRate = Number(object.falsePositiveRate); + 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.falsePositiveRateAt1 != null) + message.falsePositiveRateAt1 = Number(object.falsePositiveRateAt1); + if (object.f1ScoreAt1 != null) + message.f1ScoreAt1 = Number(object.f1ScoreAt1); + if (object.truePositiveCount != null) + if ($util.Long) + (message.truePositiveCount = $util.Long.fromValue(object.truePositiveCount)).unsigned = false; + else if (typeof object.truePositiveCount === "string") + message.truePositiveCount = parseInt(object.truePositiveCount, 10); + else if (typeof object.truePositiveCount === "number") + message.truePositiveCount = object.truePositiveCount; + else if (typeof object.truePositiveCount === "object") + message.truePositiveCount = new $util.LongBits(object.truePositiveCount.low >>> 0, object.truePositiveCount.high >>> 0).toNumber(); + if (object.falsePositiveCount != null) + if ($util.Long) + (message.falsePositiveCount = $util.Long.fromValue(object.falsePositiveCount)).unsigned = false; + else if (typeof object.falsePositiveCount === "string") + message.falsePositiveCount = parseInt(object.falsePositiveCount, 10); + else if (typeof object.falsePositiveCount === "number") + message.falsePositiveCount = object.falsePositiveCount; + else if (typeof object.falsePositiveCount === "object") + message.falsePositiveCount = new $util.LongBits(object.falsePositiveCount.low >>> 0, object.falsePositiveCount.high >>> 0).toNumber(); + if (object.falseNegativeCount != null) + if ($util.Long) + (message.falseNegativeCount = $util.Long.fromValue(object.falseNegativeCount)).unsigned = false; + else if (typeof object.falseNegativeCount === "string") + message.falseNegativeCount = parseInt(object.falseNegativeCount, 10); + else if (typeof object.falseNegativeCount === "number") + message.falseNegativeCount = object.falseNegativeCount; + else if (typeof object.falseNegativeCount === "object") + message.falseNegativeCount = new $util.LongBits(object.falseNegativeCount.low >>> 0, object.falseNegativeCount.high >>> 0).toNumber(); + if (object.trueNegativeCount != null) + if ($util.Long) + (message.trueNegativeCount = $util.Long.fromValue(object.trueNegativeCount)).unsigned = false; + else if (typeof object.trueNegativeCount === "string") + message.trueNegativeCount = parseInt(object.trueNegativeCount, 10); + else if (typeof object.trueNegativeCount === "number") + message.trueNegativeCount = object.trueNegativeCount; + else if (typeof object.trueNegativeCount === "object") + message.trueNegativeCount = new $util.LongBits(object.trueNegativeCount.low >>> 0, object.trueNegativeCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.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.falsePositiveRate = 0; + object.falsePositiveRateAt1 = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.truePositiveCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.truePositiveCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.falsePositiveCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.falsePositiveCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.falseNegativeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.falseNegativeCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trueNegativeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trueNegativeCount = options.longs === String ? "0" : 0; + object.positionThreshold = 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.falsePositiveRate != null && message.hasOwnProperty("falsePositiveRate")) + object.falsePositiveRate = options.json && !isFinite(message.falsePositiveRate) ? String(message.falsePositiveRate) : message.falsePositiveRate; + if (message.falsePositiveRateAt1 != null && message.hasOwnProperty("falsePositiveRateAt1")) + object.falsePositiveRateAt1 = options.json && !isFinite(message.falsePositiveRateAt1) ? String(message.falsePositiveRateAt1) : message.falsePositiveRateAt1; + if (message.truePositiveCount != null && message.hasOwnProperty("truePositiveCount")) + if (typeof message.truePositiveCount === "number") + object.truePositiveCount = options.longs === String ? String(message.truePositiveCount) : message.truePositiveCount; + else + object.truePositiveCount = options.longs === String ? $util.Long.prototype.toString.call(message.truePositiveCount) : options.longs === Number ? new $util.LongBits(message.truePositiveCount.low >>> 0, message.truePositiveCount.high >>> 0).toNumber() : message.truePositiveCount; + if (message.falsePositiveCount != null && message.hasOwnProperty("falsePositiveCount")) + if (typeof message.falsePositiveCount === "number") + object.falsePositiveCount = options.longs === String ? String(message.falsePositiveCount) : message.falsePositiveCount; + else + object.falsePositiveCount = options.longs === String ? $util.Long.prototype.toString.call(message.falsePositiveCount) : options.longs === Number ? new $util.LongBits(message.falsePositiveCount.low >>> 0, message.falsePositiveCount.high >>> 0).toNumber() : message.falsePositiveCount; + if (message.falseNegativeCount != null && message.hasOwnProperty("falseNegativeCount")) + if (typeof message.falseNegativeCount === "number") + object.falseNegativeCount = options.longs === String ? String(message.falseNegativeCount) : message.falseNegativeCount; + else + object.falseNegativeCount = options.longs === String ? $util.Long.prototype.toString.call(message.falseNegativeCount) : options.longs === Number ? new $util.LongBits(message.falseNegativeCount.low >>> 0, message.falseNegativeCount.high >>> 0).toNumber() : message.falseNegativeCount; + if (message.trueNegativeCount != null && message.hasOwnProperty("trueNegativeCount")) + if (typeof message.trueNegativeCount === "number") + object.trueNegativeCount = options.longs === String ? String(message.trueNegativeCount) : message.trueNegativeCount; + else + object.trueNegativeCount = options.longs === String ? $util.Long.prototype.toString.call(message.trueNegativeCount) : options.longs === Number ? new $util.LongBits(message.trueNegativeCount.low >>> 0, message.trueNegativeCount.high >>> 0).toNumber() : message.trueNegativeCount; + if (message.positionThreshold != null && message.hasOwnProperty("positionThreshold")) + object.positionThreshold = message.positionThreshold; + return object; + }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry"; + }; + + return ConfidenceMetricsEntry; + })(); + + ClassificationEvaluationMetrics.ConfusionMatrix = (function() { + + /** + * Properties of a ConfusionMatrix. + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @interface IConfusionMatrix + * @property {Array.|null} [annotationSpecId] ConfusionMatrix annotationSpecId + * @property {Array.|null} [displayName] ConfusionMatrix displayName + * @property {Array.|null} [row] ConfusionMatrix row + */ + + /** + * Constructs a new ConfusionMatrix. + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @classdesc Represents a ConfusionMatrix. + * @implements IConfusionMatrix + * @constructor + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix=} [properties] Properties to set + */ + function ConfusionMatrix(properties) { + this.annotationSpecId = []; + this.displayName = []; + 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 annotationSpecId. + * @member {Array.} annotationSpecId + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @instance + */ + ConfusionMatrix.prototype.annotationSpecId = $util.emptyArray; + + /** + * ConfusionMatrix displayName. + * @member {Array.} displayName + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @instance + */ + ConfusionMatrix.prototype.displayName = $util.emptyArray; + + /** + * ConfusionMatrix row. + * @member {Array.} row + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @instance + */ + ConfusionMatrix.prototype.row = $util.emptyArray; + + /** + * Creates a new ConfusionMatrix instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix} ConfusionMatrix instance + */ + ConfusionMatrix.create = function create(properties) { + return new ConfusionMatrix(properties); + }; + + /** + * Encodes the specified ConfusionMatrix message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.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.annotationSpecId != null && message.annotationSpecId.length) + for (var i = 0; i < message.annotationSpecId.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotationSpecId[i]); + if (message.row != null && message.row.length) + for (var i = 0; i < message.row.length; ++i) + $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.encode(message.row[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.displayName != null && message.displayName.length) + for (var i = 0; i < message.displayName.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName[i]); + return writer; + }; + + /** + * Encodes the specified ConfusionMatrix message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotationSpecId && message.annotationSpecId.length)) + message.annotationSpecId = []; + message.annotationSpecId.push(reader.string()); + break; + } + case 3: { + if (!(message.displayName && message.displayName.length)) + message.displayName = []; + message.displayName.push(reader.string()); + break; + } + case 2: { + if (!(message.row && message.row.length)) + message.row = []; + message.row.push($root.google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) { + if (!Array.isArray(message.annotationSpecId)) + return "annotationSpecId: array expected"; + for (var i = 0; i < message.annotationSpecId.length; ++i) + if (!$util.isString(message.annotationSpecId[i])) + return "annotationSpecId: string[] expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) { + if (!Array.isArray(message.displayName)) + return "displayName: array expected"; + for (var i = 0; i < message.displayName.length; ++i) + if (!$util.isString(message.displayName[i])) + return "displayName: string[] 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.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix} ConfusionMatrix + */ + ConfusionMatrix.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix) + return object; + var message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix(); + if (object.annotationSpecId) { + if (!Array.isArray(object.annotationSpecId)) + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.annotationSpecId: array expected"); + message.annotationSpecId = []; + for (var i = 0; i < object.annotationSpecId.length; ++i) + message.annotationSpecId[i] = String(object.annotationSpecId[i]); + } + if (object.displayName) { + if (!Array.isArray(object.displayName)) + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.displayName: array expected"); + message.displayName = []; + for (var i = 0; i < object.displayName.length; ++i) + message.displayName[i] = String(object.displayName[i]); + } + if (object.row) { + if (!Array.isArray(object.row)) + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.row: object expected"); + message.row[i] = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.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.annotationSpecId = []; + object.row = []; + object.displayName = []; + } + if (message.annotationSpecId && message.annotationSpecId.length) { + object.annotationSpecId = []; + for (var j = 0; j < message.annotationSpecId.length; ++j) + object.annotationSpecId[j] = message.annotationSpecId[j]; + } + if (message.row && message.row.length) { + object.row = []; + for (var j = 0; j < message.row.length; ++j) + object.row[j] = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.toObject(message.row[j], options); + } + if (message.displayName && message.displayName.length) { + object.displayName = []; + for (var j = 0; j < message.displayName.length; ++j) + object.displayName[j] = message.displayName[j]; + } + return object; + }; + + /** + * Converts this ConfusionMatrix to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix"; + }; + + ConfusionMatrix.Row = (function() { + + /** + * Properties of a Row. + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @interface IRow + * @property {Array.|null} [exampleCount] Row exampleCount + */ + + /** + * Constructs a new Row. + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @classdesc Represents a Row. + * @implements IRow + * @constructor + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow=} [properties] Properties to set + */ + function Row(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]]; + } + + /** + * Row exampleCount. + * @member {Array.} exampleCount + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @instance + */ + Row.prototype.exampleCount = $util.emptyArray; + + /** + * Creates a new Row instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} Row instance + */ + Row.create = function create(properties) { + return new Row(properties); + }; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.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.exampleCount != null && message.exampleCount.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.exampleCount.length; ++i) + writer.int32(message.exampleCount[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.exampleCount && message.exampleCount.length)) + message.exampleCount = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.exampleCount.push(reader.int32()); + } else + message.exampleCount.push(reader.int32()); + 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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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.exampleCount != null && message.hasOwnProperty("exampleCount")) { + if (!Array.isArray(message.exampleCount)) + return "exampleCount: array expected"; + for (var i = 0; i < message.exampleCount.length; ++i) + if (!$util.isInteger(message.exampleCount[i])) + return "exampleCount: integer[] expected"; + } + return null; + }; + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} Row + */ + Row.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) + return object; + var message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row(); + if (object.exampleCount) { + if (!Array.isArray(object.exampleCount)) + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.exampleCount: array expected"); + message.exampleCount = []; + for (var i = 0; i < object.exampleCount.length; ++i) + message.exampleCount[i] = object.exampleCount[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.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.exampleCount = []; + if (message.exampleCount && message.exampleCount.length) { + object.exampleCount = []; + for (var j = 0; j < message.exampleCount.length; ++j) + object.exampleCount[j] = message.exampleCount[j]; + } + return object; + }; + + /** + * Converts this Row to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row"; + }; + + return Row; + })(); + + return ConfusionMatrix; + })(); + + return ClassificationEvaluationMetrics; + })(); + + v1.ImageObjectDetectionAnnotation = (function() { + + /** + * Properties of an ImageObjectDetectionAnnotation. + * @memberof google.cloud.automl.v1 + * @interface IImageObjectDetectionAnnotation + * @property {google.cloud.automl.v1.IBoundingPoly|null} [boundingBox] ImageObjectDetectionAnnotation boundingBox + * @property {number|null} [score] ImageObjectDetectionAnnotation score + */ + + /** + * Constructs a new ImageObjectDetectionAnnotation. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImageObjectDetectionAnnotation. + * @implements IImageObjectDetectionAnnotation + * @constructor + * @param {google.cloud.automl.v1.IImageObjectDetectionAnnotation=} [properties] Properties to set + */ + function ImageObjectDetectionAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionAnnotation boundingBox. + * @member {google.cloud.automl.v1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @instance + */ + ImageObjectDetectionAnnotation.prototype.boundingBox = null; + + /** + * ImageObjectDetectionAnnotation score. + * @member {number} score + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @instance + */ + ImageObjectDetectionAnnotation.prototype.score = 0; + + /** + * Creates a new ImageObjectDetectionAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageObjectDetectionAnnotation} ImageObjectDetectionAnnotation instance + */ + ImageObjectDetectionAnnotation.create = function create(properties) { + return new ImageObjectDetectionAnnotation(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionAnnotation message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionAnnotation} message ImageObjectDetectionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boundingBox != null && Object.hasOwnProperty.call(message, "boundingBox")) + $root.google.cloud.automl.v1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionAnnotation} message ImageObjectDetectionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImageObjectDetectionAnnotation} ImageObjectDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.boundingBox = $root.google.cloud.automl.v1.BoundingPoly.decode(reader, reader.uint32()); + break; + } + case 2: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImageObjectDetectionAnnotation} ImageObjectDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.automl.v1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImageObjectDetectionAnnotation} ImageObjectDetectionAnnotation + */ + ImageObjectDetectionAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation) + return object; + var message = new $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation(); + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.automl.v1.ImageObjectDetectionAnnotation.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.automl.v1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {google.cloud.automl.v1.ImageObjectDetectionAnnotation} message ImageObjectDetectionAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.boundingBox = null; + object.score = 0; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.automl.v1.BoundingPoly.toObject(message.boundingBox, options); + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this ImageObjectDetectionAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ImageObjectDetectionAnnotation"; + }; + + return ImageObjectDetectionAnnotation; + })(); + + v1.BoundingBoxMetricsEntry = (function() { + + /** + * Properties of a BoundingBoxMetricsEntry. + * @memberof google.cloud.automl.v1 + * @interface IBoundingBoxMetricsEntry + * @property {number|null} [iouThreshold] BoundingBoxMetricsEntry iouThreshold + * @property {number|null} [meanAveragePrecision] BoundingBoxMetricsEntry meanAveragePrecision + * @property {Array.|null} [confidenceMetricsEntries] BoundingBoxMetricsEntry confidenceMetricsEntries + */ + + /** + * Constructs a new BoundingBoxMetricsEntry. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a BoundingBoxMetricsEntry. + * @implements IBoundingBoxMetricsEntry + * @constructor + * @param {google.cloud.automl.v1.IBoundingBoxMetricsEntry=} [properties] Properties to set + */ + function BoundingBoxMetricsEntry(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]]; + } + + /** + * BoundingBoxMetricsEntry iouThreshold. + * @member {number} iouThreshold + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @instance + */ + BoundingBoxMetricsEntry.prototype.iouThreshold = 0; + + /** + * BoundingBoxMetricsEntry meanAveragePrecision. + * @member {number} meanAveragePrecision + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @instance + */ + BoundingBoxMetricsEntry.prototype.meanAveragePrecision = 0; + + /** + * BoundingBoxMetricsEntry confidenceMetricsEntries. + * @member {Array.} confidenceMetricsEntries + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @instance + */ + BoundingBoxMetricsEntry.prototype.confidenceMetricsEntries = $util.emptyArray; + + /** + * Creates a new BoundingBoxMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {google.cloud.automl.v1.IBoundingBoxMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry} BoundingBoxMetricsEntry instance + */ + BoundingBoxMetricsEntry.create = function create(properties) { + return new BoundingBoxMetricsEntry(properties); + }; + + /** + * Encodes the specified BoundingBoxMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {google.cloud.automl.v1.IBoundingBoxMetricsEntry} message BoundingBoxMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingBoxMetricsEntry.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); + if (message.meanAveragePrecision != null && Object.hasOwnProperty.call(message, "meanAveragePrecision")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.meanAveragePrecision); + if (message.confidenceMetricsEntries != null && message.confidenceMetricsEntries.length) + for (var i = 0; i < message.confidenceMetricsEntries.length; ++i) + $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.encode(message.confidenceMetricsEntries[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoundingBoxMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {google.cloud.automl.v1.IBoundingBoxMetricsEntry} message BoundingBoxMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingBoxMetricsEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoundingBoxMetricsEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry} BoundingBoxMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingBoxMetricsEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BoundingBoxMetricsEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.iouThreshold = reader.float(); + break; + } + case 2: { + message.meanAveragePrecision = reader.float(); + break; + } + case 3: { + if (!(message.confidenceMetricsEntries && message.confidenceMetricsEntries.length)) + message.confidenceMetricsEntries = []; + message.confidenceMetricsEntries.push($root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoundingBoxMetricsEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry} BoundingBoxMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingBoxMetricsEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoundingBoxMetricsEntry message. + * @function verify + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoundingBoxMetricsEntry.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"; + if (message.meanAveragePrecision != null && message.hasOwnProperty("meanAveragePrecision")) + if (typeof message.meanAveragePrecision !== "number") + return "meanAveragePrecision: 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.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify(message.confidenceMetricsEntries[i]); + if (error) + return "confidenceMetricsEntries." + error; + } + } + return null; + }; + + /** + * Creates a BoundingBoxMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry} BoundingBoxMetricsEntry + */ + BoundingBoxMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BoundingBoxMetricsEntry) + return object; + var message = new $root.google.cloud.automl.v1.BoundingBoxMetricsEntry(); + if (object.iouThreshold != null) + message.iouThreshold = Number(object.iouThreshold); + if (object.meanAveragePrecision != null) + message.meanAveragePrecision = Number(object.meanAveragePrecision); + if (object.confidenceMetricsEntries) { + if (!Array.isArray(object.confidenceMetricsEntries)) + throw TypeError(".google.cloud.automl.v1.BoundingBoxMetricsEntry.confidenceMetricsEntries: array expected"); + message.confidenceMetricsEntries = []; + for (var i = 0; i < object.confidenceMetricsEntries.length; ++i) { + if (typeof object.confidenceMetricsEntries[i] !== "object") + throw TypeError(".google.cloud.automl.v1.BoundingBoxMetricsEntry.confidenceMetricsEntries: object expected"); + message.confidenceMetricsEntries[i] = $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.fromObject(object.confidenceMetricsEntries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoundingBoxMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {google.cloud.automl.v1.BoundingBoxMetricsEntry} message BoundingBoxMetricsEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoundingBoxMetricsEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.confidenceMetricsEntries = []; + if (options.defaults) { + object.iouThreshold = 0; + object.meanAveragePrecision = 0; + } + if (message.iouThreshold != null && message.hasOwnProperty("iouThreshold")) + object.iouThreshold = options.json && !isFinite(message.iouThreshold) ? String(message.iouThreshold) : message.iouThreshold; + if (message.meanAveragePrecision != null && message.hasOwnProperty("meanAveragePrecision")) + object.meanAveragePrecision = options.json && !isFinite(message.meanAveragePrecision) ? String(message.meanAveragePrecision) : message.meanAveragePrecision; + if (message.confidenceMetricsEntries && message.confidenceMetricsEntries.length) { + object.confidenceMetricsEntries = []; + for (var j = 0; j < message.confidenceMetricsEntries.length; ++j) + object.confidenceMetricsEntries[j] = $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.toObject(message.confidenceMetricsEntries[j], options); + } + return object; + }; + + /** + * Converts this BoundingBoxMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @instance + * @returns {Object.} JSON object + */ + BoundingBoxMetricsEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoundingBoxMetricsEntry + * @function getTypeUrl + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoundingBoxMetricsEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.BoundingBoxMetricsEntry"; + }; + + BoundingBoxMetricsEntry.ConfidenceMetricsEntry = (function() { + + /** + * Properties of a ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @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 + */ + + /** + * Constructs a new ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @classdesc Represents a ConfidenceMetricsEntry. + * @implements IConfidenceMetricsEntry + * @constructor + * @param {google.cloud.automl.v1.BoundingBoxMetricsEntry.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.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.confidenceThreshold = 0; + + /** + * ConfidenceMetricsEntry recall. + * @member {number} recall + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recall = 0; + + /** + * ConfidenceMetricsEntry precision. + * @member {number} precision + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precision = 0; + + /** + * ConfidenceMetricsEntry f1Score. + * @member {number} f1Score + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1Score = 0; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} ConfidenceMetricsEntry instance + */ + ConfidenceMetricsEntry.create = function create(properties) { + return new ConfidenceMetricsEntry(properties); + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.BoundingBoxMetricsEntry.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); + return writer; + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.BoundingBoxMetricsEntry.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.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry.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.automl.v1.BoundingBoxMetricsEntry.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; + } + 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.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry.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.automl.v1.BoundingBoxMetricsEntry.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"; + return null; + }; + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} ConfidenceMetricsEntry + */ + ConfidenceMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry) + return object; + var message = new $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.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); + return message; + }; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.BoundingBoxMetricsEntry.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; + } + 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; + return object; + }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.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.automl.v1.BoundingBoxMetricsEntry.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.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry"; + }; + + return ConfidenceMetricsEntry; + })(); + + return BoundingBoxMetricsEntry; + })(); + + v1.ImageObjectDetectionEvaluationMetrics = (function() { + + /** + * Properties of an ImageObjectDetectionEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @interface IImageObjectDetectionEvaluationMetrics + * @property {number|null} [evaluatedBoundingBoxCount] ImageObjectDetectionEvaluationMetrics evaluatedBoundingBoxCount + * @property {Array.|null} [boundingBoxMetricsEntries] ImageObjectDetectionEvaluationMetrics boundingBoxMetricsEntries + * @property {number|null} [boundingBoxMeanAveragePrecision] ImageObjectDetectionEvaluationMetrics boundingBoxMeanAveragePrecision + */ + + /** + * Constructs a new ImageObjectDetectionEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImageObjectDetectionEvaluationMetrics. + * @implements IImageObjectDetectionEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics=} [properties] Properties to set + */ + function ImageObjectDetectionEvaluationMetrics(properties) { + this.boundingBoxMetricsEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionEvaluationMetrics evaluatedBoundingBoxCount. + * @member {number} evaluatedBoundingBoxCount + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @instance + */ + ImageObjectDetectionEvaluationMetrics.prototype.evaluatedBoundingBoxCount = 0; + + /** + * ImageObjectDetectionEvaluationMetrics boundingBoxMetricsEntries. + * @member {Array.} boundingBoxMetricsEntries + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @instance + */ + ImageObjectDetectionEvaluationMetrics.prototype.boundingBoxMetricsEntries = $util.emptyArray; + + /** + * ImageObjectDetectionEvaluationMetrics boundingBoxMeanAveragePrecision. + * @member {number} boundingBoxMeanAveragePrecision + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @instance + */ + ImageObjectDetectionEvaluationMetrics.prototype.boundingBoxMeanAveragePrecision = 0; + + /** + * Creates a new ImageObjectDetectionEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics} ImageObjectDetectionEvaluationMetrics instance + */ + ImageObjectDetectionEvaluationMetrics.create = function create(properties) { + return new ImageObjectDetectionEvaluationMetrics(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics} message ImageObjectDetectionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluatedBoundingBoxCount != null && Object.hasOwnProperty.call(message, "evaluatedBoundingBoxCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.evaluatedBoundingBoxCount); + if (message.boundingBoxMetricsEntries != null && message.boundingBoxMetricsEntries.length) + for (var i = 0; i < message.boundingBoxMetricsEntries.length; ++i) + $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.encode(message.boundingBoxMetricsEntries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.boundingBoxMeanAveragePrecision != null && Object.hasOwnProperty.call(message, "boundingBoxMeanAveragePrecision")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.boundingBoxMeanAveragePrecision); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics} message ImageObjectDetectionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics} ImageObjectDetectionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.evaluatedBoundingBoxCount = reader.int32(); + break; + } + case 2: { + if (!(message.boundingBoxMetricsEntries && message.boundingBoxMetricsEntries.length)) + message.boundingBoxMetricsEntries = []; + message.boundingBoxMetricsEntries.push($root.google.cloud.automl.v1.BoundingBoxMetricsEntry.decode(reader, reader.uint32())); + break; + } + case 3: { + message.boundingBoxMeanAveragePrecision = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics} ImageObjectDetectionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluatedBoundingBoxCount != null && message.hasOwnProperty("evaluatedBoundingBoxCount")) + if (!$util.isInteger(message.evaluatedBoundingBoxCount)) + return "evaluatedBoundingBoxCount: integer expected"; + if (message.boundingBoxMetricsEntries != null && message.hasOwnProperty("boundingBoxMetricsEntries")) { + if (!Array.isArray(message.boundingBoxMetricsEntries)) + return "boundingBoxMetricsEntries: array expected"; + for (var i = 0; i < message.boundingBoxMetricsEntries.length; ++i) { + var error = $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.verify(message.boundingBoxMetricsEntries[i]); + if (error) + return "boundingBoxMetricsEntries." + error; + } + } + if (message.boundingBoxMeanAveragePrecision != null && message.hasOwnProperty("boundingBoxMeanAveragePrecision")) + if (typeof message.boundingBoxMeanAveragePrecision !== "number") + return "boundingBoxMeanAveragePrecision: number expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics} ImageObjectDetectionEvaluationMetrics + */ + ImageObjectDetectionEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics(); + if (object.evaluatedBoundingBoxCount != null) + message.evaluatedBoundingBoxCount = object.evaluatedBoundingBoxCount | 0; + if (object.boundingBoxMetricsEntries) { + if (!Array.isArray(object.boundingBoxMetricsEntries)) + throw TypeError(".google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.boundingBoxMetricsEntries: array expected"); + message.boundingBoxMetricsEntries = []; + for (var i = 0; i < object.boundingBoxMetricsEntries.length; ++i) { + if (typeof object.boundingBoxMetricsEntries[i] !== "object") + throw TypeError(".google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.boundingBoxMetricsEntries: object expected"); + message.boundingBoxMetricsEntries[i] = $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.fromObject(object.boundingBoxMetricsEntries[i]); + } + } + if (object.boundingBoxMeanAveragePrecision != null) + message.boundingBoxMeanAveragePrecision = Number(object.boundingBoxMeanAveragePrecision); + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics} message ImageObjectDetectionEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.boundingBoxMetricsEntries = []; + if (options.defaults) { + object.evaluatedBoundingBoxCount = 0; + object.boundingBoxMeanAveragePrecision = 0; + } + if (message.evaluatedBoundingBoxCount != null && message.hasOwnProperty("evaluatedBoundingBoxCount")) + object.evaluatedBoundingBoxCount = message.evaluatedBoundingBoxCount; + if (message.boundingBoxMetricsEntries && message.boundingBoxMetricsEntries.length) { + object.boundingBoxMetricsEntries = []; + for (var j = 0; j < message.boundingBoxMetricsEntries.length; ++j) + object.boundingBoxMetricsEntries[j] = $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.toObject(message.boundingBoxMetricsEntries[j], options); + } + if (message.boundingBoxMeanAveragePrecision != null && message.hasOwnProperty("boundingBoxMeanAveragePrecision")) + object.boundingBoxMeanAveragePrecision = options.json && !isFinite(message.boundingBoxMeanAveragePrecision) ? String(message.boundingBoxMeanAveragePrecision) : message.boundingBoxMeanAveragePrecision; + return object; + }; + + /** + * Converts this ImageObjectDetectionEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics"; + }; + + return ImageObjectDetectionEvaluationMetrics; + })(); + + v1.NormalizedVertex = (function() { + + /** + * Properties of a NormalizedVertex. + * @memberof google.cloud.automl.v1 + * @interface INormalizedVertex + * @property {number|null} [x] NormalizedVertex x + * @property {number|null} [y] NormalizedVertex y + */ + + /** + * Constructs a new NormalizedVertex. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a NormalizedVertex. + * @implements INormalizedVertex + * @constructor + * @param {google.cloud.automl.v1.INormalizedVertex=} [properties] Properties to set + */ + function NormalizedVertex(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedVertex x. + * @member {number} x + * @memberof google.cloud.automl.v1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.x = 0; + + /** + * NormalizedVertex y. + * @member {number} y + * @memberof google.cloud.automl.v1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.y = 0; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {google.cloud.automl.v1.INormalizedVertex=} [properties] Properties to set + * @returns {google.cloud.automl.v1.NormalizedVertex} NormalizedVertex instance + */ + NormalizedVertex.create = function create(properties) { + return new NormalizedVertex(properties); + }; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.automl.v1.NormalizedVertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {google.cloud.automl.v1.INormalizedVertex} message NormalizedVertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedVertex.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.x != null && Object.hasOwnProperty.call(message, "x")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.x); + if (message.y != null && Object.hasOwnProperty.call(message, "y")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.y); + return writer; + }; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.automl.v1.NormalizedVertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {google.cloud.automl.v1.INormalizedVertex} message NormalizedVertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedVertex.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.NormalizedVertex} NormalizedVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedVertex.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.NormalizedVertex(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.x = reader.float(); + break; + } + case 2: { + message.y = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.NormalizedVertex} NormalizedVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedVertex.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedVertex message. + * @function verify + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedVertex.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.x != null && message.hasOwnProperty("x")) + if (typeof message.x !== "number") + return "x: number expected"; + if (message.y != null && message.hasOwnProperty("y")) + if (typeof message.y !== "number") + return "y: number expected"; + return null; + }; + + /** + * Creates a NormalizedVertex message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.NormalizedVertex} NormalizedVertex + */ + NormalizedVertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.NormalizedVertex) + return object; + var message = new $root.google.cloud.automl.v1.NormalizedVertex(); + if (object.x != null) + message.x = Number(object.x); + if (object.y != null) + message.y = Number(object.y); + return message; + }; + + /** + * Creates a plain object from a NormalizedVertex message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {google.cloud.automl.v1.NormalizedVertex} message NormalizedVertex + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedVertex.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.x = 0; + object.y = 0; + } + if (message.x != null && message.hasOwnProperty("x")) + object.x = options.json && !isFinite(message.x) ? String(message.x) : message.x; + if (message.y != null && message.hasOwnProperty("y")) + object.y = options.json && !isFinite(message.y) ? String(message.y) : message.y; + return object; + }; + + /** + * Converts this NormalizedVertex to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.NormalizedVertex + * @instance + * @returns {Object.} JSON object + */ + NormalizedVertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedVertex + * @function getTypeUrl + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedVertex.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.NormalizedVertex"; + }; + + return NormalizedVertex; + })(); + + v1.BoundingPoly = (function() { + + /** + * Properties of a BoundingPoly. + * @memberof google.cloud.automl.v1 + * @interface IBoundingPoly + * @property {Array.|null} [normalizedVertices] BoundingPoly normalizedVertices + */ + + /** + * Constructs a new BoundingPoly. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a BoundingPoly. + * @implements IBoundingPoly + * @constructor + * @param {google.cloud.automl.v1.IBoundingPoly=} [properties] Properties to set + */ + function BoundingPoly(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]]; + } + + /** + * BoundingPoly normalizedVertices. + * @member {Array.} normalizedVertices + * @memberof google.cloud.automl.v1.BoundingPoly + * @instance + */ + BoundingPoly.prototype.normalizedVertices = $util.emptyArray; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {google.cloud.automl.v1.IBoundingPoly=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BoundingPoly} BoundingPoly instance + */ + BoundingPoly.create = function create(properties) { + return new BoundingPoly(properties); + }; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.automl.v1.BoundingPoly.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {google.cloud.automl.v1.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.normalizedVertices != null && message.normalizedVertices.length) + for (var i = 0; i < message.normalizedVertices.length; ++i) + $root.google.cloud.automl.v1.NormalizedVertex.encode(message.normalizedVertices[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BoundingPoly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {google.cloud.automl.v1.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.automl.v1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.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.automl.v1.BoundingPoly(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.normalizedVertices && message.normalizedVertices.length)) + message.normalizedVertices = []; + message.normalizedVertices.push($root.google.cloud.automl.v1.NormalizedVertex.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.automl.v1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.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.automl.v1.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.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.automl.v1.NormalizedVertex.verify(message.normalizedVertices[i]); + if (error) + return "normalizedVertices." + error; + } + } + return null; + }; + + /** + * Creates a BoundingPoly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BoundingPoly} BoundingPoly + */ + BoundingPoly.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BoundingPoly) + return object; + var message = new $root.google.cloud.automl.v1.BoundingPoly(); + if (object.normalizedVertices) { + if (!Array.isArray(object.normalizedVertices)) + throw TypeError(".google.cloud.automl.v1.BoundingPoly.normalizedVertices: array expected"); + message.normalizedVertices = []; + for (var i = 0; i < object.normalizedVertices.length; ++i) { + if (typeof object.normalizedVertices[i] !== "object") + throw TypeError(".google.cloud.automl.v1.BoundingPoly.normalizedVertices: object expected"); + message.normalizedVertices[i] = $root.google.cloud.automl.v1.NormalizedVertex.fromObject(object.normalizedVertices[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoundingPoly message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {google.cloud.automl.v1.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.normalizedVertices = []; + if (message.normalizedVertices && message.normalizedVertices.length) { + object.normalizedVertices = []; + for (var j = 0; j < message.normalizedVertices.length; ++j) + object.normalizedVertices[j] = $root.google.cloud.automl.v1.NormalizedVertex.toObject(message.normalizedVertices[j], options); + } + return object; + }; + + /** + * Converts this BoundingPoly to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.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.automl.v1.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.automl.v1.BoundingPoly"; + }; + + return BoundingPoly; + })(); + + v1.TextExtractionAnnotation = (function() { + + /** + * Properties of a TextExtractionAnnotation. + * @memberof google.cloud.automl.v1 + * @interface ITextExtractionAnnotation + * @property {google.cloud.automl.v1.ITextSegment|null} [textSegment] TextExtractionAnnotation textSegment + * @property {number|null} [score] TextExtractionAnnotation score + */ + + /** + * Constructs a new TextExtractionAnnotation. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextExtractionAnnotation. + * @implements ITextExtractionAnnotation + * @constructor + * @param {google.cloud.automl.v1.ITextExtractionAnnotation=} [properties] Properties to set + */ + function TextExtractionAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextExtractionAnnotation textSegment. + * @member {google.cloud.automl.v1.ITextSegment|null|undefined} textSegment + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @instance + */ + TextExtractionAnnotation.prototype.textSegment = null; + + /** + * TextExtractionAnnotation score. + * @member {number} score + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @instance + */ + TextExtractionAnnotation.prototype.score = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TextExtractionAnnotation annotation. + * @member {"textSegment"|undefined} annotation + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @instance + */ + Object.defineProperty(TextExtractionAnnotation.prototype, "annotation", { + get: $util.oneOfGetter($oneOfFields = ["textSegment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TextExtractionAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {google.cloud.automl.v1.ITextExtractionAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextExtractionAnnotation} TextExtractionAnnotation instance + */ + TextExtractionAnnotation.create = function create(properties) { + return new TextExtractionAnnotation(properties); + }; + + /** + * Encodes the specified TextExtractionAnnotation message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {google.cloud.automl.v1.ITextExtractionAnnotation} message TextExtractionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionAnnotation.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.textSegment != null && Object.hasOwnProperty.call(message, "textSegment")) + $root.google.cloud.automl.v1.TextSegment.encode(message.textSegment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextExtractionAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {google.cloud.automl.v1.ITextExtractionAnnotation} message TextExtractionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextExtractionAnnotation} TextExtractionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextExtractionAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.textSegment = $root.google.cloud.automl.v1.TextSegment.decode(reader, reader.uint32()); + break; + } + case 1: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextExtractionAnnotation} TextExtractionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.textSegment != null && message.hasOwnProperty("textSegment")) { + properties.annotation = 1; + { + var error = $root.google.cloud.automl.v1.TextSegment.verify(message.textSegment); + if (error) + return "textSegment." + error; + } + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a TextExtractionAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextExtractionAnnotation} TextExtractionAnnotation + */ + TextExtractionAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextExtractionAnnotation) + return object; + var message = new $root.google.cloud.automl.v1.TextExtractionAnnotation(); + if (object.textSegment != null) { + if (typeof object.textSegment !== "object") + throw TypeError(".google.cloud.automl.v1.TextExtractionAnnotation.textSegment: object expected"); + message.textSegment = $root.google.cloud.automl.v1.TextSegment.fromObject(object.textSegment); + } + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a TextExtractionAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {google.cloud.automl.v1.TextExtractionAnnotation} message TextExtractionAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.score = 0; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.textSegment != null && message.hasOwnProperty("textSegment")) { + object.textSegment = $root.google.cloud.automl.v1.TextSegment.toObject(message.textSegment, options); + if (options.oneofs) + object.annotation = "textSegment"; + } + return object; + }; + + /** + * Converts this TextExtractionAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @instance + * @returns {Object.} JSON object + */ + TextExtractionAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextExtractionAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextExtractionAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextExtractionAnnotation"; + }; + + return TextExtractionAnnotation; + })(); + + v1.TextExtractionEvaluationMetrics = (function() { + + /** + * Properties of a TextExtractionEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @interface ITextExtractionEvaluationMetrics + * @property {number|null} [auPrc] TextExtractionEvaluationMetrics auPrc + * @property {Array.|null} [confidenceMetricsEntries] TextExtractionEvaluationMetrics confidenceMetricsEntries + */ + + /** + * Constructs a new TextExtractionEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextExtractionEvaluationMetrics. + * @implements ITextExtractionEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1.ITextExtractionEvaluationMetrics=} [properties] Properties to set + */ + function TextExtractionEvaluationMetrics(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]]; + } + + /** + * TextExtractionEvaluationMetrics auPrc. + * @member {number} auPrc + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @instance + */ + TextExtractionEvaluationMetrics.prototype.auPrc = 0; + + /** + * TextExtractionEvaluationMetrics confidenceMetricsEntries. + * @member {Array.} confidenceMetricsEntries + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @instance + */ + TextExtractionEvaluationMetrics.prototype.confidenceMetricsEntries = $util.emptyArray; + + /** + * Creates a new TextExtractionEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITextExtractionEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics} TextExtractionEvaluationMetrics instance + */ + TextExtractionEvaluationMetrics.create = function create(properties) { + return new TextExtractionEvaluationMetrics(properties); + }; + + /** + * Encodes the specified TextExtractionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITextExtractionEvaluationMetrics} message TextExtractionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.auPrc != null && Object.hasOwnProperty.call(message, "auPrc")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.auPrc); + if (message.confidenceMetricsEntries != null && message.confidenceMetricsEntries.length) + for (var i = 0; i < message.confidenceMetricsEntries.length; ++i) + $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.encode(message.confidenceMetricsEntries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextExtractionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITextExtractionEvaluationMetrics} message TextExtractionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics} TextExtractionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.auPrc = reader.float(); + break; + } + case 2: { + if (!(message.confidenceMetricsEntries && message.confidenceMetricsEntries.length)) + message.confidenceMetricsEntries = []; + message.confidenceMetricsEntries.push($root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics} TextExtractionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + if (typeof message.auPrc !== "number") + return "auPrc: 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.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify(message.confidenceMetricsEntries[i]); + if (error) + return "confidenceMetricsEntries." + error; + } + } + return null; + }; + + /** + * Creates a TextExtractionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics} TextExtractionEvaluationMetrics + */ + TextExtractionEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics(); + if (object.auPrc != null) + message.auPrc = Number(object.auPrc); + if (object.confidenceMetricsEntries) { + if (!Array.isArray(object.confidenceMetricsEntries)) + throw TypeError(".google.cloud.automl.v1.TextExtractionEvaluationMetrics.confidenceMetricsEntries: array expected"); + message.confidenceMetricsEntries = []; + for (var i = 0; i < object.confidenceMetricsEntries.length; ++i) { + if (typeof object.confidenceMetricsEntries[i] !== "object") + throw TypeError(".google.cloud.automl.v1.TextExtractionEvaluationMetrics.confidenceMetricsEntries: object expected"); + message.confidenceMetricsEntries[i] = $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.fromObject(object.confidenceMetricsEntries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TextExtractionEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.TextExtractionEvaluationMetrics} message TextExtractionEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.confidenceMetricsEntries = []; + if (options.defaults) + object.auPrc = 0; + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + object.auPrc = options.json && !isFinite(message.auPrc) ? String(message.auPrc) : message.auPrc; + if (message.confidenceMetricsEntries && message.confidenceMetricsEntries.length) { + object.confidenceMetricsEntries = []; + for (var j = 0; j < message.confidenceMetricsEntries.length; ++j) + object.confidenceMetricsEntries[j] = $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.toObject(message.confidenceMetricsEntries[j], options); + } + return object; + }; + + /** + * Converts this TextExtractionEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + TextExtractionEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextExtractionEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextExtractionEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextExtractionEvaluationMetrics"; + }; + + TextExtractionEvaluationMetrics.ConfidenceMetricsEntry = (function() { + + /** + * Properties of a ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @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 + */ + + /** + * Constructs a new ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @classdesc Represents a ConfidenceMetricsEntry. + * @implements IConfidenceMetricsEntry + * @constructor + * @param {google.cloud.automl.v1.TextExtractionEvaluationMetrics.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.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.confidenceThreshold = 0; + + /** + * ConfidenceMetricsEntry recall. + * @member {number} recall + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recall = 0; + + /** + * ConfidenceMetricsEntry precision. + * @member {number} precision + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precision = 0; + + /** + * ConfidenceMetricsEntry f1Score. + * @member {number} f1Score + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1Score = 0; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry instance + */ + ConfidenceMetricsEntry.create = function create(properties) { + return new ConfidenceMetricsEntry(properties); + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.TextExtractionEvaluationMetrics.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 3, wireType 5 =*/29).float(message.recall); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.precision); + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.f1Score); + return writer; + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.TextExtractionEvaluationMetrics.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.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics.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.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.confidenceThreshold = reader.float(); + break; + } + case 3: { + message.recall = reader.float(); + break; + } + case 4: { + message.precision = reader.float(); + break; + } + case 5: { + message.f1Score = 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.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics.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.automl.v1.TextExtractionEvaluationMetrics.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"; + return null; + }; + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + */ + ConfidenceMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry) + return object; + var message = new $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.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); + return message; + }; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.TextExtractionEvaluationMetrics.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; + } + 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; + return object; + }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.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.automl.v1.TextExtractionEvaluationMetrics.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.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry"; + }; + + return ConfidenceMetricsEntry; + })(); + + return TextExtractionEvaluationMetrics; + })(); + + v1.TextSegment = (function() { + + /** + * Properties of a TextSegment. + * @memberof google.cloud.automl.v1 + * @interface ITextSegment + * @property {string|null} [content] TextSegment content + * @property {number|Long|null} [startOffset] TextSegment startOffset + * @property {number|Long|null} [endOffset] TextSegment endOffset + */ + + /** + * Constructs a new TextSegment. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextSegment. + * @implements ITextSegment + * @constructor + * @param {google.cloud.automl.v1.ITextSegment=} [properties] Properties to set + */ + function TextSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSegment content. + * @member {string} content + * @memberof google.cloud.automl.v1.TextSegment + * @instance + */ + TextSegment.prototype.content = ""; + + /** + * TextSegment startOffset. + * @member {number|Long} startOffset + * @memberof google.cloud.automl.v1.TextSegment + * @instance + */ + TextSegment.prototype.startOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TextSegment endOffset. + * @member {number|Long} endOffset + * @memberof google.cloud.automl.v1.TextSegment + * @instance + */ + TextSegment.prototype.endOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TextSegment instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {google.cloud.automl.v1.ITextSegment=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextSegment} TextSegment instance + */ + TextSegment.create = function create(properties) { + return new TextSegment(properties); + }; + + /** + * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.automl.v1.TextSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {google.cloud.automl.v1.ITextSegment} message TextSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startOffset != null && Object.hasOwnProperty.call(message, "startOffset")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.startOffset); + if (message.endOffset != null && Object.hasOwnProperty.call(message, "endOffset")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.endOffset); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.content); + return writer; + }; + + /** + * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {google.cloud.automl.v1.ITextSegment} message TextSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextSegment} TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSegment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.content = reader.string(); + break; + } + case 1: { + message.startOffset = reader.int64(); + break; + } + case 2: { + message.endOffset = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextSegment} TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSegment message. + * @function verify + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + if (!$util.isInteger(message.startOffset) && !(message.startOffset && $util.isInteger(message.startOffset.low) && $util.isInteger(message.startOffset.high))) + return "startOffset: integer|Long expected"; + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + if (!$util.isInteger(message.endOffset) && !(message.endOffset && $util.isInteger(message.endOffset.low) && $util.isInteger(message.endOffset.high))) + return "endOffset: integer|Long expected"; + return null; + }; + + /** + * Creates a TextSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextSegment} TextSegment + */ + TextSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextSegment) + return object; + var message = new $root.google.cloud.automl.v1.TextSegment(); + if (object.content != null) + message.content = String(object.content); + if (object.startOffset != null) + if ($util.Long) + (message.startOffset = $util.Long.fromValue(object.startOffset)).unsigned = false; + else if (typeof object.startOffset === "string") + message.startOffset = parseInt(object.startOffset, 10); + else if (typeof object.startOffset === "number") + message.startOffset = object.startOffset; + else if (typeof object.startOffset === "object") + message.startOffset = new $util.LongBits(object.startOffset.low >>> 0, object.startOffset.high >>> 0).toNumber(); + if (object.endOffset != null) + if ($util.Long) + (message.endOffset = $util.Long.fromValue(object.endOffset)).unsigned = false; + else if (typeof object.endOffset === "string") + message.endOffset = parseInt(object.endOffset, 10); + else if (typeof object.endOffset === "number") + message.endOffset = object.endOffset; + else if (typeof object.endOffset === "object") + message.endOffset = new $util.LongBits(object.endOffset.low >>> 0, object.endOffset.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a TextSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {google.cloud.automl.v1.TextSegment} message TextSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.startOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startOffset = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.endOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.endOffset = options.longs === String ? "0" : 0; + object.content = ""; + } + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + if (typeof message.startOffset === "number") + object.startOffset = options.longs === String ? String(message.startOffset) : message.startOffset; + else + object.startOffset = options.longs === String ? $util.Long.prototype.toString.call(message.startOffset) : options.longs === Number ? new $util.LongBits(message.startOffset.low >>> 0, message.startOffset.high >>> 0).toNumber() : message.startOffset; + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + if (typeof message.endOffset === "number") + object.endOffset = options.longs === String ? String(message.endOffset) : message.endOffset; + else + object.endOffset = options.longs === String ? $util.Long.prototype.toString.call(message.endOffset) : options.longs === Number ? new $util.LongBits(message.endOffset.low >>> 0, message.endOffset.high >>> 0).toNumber() : message.endOffset; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + return object; + }; + + /** + * Converts this TextSegment to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextSegment + * @instance + * @returns {Object.} JSON object + */ + TextSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSegment + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextSegment"; + }; + + return TextSegment; + })(); + + v1.TextSentimentAnnotation = (function() { + + /** + * Properties of a TextSentimentAnnotation. + * @memberof google.cloud.automl.v1 + * @interface ITextSentimentAnnotation + * @property {number|null} [sentiment] TextSentimentAnnotation sentiment + */ + + /** + * Constructs a new TextSentimentAnnotation. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextSentimentAnnotation. + * @implements ITextSentimentAnnotation + * @constructor + * @param {google.cloud.automl.v1.ITextSentimentAnnotation=} [properties] Properties to set + */ + function TextSentimentAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSentimentAnnotation sentiment. + * @member {number} sentiment + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @instance + */ + TextSentimentAnnotation.prototype.sentiment = 0; + + /** + * Creates a new TextSentimentAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {google.cloud.automl.v1.ITextSentimentAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextSentimentAnnotation} TextSentimentAnnotation instance + */ + TextSentimentAnnotation.create = function create(properties) { + return new TextSentimentAnnotation(properties); + }; + + /** + * Encodes the specified TextSentimentAnnotation message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {google.cloud.automl.v1.ITextSentimentAnnotation} message TextSentimentAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sentiment != null && Object.hasOwnProperty.call(message, "sentiment")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sentiment); + return writer; + }; + + /** + * Encodes the specified TextSentimentAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {google.cloud.automl.v1.ITextSentimentAnnotation} message TextSentimentAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextSentimentAnnotation} TextSentimentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextSentimentAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sentiment = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextSentimentAnnotation} TextSentimentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sentiment != null && message.hasOwnProperty("sentiment")) + if (!$util.isInteger(message.sentiment)) + return "sentiment: integer expected"; + return null; + }; + + /** + * Creates a TextSentimentAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextSentimentAnnotation} TextSentimentAnnotation + */ + TextSentimentAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextSentimentAnnotation) + return object; + var message = new $root.google.cloud.automl.v1.TextSentimentAnnotation(); + if (object.sentiment != null) + message.sentiment = object.sentiment | 0; + return message; + }; + + /** + * Creates a plain object from a TextSentimentAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {google.cloud.automl.v1.TextSentimentAnnotation} message TextSentimentAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sentiment = 0; + if (message.sentiment != null && message.hasOwnProperty("sentiment")) + object.sentiment = message.sentiment; + return object; + }; + + /** + * Converts this TextSentimentAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @instance + * @returns {Object.} JSON object + */ + TextSentimentAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSentimentAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSentimentAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextSentimentAnnotation"; + }; + + return TextSentimentAnnotation; + })(); + + v1.TextSentimentEvaluationMetrics = (function() { + + /** + * Properties of a TextSentimentEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @interface ITextSentimentEvaluationMetrics + * @property {number|null} [precision] TextSentimentEvaluationMetrics precision + * @property {number|null} [recall] TextSentimentEvaluationMetrics recall + * @property {number|null} [f1Score] TextSentimentEvaluationMetrics f1Score + * @property {number|null} [meanAbsoluteError] TextSentimentEvaluationMetrics meanAbsoluteError + * @property {number|null} [meanSquaredError] TextSentimentEvaluationMetrics meanSquaredError + * @property {number|null} [linearKappa] TextSentimentEvaluationMetrics linearKappa + * @property {number|null} [quadraticKappa] TextSentimentEvaluationMetrics quadraticKappa + * @property {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null} [confusionMatrix] TextSentimentEvaluationMetrics confusionMatrix + */ + + /** + * Constructs a new TextSentimentEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextSentimentEvaluationMetrics. + * @implements ITextSentimentEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1.ITextSentimentEvaluationMetrics=} [properties] Properties to set + */ + function TextSentimentEvaluationMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSentimentEvaluationMetrics precision. + * @member {number} precision + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.precision = 0; + + /** + * TextSentimentEvaluationMetrics recall. + * @member {number} recall + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.recall = 0; + + /** + * TextSentimentEvaluationMetrics f1Score. + * @member {number} f1Score + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.f1Score = 0; + + /** + * TextSentimentEvaluationMetrics meanAbsoluteError. + * @member {number} meanAbsoluteError + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.meanAbsoluteError = 0; + + /** + * TextSentimentEvaluationMetrics meanSquaredError. + * @member {number} meanSquaredError + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.meanSquaredError = 0; + + /** + * TextSentimentEvaluationMetrics linearKappa. + * @member {number} linearKappa + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.linearKappa = 0; + + /** + * TextSentimentEvaluationMetrics quadraticKappa. + * @member {number} quadraticKappa + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.quadraticKappa = 0; + + /** + * TextSentimentEvaluationMetrics confusionMatrix. + * @member {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null|undefined} confusionMatrix + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.confusionMatrix = null; + + /** + * Creates a new TextSentimentEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITextSentimentEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextSentimentEvaluationMetrics} TextSentimentEvaluationMetrics instance + */ + TextSentimentEvaluationMetrics.create = function create(properties) { + return new TextSentimentEvaluationMetrics(properties); + }; + + /** + * Encodes the specified TextSentimentEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITextSentimentEvaluationMetrics} message TextSentimentEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.precision); + if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.recall); + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.f1Score); + if (message.meanAbsoluteError != null && Object.hasOwnProperty.call(message, "meanAbsoluteError")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.meanAbsoluteError); + if (message.meanSquaredError != null && Object.hasOwnProperty.call(message, "meanSquaredError")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.meanSquaredError); + if (message.linearKappa != null && Object.hasOwnProperty.call(message, "linearKappa")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.linearKappa); + if (message.quadraticKappa != null && Object.hasOwnProperty.call(message, "quadraticKappa")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.quadraticKappa); + if (message.confusionMatrix != null && Object.hasOwnProperty.call(message, "confusionMatrix")) + $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.encode(message.confusionMatrix, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextSentimentEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITextSentimentEvaluationMetrics} message TextSentimentEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextSentimentEvaluationMetrics} TextSentimentEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.precision = reader.float(); + break; + } + case 2: { + message.recall = reader.float(); + break; + } + case 3: { + message.f1Score = reader.float(); + break; + } + case 4: { + message.meanAbsoluteError = reader.float(); + break; + } + case 5: { + message.meanSquaredError = reader.float(); + break; + } + case 6: { + message.linearKappa = reader.float(); + break; + } + case 7: { + message.quadraticKappa = reader.float(); + break; + } + case 8: { + message.confusionMatrix = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextSentimentEvaluationMetrics} TextSentimentEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.precision != null && message.hasOwnProperty("precision")) + if (typeof message.precision !== "number") + return "precision: number expected"; + if (message.recall != null && message.hasOwnProperty("recall")) + if (typeof message.recall !== "number") + return "recall: number expected"; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + if (typeof message.f1Score !== "number") + return "f1Score: number expected"; + if (message.meanAbsoluteError != null && message.hasOwnProperty("meanAbsoluteError")) + if (typeof message.meanAbsoluteError !== "number") + return "meanAbsoluteError: number expected"; + if (message.meanSquaredError != null && message.hasOwnProperty("meanSquaredError")) + if (typeof message.meanSquaredError !== "number") + return "meanSquaredError: number expected"; + if (message.linearKappa != null && message.hasOwnProperty("linearKappa")) + if (typeof message.linearKappa !== "number") + return "linearKappa: number expected"; + if (message.quadraticKappa != null && message.hasOwnProperty("quadraticKappa")) + if (typeof message.quadraticKappa !== "number") + return "quadraticKappa: number expected"; + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) { + var error = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.verify(message.confusionMatrix); + if (error) + return "confusionMatrix." + error; + } + return null; + }; + + /** + * Creates a TextSentimentEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextSentimentEvaluationMetrics} TextSentimentEvaluationMetrics + */ + TextSentimentEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics(); + if (object.precision != null) + message.precision = Number(object.precision); + if (object.recall != null) + message.recall = Number(object.recall); + if (object.f1Score != null) + message.f1Score = Number(object.f1Score); + if (object.meanAbsoluteError != null) + message.meanAbsoluteError = Number(object.meanAbsoluteError); + if (object.meanSquaredError != null) + message.meanSquaredError = Number(object.meanSquaredError); + if (object.linearKappa != null) + message.linearKappa = Number(object.linearKappa); + if (object.quadraticKappa != null) + message.quadraticKappa = Number(object.quadraticKappa); + if (object.confusionMatrix != null) { + if (typeof object.confusionMatrix !== "object") + throw TypeError(".google.cloud.automl.v1.TextSentimentEvaluationMetrics.confusionMatrix: object expected"); + message.confusionMatrix = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.fromObject(object.confusionMatrix); + } + return message; + }; + + /** + * Creates a plain object from a TextSentimentEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.TextSentimentEvaluationMetrics} message TextSentimentEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.precision = 0; + object.recall = 0; + object.f1Score = 0; + object.meanAbsoluteError = 0; + object.meanSquaredError = 0; + object.linearKappa = 0; + object.quadraticKappa = 0; + object.confusionMatrix = null; + } + if (message.precision != null && message.hasOwnProperty("precision")) + object.precision = options.json && !isFinite(message.precision) ? String(message.precision) : message.precision; + if (message.recall != null && message.hasOwnProperty("recall")) + object.recall = options.json && !isFinite(message.recall) ? String(message.recall) : message.recall; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + object.f1Score = options.json && !isFinite(message.f1Score) ? String(message.f1Score) : message.f1Score; + if (message.meanAbsoluteError != null && message.hasOwnProperty("meanAbsoluteError")) + object.meanAbsoluteError = options.json && !isFinite(message.meanAbsoluteError) ? String(message.meanAbsoluteError) : message.meanAbsoluteError; + if (message.meanSquaredError != null && message.hasOwnProperty("meanSquaredError")) + object.meanSquaredError = options.json && !isFinite(message.meanSquaredError) ? String(message.meanSquaredError) : message.meanSquaredError; + if (message.linearKappa != null && message.hasOwnProperty("linearKappa")) + object.linearKappa = options.json && !isFinite(message.linearKappa) ? String(message.linearKappa) : message.linearKappa; + if (message.quadraticKappa != null && message.hasOwnProperty("quadraticKappa")) + object.quadraticKappa = options.json && !isFinite(message.quadraticKappa) ? String(message.quadraticKappa) : message.quadraticKappa; + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) + object.confusionMatrix = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.toObject(message.confusionMatrix, options); + return object; + }; + + /** + * Converts this TextSentimentEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + TextSentimentEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSentimentEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSentimentEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextSentimentEvaluationMetrics"; + }; + + return TextSentimentEvaluationMetrics; + })(); + + v1.TranslationDatasetMetadata = (function() { + + /** + * Properties of a TranslationDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITranslationDatasetMetadata + * @property {string|null} [sourceLanguageCode] TranslationDatasetMetadata sourceLanguageCode + * @property {string|null} [targetLanguageCode] TranslationDatasetMetadata targetLanguageCode + */ + + /** + * Constructs a new TranslationDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TranslationDatasetMetadata. + * @implements ITranslationDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1.ITranslationDatasetMetadata=} [properties] Properties to set + */ + function TranslationDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationDatasetMetadata sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @instance + */ + TranslationDatasetMetadata.prototype.sourceLanguageCode = ""; + + /** + * TranslationDatasetMetadata targetLanguageCode. + * @member {string} targetLanguageCode + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @instance + */ + TranslationDatasetMetadata.prototype.targetLanguageCode = ""; + + /** + * Creates a new TranslationDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITranslationDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TranslationDatasetMetadata} TranslationDatasetMetadata instance + */ + TranslationDatasetMetadata.create = function create(properties) { + return new TranslationDatasetMetadata(properties); + }; + + /** + * Encodes the specified TranslationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TranslationDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITranslationDatasetMetadata} message TranslationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceLanguageCode); + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetLanguageCode); + return writer; + }; + + /** + * Encodes the specified TranslationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITranslationDatasetMetadata} message TranslationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TranslationDatasetMetadata} TranslationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TranslationDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sourceLanguageCode = reader.string(); + break; + } + case 2: { + message.targetLanguageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TranslationDatasetMetadata} TranslationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (!$util.isString(message.targetLanguageCode)) + return "targetLanguageCode: string expected"; + return null; + }; + + /** + * Creates a TranslationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TranslationDatasetMetadata} TranslationDatasetMetadata + */ + TranslationDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TranslationDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1.TranslationDatasetMetadata(); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCode != null) + message.targetLanguageCode = String(object.targetLanguageCode); + return message; + }; + + /** + * Creates a plain object from a TranslationDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.TranslationDatasetMetadata} message TranslationDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceLanguageCode = ""; + object.targetLanguageCode = ""; + } + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + object.targetLanguageCode = message.targetLanguageCode; + return object; + }; + + /** + * Converts this TranslationDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TranslationDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranslationDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslationDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TranslationDatasetMetadata"; + }; + + return TranslationDatasetMetadata; + })(); + + v1.TranslationEvaluationMetrics = (function() { + + /** + * Properties of a TranslationEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @interface ITranslationEvaluationMetrics + * @property {number|null} [bleuScore] TranslationEvaluationMetrics bleuScore + * @property {number|null} [baseBleuScore] TranslationEvaluationMetrics baseBleuScore + */ + + /** + * Constructs a new TranslationEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TranslationEvaluationMetrics. + * @implements ITranslationEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1.ITranslationEvaluationMetrics=} [properties] Properties to set + */ + function TranslationEvaluationMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationEvaluationMetrics bleuScore. + * @member {number} bleuScore + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @instance + */ + TranslationEvaluationMetrics.prototype.bleuScore = 0; + + /** + * TranslationEvaluationMetrics baseBleuScore. + * @member {number} baseBleuScore + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @instance + */ + TranslationEvaluationMetrics.prototype.baseBleuScore = 0; + + /** + * Creates a new TranslationEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITranslationEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TranslationEvaluationMetrics} TranslationEvaluationMetrics instance + */ + TranslationEvaluationMetrics.create = function create(properties) { + return new TranslationEvaluationMetrics(properties); + }; + + /** + * Encodes the specified TranslationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.TranslationEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITranslationEvaluationMetrics} message TranslationEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bleuScore != null && Object.hasOwnProperty.call(message, "bleuScore")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.bleuScore); + if (message.baseBleuScore != null && Object.hasOwnProperty.call(message, "baseBleuScore")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.baseBleuScore); + return writer; + }; + + /** + * Encodes the specified TranslationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITranslationEvaluationMetrics} message TranslationEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TranslationEvaluationMetrics} TranslationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TranslationEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.bleuScore = reader.double(); + break; + } + case 2: { + message.baseBleuScore = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TranslationEvaluationMetrics} TranslationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bleuScore != null && message.hasOwnProperty("bleuScore")) + if (typeof message.bleuScore !== "number") + return "bleuScore: number expected"; + if (message.baseBleuScore != null && message.hasOwnProperty("baseBleuScore")) + if (typeof message.baseBleuScore !== "number") + return "baseBleuScore: number expected"; + return null; + }; + + /** + * Creates a TranslationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TranslationEvaluationMetrics} TranslationEvaluationMetrics + */ + TranslationEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TranslationEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1.TranslationEvaluationMetrics(); + if (object.bleuScore != null) + message.bleuScore = Number(object.bleuScore); + if (object.baseBleuScore != null) + message.baseBleuScore = Number(object.baseBleuScore); + return message; + }; + + /** + * Creates a plain object from a TranslationEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.TranslationEvaluationMetrics} message TranslationEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bleuScore = 0; + object.baseBleuScore = 0; + } + if (message.bleuScore != null && message.hasOwnProperty("bleuScore")) + object.bleuScore = options.json && !isFinite(message.bleuScore) ? String(message.bleuScore) : message.bleuScore; + if (message.baseBleuScore != null && message.hasOwnProperty("baseBleuScore")) + object.baseBleuScore = options.json && !isFinite(message.baseBleuScore) ? String(message.baseBleuScore) : message.baseBleuScore; + return object; + }; + + /** + * Converts this TranslationEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + TranslationEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranslationEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslationEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TranslationEvaluationMetrics"; + }; + + return TranslationEvaluationMetrics; + })(); + + v1.TranslationModelMetadata = (function() { + + /** + * Properties of a TranslationModelMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITranslationModelMetadata + * @property {string|null} [baseModel] TranslationModelMetadata baseModel + * @property {string|null} [sourceLanguageCode] TranslationModelMetadata sourceLanguageCode + * @property {string|null} [targetLanguageCode] TranslationModelMetadata targetLanguageCode + */ + + /** + * Constructs a new TranslationModelMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TranslationModelMetadata. + * @implements ITranslationModelMetadata + * @constructor + * @param {google.cloud.automl.v1.ITranslationModelMetadata=} [properties] Properties to set + */ + function TranslationModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationModelMetadata baseModel. + * @member {string} baseModel + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @instance + */ + TranslationModelMetadata.prototype.baseModel = ""; + + /** + * TranslationModelMetadata sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @instance + */ + TranslationModelMetadata.prototype.sourceLanguageCode = ""; + + /** + * TranslationModelMetadata targetLanguageCode. + * @member {string} targetLanguageCode + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @instance + */ + TranslationModelMetadata.prototype.targetLanguageCode = ""; + + /** + * Creates a new TranslationModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {google.cloud.automl.v1.ITranslationModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TranslationModelMetadata} TranslationModelMetadata instance + */ + TranslationModelMetadata.create = function create(properties) { + return new TranslationModelMetadata(properties); + }; + + /** + * Encodes the specified TranslationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TranslationModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {google.cloud.automl.v1.ITranslationModelMetadata} message TranslationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseModel != null && Object.hasOwnProperty.call(message, "baseModel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseModel); + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCode); + return writer; + }; + + /** + * Encodes the specified TranslationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {google.cloud.automl.v1.ITranslationModelMetadata} message TranslationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TranslationModelMetadata} TranslationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TranslationModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.baseModel = reader.string(); + break; + } + case 2: { + message.sourceLanguageCode = reader.string(); + break; + } + case 3: { + message.targetLanguageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TranslationModelMetadata} TranslationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseModel != null && message.hasOwnProperty("baseModel")) + if (!$util.isString(message.baseModel)) + return "baseModel: string expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (!$util.isString(message.targetLanguageCode)) + return "targetLanguageCode: string expected"; + return null; + }; + + /** + * Creates a TranslationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TranslationModelMetadata} TranslationModelMetadata + */ + TranslationModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TranslationModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1.TranslationModelMetadata(); + if (object.baseModel != null) + message.baseModel = String(object.baseModel); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCode != null) + message.targetLanguageCode = String(object.targetLanguageCode); + return message; + }; + + /** + * Creates a plain object from a TranslationModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {google.cloud.automl.v1.TranslationModelMetadata} message TranslationModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.baseModel = ""; + object.sourceLanguageCode = ""; + object.targetLanguageCode = ""; + } + if (message.baseModel != null && message.hasOwnProperty("baseModel")) + object.baseModel = message.baseModel; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + object.targetLanguageCode = message.targetLanguageCode; + return object; + }; + + /** + * Converts this TranslationModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TranslationModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranslationModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslationModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TranslationModelMetadata"; + }; + + return TranslationModelMetadata; + })(); + + v1.TranslationAnnotation = (function() { + + /** + * Properties of a TranslationAnnotation. + * @memberof google.cloud.automl.v1 + * @interface ITranslationAnnotation + * @property {google.cloud.automl.v1.ITextSnippet|null} [translatedContent] TranslationAnnotation translatedContent + */ + + /** + * Constructs a new TranslationAnnotation. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TranslationAnnotation. + * @implements ITranslationAnnotation + * @constructor + * @param {google.cloud.automl.v1.ITranslationAnnotation=} [properties] Properties to set + */ + function TranslationAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationAnnotation translatedContent. + * @member {google.cloud.automl.v1.ITextSnippet|null|undefined} translatedContent + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @instance + */ + TranslationAnnotation.prototype.translatedContent = null; + + /** + * Creates a new TranslationAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {google.cloud.automl.v1.ITranslationAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TranslationAnnotation} TranslationAnnotation instance + */ + TranslationAnnotation.create = function create(properties) { + return new TranslationAnnotation(properties); + }; + + /** + * Encodes the specified TranslationAnnotation message. Does not implicitly {@link google.cloud.automl.v1.TranslationAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {google.cloud.automl.v1.ITranslationAnnotation} message TranslationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.translatedContent != null && Object.hasOwnProperty.call(message, "translatedContent")) + $root.google.cloud.automl.v1.TextSnippet.encode(message.translatedContent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TranslationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {google.cloud.automl.v1.ITranslationAnnotation} message TranslationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TranslationAnnotation} TranslationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TranslationAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.translatedContent = $root.google.cloud.automl.v1.TextSnippet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TranslationAnnotation} TranslationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.translatedContent != null && message.hasOwnProperty("translatedContent")) { + var error = $root.google.cloud.automl.v1.TextSnippet.verify(message.translatedContent); + if (error) + return "translatedContent." + error; + } + return null; + }; + + /** + * Creates a TranslationAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TranslationAnnotation} TranslationAnnotation + */ + TranslationAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TranslationAnnotation) + return object; + var message = new $root.google.cloud.automl.v1.TranslationAnnotation(); + if (object.translatedContent != null) { + if (typeof object.translatedContent !== "object") + throw TypeError(".google.cloud.automl.v1.TranslationAnnotation.translatedContent: object expected"); + message.translatedContent = $root.google.cloud.automl.v1.TextSnippet.fromObject(object.translatedContent); + } + return message; + }; + + /** + * Creates a plain object from a TranslationAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {google.cloud.automl.v1.TranslationAnnotation} message TranslationAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.translatedContent = null; + if (message.translatedContent != null && message.hasOwnProperty("translatedContent")) + object.translatedContent = $root.google.cloud.automl.v1.TextSnippet.toObject(message.translatedContent, options); + return object; + }; + + /** + * Converts this TranslationAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @instance + * @returns {Object.} JSON object + */ + TranslationAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranslationAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslationAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TranslationAnnotation"; + }; + + return TranslationAnnotation; + })(); + + v1.Image = (function() { + + /** + * Properties of an Image. + * @memberof google.cloud.automl.v1 + * @interface IImage + * @property {Uint8Array|null} [imageBytes] Image imageBytes + * @property {string|null} [thumbnailUri] Image thumbnailUri + */ + + /** + * Constructs a new Image. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.cloud.automl.v1.IImage=} [properties] Properties to set + */ + function Image(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Image imageBytes. + * @member {Uint8Array|null|undefined} imageBytes + * @memberof google.cloud.automl.v1.Image + * @instance + */ + Image.prototype.imageBytes = null; + + /** + * Image thumbnailUri. + * @member {string} thumbnailUri + * @memberof google.cloud.automl.v1.Image + * @instance + */ + Image.prototype.thumbnailUri = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Image data. + * @member {"imageBytes"|undefined} data + * @memberof google.cloud.automl.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["imageBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.Image + * @static + * @param {google.cloud.automl.v1.IImage=} [properties] Properties to set + * @returns {google.cloud.automl.v1.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.automl.v1.Image.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.Image + * @static + * @param {google.cloud.automl.v1.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageBytes != null && Object.hasOwnProperty.call(message, "imageBytes")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.imageBytes); + if (message.thumbnailUri != null && Object.hasOwnProperty.call(message, "thumbnailUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.thumbnailUri); + return writer; + }; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.Image + * @static + * @param {google.cloud.automl.v1.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Image message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.imageBytes = reader.bytes(); + break; + } + case 4: { + message.thumbnailUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Image message. + * @function verify + * @memberof google.cloud.automl.v1.Image + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Image.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.imageBytes != null && message.hasOwnProperty("imageBytes")) { + properties.data = 1; + if (!(message.imageBytes && typeof message.imageBytes.length === "number" || $util.isString(message.imageBytes))) + return "imageBytes: buffer expected"; + } + if (message.thumbnailUri != null && message.hasOwnProperty("thumbnailUri")) + if (!$util.isString(message.thumbnailUri)) + return "thumbnailUri: string expected"; + return null; + }; + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.Image + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.Image) + return object; + var message = new $root.google.cloud.automl.v1.Image(); + 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; + if (object.thumbnailUri != null) + message.thumbnailUri = String(object.thumbnailUri); + return message; + }; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.Image + * @static + * @param {google.cloud.automl.v1.Image} message Image + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Image.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.thumbnailUri = ""; + 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; + if (options.oneofs) + object.data = "imageBytes"; + } + if (message.thumbnailUri != null && message.hasOwnProperty("thumbnailUri")) + object.thumbnailUri = message.thumbnailUri; + return object; + }; + + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Image + * @function getTypeUrl + * @memberof google.cloud.automl.v1.Image + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Image.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.Image"; + }; + + return Image; + })(); + + v1.TextSnippet = (function() { + + /** + * Properties of a TextSnippet. + * @memberof google.cloud.automl.v1 + * @interface ITextSnippet + * @property {string|null} [content] TextSnippet content + * @property {string|null} [mimeType] TextSnippet mimeType + * @property {string|null} [contentUri] TextSnippet contentUri + */ + + /** + * Constructs a new TextSnippet. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextSnippet. + * @implements ITextSnippet + * @constructor + * @param {google.cloud.automl.v1.ITextSnippet=} [properties] Properties to set + */ + function TextSnippet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSnippet content. + * @member {string} content + * @memberof google.cloud.automl.v1.TextSnippet + * @instance + */ + TextSnippet.prototype.content = ""; + + /** + * TextSnippet mimeType. + * @member {string} mimeType + * @memberof google.cloud.automl.v1.TextSnippet + * @instance + */ + TextSnippet.prototype.mimeType = ""; + + /** + * TextSnippet contentUri. + * @member {string} contentUri + * @memberof google.cloud.automl.v1.TextSnippet + * @instance + */ + TextSnippet.prototype.contentUri = ""; + + /** + * Creates a new TextSnippet instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {google.cloud.automl.v1.ITextSnippet=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextSnippet} TextSnippet instance + */ + TextSnippet.create = function create(properties) { + return new TextSnippet(properties); + }; + + /** + * Encodes the specified TextSnippet message. Does not implicitly {@link google.cloud.automl.v1.TextSnippet.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {google.cloud.automl.v1.ITextSnippet} message TextSnippet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSnippet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + if (message.contentUri != null && Object.hasOwnProperty.call(message, "contentUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.contentUri); + return writer; + }; + + /** + * Encodes the specified TextSnippet message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSnippet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {google.cloud.automl.v1.ITextSnippet} message TextSnippet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSnippet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSnippet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextSnippet} TextSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSnippet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextSnippet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + case 4: { + message.contentUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSnippet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextSnippet} TextSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSnippet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSnippet message. + * @function verify + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSnippet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.contentUri != null && message.hasOwnProperty("contentUri")) + if (!$util.isString(message.contentUri)) + return "contentUri: string expected"; + return null; + }; + + /** + * Creates a TextSnippet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextSnippet} TextSnippet + */ + TextSnippet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextSnippet) + return object; + var message = new $root.google.cloud.automl.v1.TextSnippet(); + if (object.content != null) + message.content = String(object.content); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.contentUri != null) + message.contentUri = String(object.contentUri); + return message; + }; + + /** + * Creates a plain object from a TextSnippet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {google.cloud.automl.v1.TextSnippet} message TextSnippet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSnippet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.mimeType = ""; + object.contentUri = ""; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.contentUri != null && message.hasOwnProperty("contentUri")) + object.contentUri = message.contentUri; + return object; + }; + + /** + * Converts this TextSnippet to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextSnippet + * @instance + * @returns {Object.} JSON object + */ + TextSnippet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSnippet + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSnippet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextSnippet"; + }; + + return TextSnippet; + })(); + + v1.DocumentDimensions = (function() { + + /** + * Properties of a DocumentDimensions. + * @memberof google.cloud.automl.v1 + * @interface IDocumentDimensions + * @property {google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit|null} [unit] DocumentDimensions unit + * @property {number|null} [width] DocumentDimensions width + * @property {number|null} [height] DocumentDimensions height + */ + + /** + * Constructs a new DocumentDimensions. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a DocumentDimensions. + * @implements IDocumentDimensions + * @constructor + * @param {google.cloud.automl.v1.IDocumentDimensions=} [properties] Properties to set + */ + function DocumentDimensions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentDimensions unit. + * @member {google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit} unit + * @memberof google.cloud.automl.v1.DocumentDimensions + * @instance + */ + DocumentDimensions.prototype.unit = 0; + + /** + * DocumentDimensions width. + * @member {number} width + * @memberof google.cloud.automl.v1.DocumentDimensions + * @instance + */ + DocumentDimensions.prototype.width = 0; + + /** + * DocumentDimensions height. + * @member {number} height + * @memberof google.cloud.automl.v1.DocumentDimensions + * @instance + */ + DocumentDimensions.prototype.height = 0; + + /** + * Creates a new DocumentDimensions instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {google.cloud.automl.v1.IDocumentDimensions=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DocumentDimensions} DocumentDimensions instance + */ + DocumentDimensions.create = function create(properties) { + return new DocumentDimensions(properties); + }; + + /** + * Encodes the specified DocumentDimensions message. Does not implicitly {@link google.cloud.automl.v1.DocumentDimensions.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {google.cloud.automl.v1.IDocumentDimensions} message DocumentDimensions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentDimensions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.unit); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.width); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.height); + return writer; + }; + + /** + * Encodes the specified DocumentDimensions message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DocumentDimensions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {google.cloud.automl.v1.IDocumentDimensions} message DocumentDimensions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentDimensions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentDimensions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.DocumentDimensions} DocumentDimensions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentDimensions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DocumentDimensions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.unit = reader.int32(); + break; + } + case 2: { + message.width = reader.float(); + break; + } + case 3: { + message.height = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentDimensions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.DocumentDimensions} DocumentDimensions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentDimensions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentDimensions message. + * @function verify + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentDimensions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.unit != null && message.hasOwnProperty("unit")) + switch (message.unit) { + default: + return "unit: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.width != null && message.hasOwnProperty("width")) + if (typeof message.width !== "number") + return "width: number expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height !== "number") + return "height: number expected"; + return null; + }; + + /** + * Creates a DocumentDimensions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.DocumentDimensions} DocumentDimensions + */ + DocumentDimensions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DocumentDimensions) + return object; + var message = new $root.google.cloud.automl.v1.DocumentDimensions(); + switch (object.unit) { + default: + if (typeof object.unit === "number") { + message.unit = object.unit; + break; + } + break; + case "DOCUMENT_DIMENSION_UNIT_UNSPECIFIED": + case 0: + message.unit = 0; + break; + case "INCH": + case 1: + message.unit = 1; + break; + case "CENTIMETER": + case 2: + message.unit = 2; + break; + case "POINT": + case 3: + message.unit = 3; + break; + } + if (object.width != null) + message.width = Number(object.width); + if (object.height != null) + message.height = Number(object.height); + return message; + }; + + /** + * Creates a plain object from a DocumentDimensions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {google.cloud.automl.v1.DocumentDimensions} message DocumentDimensions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentDimensions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.unit = options.enums === String ? "DOCUMENT_DIMENSION_UNIT_UNSPECIFIED" : 0; + object.width = 0; + object.height = 0; + } + if (message.unit != null && message.hasOwnProperty("unit")) + object.unit = options.enums === String ? $root.google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit[message.unit] === undefined ? message.unit : $root.google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit[message.unit] : message.unit; + if (message.width != null && message.hasOwnProperty("width")) + object.width = options.json && !isFinite(message.width) ? String(message.width) : message.width; + if (message.height != null && message.hasOwnProperty("height")) + object.height = options.json && !isFinite(message.height) ? String(message.height) : message.height; + return object; + }; + + /** + * Converts this DocumentDimensions to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.DocumentDimensions + * @instance + * @returns {Object.} JSON object + */ + DocumentDimensions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentDimensions + * @function getTypeUrl + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentDimensions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.DocumentDimensions"; + }; + + /** + * DocumentDimensionUnit enum. + * @name google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit + * @enum {number} + * @property {number} DOCUMENT_DIMENSION_UNIT_UNSPECIFIED=0 DOCUMENT_DIMENSION_UNIT_UNSPECIFIED value + * @property {number} INCH=1 INCH value + * @property {number} CENTIMETER=2 CENTIMETER value + * @property {number} POINT=3 POINT value + */ + DocumentDimensions.DocumentDimensionUnit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENT_DIMENSION_UNIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCH"] = 1; + values[valuesById[2] = "CENTIMETER"] = 2; + values[valuesById[3] = "POINT"] = 3; + return values; + })(); + + return DocumentDimensions; + })(); + + v1.Document = (function() { + + /** + * Properties of a Document. + * @memberof google.cloud.automl.v1 + * @interface IDocument + * @property {google.cloud.automl.v1.IDocumentInputConfig|null} [inputConfig] Document inputConfig + * @property {google.cloud.automl.v1.ITextSnippet|null} [documentText] Document documentText + * @property {Array.|null} [layout] Document layout + * @property {google.cloud.automl.v1.IDocumentDimensions|null} [documentDimensions] Document documentDimensions + * @property {number|null} [pageCount] Document pageCount + */ + + /** + * Constructs a new Document. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a Document. + * @implements IDocument + * @constructor + * @param {google.cloud.automl.v1.IDocument=} [properties] Properties to set + */ + function Document(properties) { + this.layout = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Document inputConfig. + * @member {google.cloud.automl.v1.IDocumentInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1.Document + * @instance + */ + Document.prototype.inputConfig = null; + + /** + * Document documentText. + * @member {google.cloud.automl.v1.ITextSnippet|null|undefined} documentText + * @memberof google.cloud.automl.v1.Document + * @instance + */ + Document.prototype.documentText = null; + + /** + * Document layout. + * @member {Array.} layout + * @memberof google.cloud.automl.v1.Document + * @instance + */ + Document.prototype.layout = $util.emptyArray; + + /** + * Document documentDimensions. + * @member {google.cloud.automl.v1.IDocumentDimensions|null|undefined} documentDimensions + * @memberof google.cloud.automl.v1.Document + * @instance + */ + Document.prototype.documentDimensions = null; + + /** + * Document pageCount. + * @member {number} pageCount + * @memberof google.cloud.automl.v1.Document + * @instance + */ + Document.prototype.pageCount = 0; + + /** + * Creates a new Document instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.Document + * @static + * @param {google.cloud.automl.v1.IDocument=} [properties] Properties to set + * @returns {google.cloud.automl.v1.Document} Document instance + */ + Document.create = function create(properties) { + return new Document(properties); + }; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.automl.v1.Document.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.Document + * @static + * @param {google.cloud.automl.v1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.automl.v1.DocumentInputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.documentText != null && Object.hasOwnProperty.call(message, "documentText")) + $root.google.cloud.automl.v1.TextSnippet.encode(message.documentText, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.layout != null && message.layout.length) + for (var i = 0; i < message.layout.length; ++i) + $root.google.cloud.automl.v1.Document.Layout.encode(message.layout[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.documentDimensions != null && Object.hasOwnProperty.call(message, "documentDimensions")) + $root.google.cloud.automl.v1.DocumentDimensions.encode(message.documentDimensions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.pageCount != null && Object.hasOwnProperty.call(message, "pageCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.pageCount); + return writer; + }; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Document.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.Document + * @static + * @param {google.cloud.automl.v1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Document message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.Document(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputConfig = $root.google.cloud.automl.v1.DocumentInputConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.documentText = $root.google.cloud.automl.v1.TextSnippet.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.layout && message.layout.length)) + message.layout = []; + message.layout.push($root.google.cloud.automl.v1.Document.Layout.decode(reader, reader.uint32())); + break; + } + case 4: { + message.documentDimensions = $root.google.cloud.automl.v1.DocumentDimensions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.pageCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Document message. + * @function verify + * @memberof google.cloud.automl.v1.Document + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Document.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.automl.v1.DocumentInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.documentText != null && message.hasOwnProperty("documentText")) { + var error = $root.google.cloud.automl.v1.TextSnippet.verify(message.documentText); + if (error) + return "documentText." + error; + } + if (message.layout != null && message.hasOwnProperty("layout")) { + if (!Array.isArray(message.layout)) + return "layout: array expected"; + for (var i = 0; i < message.layout.length; ++i) { + var error = $root.google.cloud.automl.v1.Document.Layout.verify(message.layout[i]); + if (error) + return "layout." + error; + } + } + if (message.documentDimensions != null && message.hasOwnProperty("documentDimensions")) { + var error = $root.google.cloud.automl.v1.DocumentDimensions.verify(message.documentDimensions); + if (error) + return "documentDimensions." + error; + } + if (message.pageCount != null && message.hasOwnProperty("pageCount")) + if (!$util.isInteger(message.pageCount)) + return "pageCount: integer expected"; + return null; + }; + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.Document + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.Document} Document + */ + Document.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.Document) + return object; + var message = new $root.google.cloud.automl.v1.Document(); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.Document.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1.DocumentInputConfig.fromObject(object.inputConfig); + } + if (object.documentText != null) { + if (typeof object.documentText !== "object") + throw TypeError(".google.cloud.automl.v1.Document.documentText: object expected"); + message.documentText = $root.google.cloud.automl.v1.TextSnippet.fromObject(object.documentText); + } + if (object.layout) { + if (!Array.isArray(object.layout)) + throw TypeError(".google.cloud.automl.v1.Document.layout: array expected"); + message.layout = []; + for (var i = 0; i < object.layout.length; ++i) { + if (typeof object.layout[i] !== "object") + throw TypeError(".google.cloud.automl.v1.Document.layout: object expected"); + message.layout[i] = $root.google.cloud.automl.v1.Document.Layout.fromObject(object.layout[i]); + } + } + if (object.documentDimensions != null) { + if (typeof object.documentDimensions !== "object") + throw TypeError(".google.cloud.automl.v1.Document.documentDimensions: object expected"); + message.documentDimensions = $root.google.cloud.automl.v1.DocumentDimensions.fromObject(object.documentDimensions); + } + if (object.pageCount != null) + message.pageCount = object.pageCount | 0; + return message; + }; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.Document + * @static + * @param {google.cloud.automl.v1.Document} message Document + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Document.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.layout = []; + if (options.defaults) { + object.inputConfig = null; + object.documentText = null; + object.documentDimensions = null; + object.pageCount = 0; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.automl.v1.DocumentInputConfig.toObject(message.inputConfig, options); + if (message.documentText != null && message.hasOwnProperty("documentText")) + object.documentText = $root.google.cloud.automl.v1.TextSnippet.toObject(message.documentText, options); + if (message.layout && message.layout.length) { + object.layout = []; + for (var j = 0; j < message.layout.length; ++j) + object.layout[j] = $root.google.cloud.automl.v1.Document.Layout.toObject(message.layout[j], options); + } + if (message.documentDimensions != null && message.hasOwnProperty("documentDimensions")) + object.documentDimensions = $root.google.cloud.automl.v1.DocumentDimensions.toObject(message.documentDimensions, options); + if (message.pageCount != null && message.hasOwnProperty("pageCount")) + object.pageCount = message.pageCount; + return object; + }; + + /** + * Converts this Document to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.Document + * @instance + * @returns {Object.} JSON object + */ + Document.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Document + * @function getTypeUrl + * @memberof google.cloud.automl.v1.Document + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.Document"; + }; + + Document.Layout = (function() { + + /** + * Properties of a Layout. + * @memberof google.cloud.automl.v1.Document + * @interface ILayout + * @property {google.cloud.automl.v1.ITextSegment|null} [textSegment] Layout textSegment + * @property {number|null} [pageNumber] Layout pageNumber + * @property {google.cloud.automl.v1.IBoundingPoly|null} [boundingPoly] Layout boundingPoly + * @property {google.cloud.automl.v1.Document.Layout.TextSegmentType|null} [textSegmentType] Layout textSegmentType + */ + + /** + * Constructs a new Layout. + * @memberof google.cloud.automl.v1.Document + * @classdesc Represents a Layout. + * @implements ILayout + * @constructor + * @param {google.cloud.automl.v1.Document.ILayout=} [properties] Properties to set + */ + function Layout(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Layout textSegment. + * @member {google.cloud.automl.v1.ITextSegment|null|undefined} textSegment + * @memberof google.cloud.automl.v1.Document.Layout + * @instance + */ + Layout.prototype.textSegment = null; + + /** + * Layout pageNumber. + * @member {number} pageNumber + * @memberof google.cloud.automl.v1.Document.Layout + * @instance + */ + Layout.prototype.pageNumber = 0; + + /** + * Layout boundingPoly. + * @member {google.cloud.automl.v1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.automl.v1.Document.Layout + * @instance + */ + Layout.prototype.boundingPoly = null; + + /** + * Layout textSegmentType. + * @member {google.cloud.automl.v1.Document.Layout.TextSegmentType} textSegmentType + * @memberof google.cloud.automl.v1.Document.Layout + * @instance + */ + Layout.prototype.textSegmentType = 0; + + /** + * Creates a new Layout instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {google.cloud.automl.v1.Document.ILayout=} [properties] Properties to set + * @returns {google.cloud.automl.v1.Document.Layout} Layout instance + */ + Layout.create = function create(properties) { + return new Layout(properties); + }; + + /** + * Encodes the specified Layout message. Does not implicitly {@link google.cloud.automl.v1.Document.Layout.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {google.cloud.automl.v1.Document.ILayout} message Layout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Layout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textSegment != null && Object.hasOwnProperty.call(message, "textSegment")) + $root.google.cloud.automl.v1.TextSegment.encode(message.textSegment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pageNumber != null && Object.hasOwnProperty.call(message, "pageNumber")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageNumber); + if (message.boundingPoly != null && Object.hasOwnProperty.call(message, "boundingPoly")) + $root.google.cloud.automl.v1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.textSegmentType != null && Object.hasOwnProperty.call(message, "textSegmentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.textSegmentType); + return writer; + }; + + /** + * Encodes the specified Layout message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Document.Layout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {google.cloud.automl.v1.Document.ILayout} message Layout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Layout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Layout message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.Document.Layout} Layout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Layout.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.Document.Layout(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.textSegment = $root.google.cloud.automl.v1.TextSegment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pageNumber = reader.int32(); + break; + } + case 3: { + message.boundingPoly = $root.google.cloud.automl.v1.BoundingPoly.decode(reader, reader.uint32()); + break; + } + case 4: { + message.textSegmentType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Layout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.Document.Layout} Layout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Layout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Layout message. + * @function verify + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Layout.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.textSegment != null && message.hasOwnProperty("textSegment")) { + var error = $root.google.cloud.automl.v1.TextSegment.verify(message.textSegment); + if (error) + return "textSegment." + error; + } + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + if (!$util.isInteger(message.pageNumber)) + return "pageNumber: integer expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.automl.v1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.textSegmentType != null && message.hasOwnProperty("textSegmentType")) + switch (message.textSegmentType) { + default: + return "textSegmentType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + return null; + }; + + /** + * Creates a Layout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.Document.Layout} Layout + */ + Layout.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.Document.Layout) + return object; + var message = new $root.google.cloud.automl.v1.Document.Layout(); + if (object.textSegment != null) { + if (typeof object.textSegment !== "object") + throw TypeError(".google.cloud.automl.v1.Document.Layout.textSegment: object expected"); + message.textSegment = $root.google.cloud.automl.v1.TextSegment.fromObject(object.textSegment); + } + if (object.pageNumber != null) + message.pageNumber = object.pageNumber | 0; + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.automl.v1.Document.Layout.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.automl.v1.BoundingPoly.fromObject(object.boundingPoly); + } + switch (object.textSegmentType) { + default: + if (typeof object.textSegmentType === "number") { + message.textSegmentType = object.textSegmentType; + break; + } + break; + case "TEXT_SEGMENT_TYPE_UNSPECIFIED": + case 0: + message.textSegmentType = 0; + break; + case "TOKEN": + case 1: + message.textSegmentType = 1; + break; + case "PARAGRAPH": + case 2: + message.textSegmentType = 2; + break; + case "FORM_FIELD": + case 3: + message.textSegmentType = 3; + break; + case "FORM_FIELD_NAME": + case 4: + message.textSegmentType = 4; + break; + case "FORM_FIELD_CONTENTS": + case 5: + message.textSegmentType = 5; + break; + case "TABLE": + case 6: + message.textSegmentType = 6; + break; + case "TABLE_HEADER": + case 7: + message.textSegmentType = 7; + break; + case "TABLE_ROW": + case 8: + message.textSegmentType = 8; + break; + case "TABLE_CELL": + case 9: + message.textSegmentType = 9; + break; + } + return message; + }; + + /** + * Creates a plain object from a Layout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {google.cloud.automl.v1.Document.Layout} message Layout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Layout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.textSegment = null; + object.pageNumber = 0; + object.boundingPoly = null; + object.textSegmentType = options.enums === String ? "TEXT_SEGMENT_TYPE_UNSPECIFIED" : 0; + } + if (message.textSegment != null && message.hasOwnProperty("textSegment")) + object.textSegment = $root.google.cloud.automl.v1.TextSegment.toObject(message.textSegment, options); + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + object.pageNumber = message.pageNumber; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.automl.v1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.textSegmentType != null && message.hasOwnProperty("textSegmentType")) + object.textSegmentType = options.enums === String ? $root.google.cloud.automl.v1.Document.Layout.TextSegmentType[message.textSegmentType] === undefined ? message.textSegmentType : $root.google.cloud.automl.v1.Document.Layout.TextSegmentType[message.textSegmentType] : message.textSegmentType; + return object; + }; + + /** + * Converts this Layout to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.Document.Layout + * @instance + * @returns {Object.} JSON object + */ + Layout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Layout + * @function getTypeUrl + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Layout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.Document.Layout"; + }; + + /** + * TextSegmentType enum. + * @name google.cloud.automl.v1.Document.Layout.TextSegmentType + * @enum {number} + * @property {number} TEXT_SEGMENT_TYPE_UNSPECIFIED=0 TEXT_SEGMENT_TYPE_UNSPECIFIED value + * @property {number} TOKEN=1 TOKEN value + * @property {number} PARAGRAPH=2 PARAGRAPH value + * @property {number} FORM_FIELD=3 FORM_FIELD value + * @property {number} FORM_FIELD_NAME=4 FORM_FIELD_NAME value + * @property {number} FORM_FIELD_CONTENTS=5 FORM_FIELD_CONTENTS value + * @property {number} TABLE=6 TABLE value + * @property {number} TABLE_HEADER=7 TABLE_HEADER value + * @property {number} TABLE_ROW=8 TABLE_ROW value + * @property {number} TABLE_CELL=9 TABLE_CELL value + */ + Layout.TextSegmentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TEXT_SEGMENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TOKEN"] = 1; + values[valuesById[2] = "PARAGRAPH"] = 2; + values[valuesById[3] = "FORM_FIELD"] = 3; + values[valuesById[4] = "FORM_FIELD_NAME"] = 4; + values[valuesById[5] = "FORM_FIELD_CONTENTS"] = 5; + values[valuesById[6] = "TABLE"] = 6; + values[valuesById[7] = "TABLE_HEADER"] = 7; + values[valuesById[8] = "TABLE_ROW"] = 8; + values[valuesById[9] = "TABLE_CELL"] = 9; + return values; + })(); + + return Layout; + })(); + + return Document; + })(); + + v1.ExamplePayload = (function() { + + /** + * Properties of an ExamplePayload. + * @memberof google.cloud.automl.v1 + * @interface IExamplePayload + * @property {google.cloud.automl.v1.IImage|null} [image] ExamplePayload image + * @property {google.cloud.automl.v1.ITextSnippet|null} [textSnippet] ExamplePayload textSnippet + * @property {google.cloud.automl.v1.IDocument|null} [document] ExamplePayload document + */ + + /** + * Constructs a new ExamplePayload. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ExamplePayload. + * @implements IExamplePayload + * @constructor + * @param {google.cloud.automl.v1.IExamplePayload=} [properties] Properties to set + */ + function ExamplePayload(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExamplePayload image. + * @member {google.cloud.automl.v1.IImage|null|undefined} image + * @memberof google.cloud.automl.v1.ExamplePayload + * @instance + */ + ExamplePayload.prototype.image = null; + + /** + * ExamplePayload textSnippet. + * @member {google.cloud.automl.v1.ITextSnippet|null|undefined} textSnippet + * @memberof google.cloud.automl.v1.ExamplePayload + * @instance + */ + ExamplePayload.prototype.textSnippet = null; + + /** + * ExamplePayload document. + * @member {google.cloud.automl.v1.IDocument|null|undefined} document + * @memberof google.cloud.automl.v1.ExamplePayload + * @instance + */ + ExamplePayload.prototype.document = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExamplePayload payload. + * @member {"image"|"textSnippet"|"document"|undefined} payload + * @memberof google.cloud.automl.v1.ExamplePayload + * @instance + */ + Object.defineProperty(ExamplePayload.prototype, "payload", { + get: $util.oneOfGetter($oneOfFields = ["image", "textSnippet", "document"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExamplePayload instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {google.cloud.automl.v1.IExamplePayload=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExamplePayload} ExamplePayload instance + */ + ExamplePayload.create = function create(properties) { + return new ExamplePayload(properties); + }; + + /** + * Encodes the specified ExamplePayload message. Does not implicitly {@link google.cloud.automl.v1.ExamplePayload.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {google.cloud.automl.v1.IExamplePayload} message ExamplePayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExamplePayload.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.automl.v1.Image.encode(message.image, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.textSnippet != null && Object.hasOwnProperty.call(message, "textSnippet")) + $root.google.cloud.automl.v1.TextSnippet.encode(message.textSnippet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.automl.v1.Document.encode(message.document, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExamplePayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExamplePayload.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {google.cloud.automl.v1.IExamplePayload} message ExamplePayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExamplePayload.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExamplePayload message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ExamplePayload} ExamplePayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExamplePayload.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExamplePayload(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.image = $root.google.cloud.automl.v1.Image.decode(reader, reader.uint32()); + break; + } + case 2: { + message.textSnippet = $root.google.cloud.automl.v1.TextSnippet.decode(reader, reader.uint32()); + break; + } + case 4: { + message.document = $root.google.cloud.automl.v1.Document.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExamplePayload message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ExamplePayload} ExamplePayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExamplePayload.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExamplePayload message. + * @function verify + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExamplePayload.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.image != null && message.hasOwnProperty("image")) { + properties.payload = 1; + { + var error = $root.google.cloud.automl.v1.Image.verify(message.image); + if (error) + return "image." + error; + } + } + if (message.textSnippet != null && message.hasOwnProperty("textSnippet")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.cloud.automl.v1.TextSnippet.verify(message.textSnippet); + if (error) + return "textSnippet." + error; + } + } + if (message.document != null && message.hasOwnProperty("document")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.cloud.automl.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + } + return null; + }; + + /** + * Creates an ExamplePayload message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ExamplePayload} ExamplePayload + */ + ExamplePayload.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExamplePayload) + return object; + var message = new $root.google.cloud.automl.v1.ExamplePayload(); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.automl.v1.ExamplePayload.image: object expected"); + message.image = $root.google.cloud.automl.v1.Image.fromObject(object.image); + } + if (object.textSnippet != null) { + if (typeof object.textSnippet !== "object") + throw TypeError(".google.cloud.automl.v1.ExamplePayload.textSnippet: object expected"); + message.textSnippet = $root.google.cloud.automl.v1.TextSnippet.fromObject(object.textSnippet); + } + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.automl.v1.ExamplePayload.document: object expected"); + message.document = $root.google.cloud.automl.v1.Document.fromObject(object.document); + } + return message; + }; + + /** + * Creates a plain object from an ExamplePayload message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {google.cloud.automl.v1.ExamplePayload} message ExamplePayload + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExamplePayload.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.image != null && message.hasOwnProperty("image")) { + object.image = $root.google.cloud.automl.v1.Image.toObject(message.image, options); + if (options.oneofs) + object.payload = "image"; + } + if (message.textSnippet != null && message.hasOwnProperty("textSnippet")) { + object.textSnippet = $root.google.cloud.automl.v1.TextSnippet.toObject(message.textSnippet, options); + if (options.oneofs) + object.payload = "textSnippet"; + } + if (message.document != null && message.hasOwnProperty("document")) { + object.document = $root.google.cloud.automl.v1.Document.toObject(message.document, options); + if (options.oneofs) + object.payload = "document"; + } + return object; + }; + + /** + * Converts this ExamplePayload to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ExamplePayload + * @instance + * @returns {Object.} JSON object + */ + ExamplePayload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExamplePayload + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExamplePayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ExamplePayload"; + }; + + return ExamplePayload; + })(); + + v1.InputConfig = (function() { + + /** + * Properties of an InputConfig. + * @memberof google.cloud.automl.v1 + * @interface IInputConfig + * @property {google.cloud.automl.v1.IGcsSource|null} [gcsSource] InputConfig gcsSource + * @property {Object.|null} [params] InputConfig params + */ + + /** + * Constructs a new InputConfig. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an InputConfig. + * @implements IInputConfig + * @constructor + * @param {google.cloud.automl.v1.IInputConfig=} [properties] Properties to set + */ + function InputConfig(properties) { + this.params = {}; + if (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 gcsSource. + * @member {google.cloud.automl.v1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.automl.v1.InputConfig + * @instance + */ + InputConfig.prototype.gcsSource = null; + + /** + * InputConfig params. + * @member {Object.} params + * @memberof google.cloud.automl.v1.InputConfig + * @instance + */ + InputConfig.prototype.params = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InputConfig source. + * @member {"gcsSource"|undefined} source + * @memberof google.cloud.automl.v1.InputConfig + * @instance + */ + Object.defineProperty(InputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {google.cloud.automl.v1.IInputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1.InputConfig} InputConfig instance + */ + InputConfig.create = function create(properties) { + return new InputConfig(properties); + }; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.automl.v1.InputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {google.cloud.automl.v1.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.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.automl.v1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.params[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.InputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {google.cloud.automl.v1.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.automl.v1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.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.automl.v1.InputConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsSource = $root.google.cloud.automl.v1.GcsSource.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + 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.automl.v1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.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.automl.v1.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.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.automl.v1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an InputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.InputConfig} InputConfig + */ + InputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.InputConfig) + return object; + var message = new $root.google.cloud.automl.v1.InputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.automl.v1.InputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.automl.v1.GcsSource.fromObject(object.gcsSource); + } + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.automl.v1.InputConfig.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {google.cloud.automl.v1.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.objects || options.defaults) + object.params = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.automl.v1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + return object; + }; + + /** + * Converts this InputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.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.automl.v1.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.automl.v1.InputConfig"; + }; + + return InputConfig; + })(); + + v1.BatchPredictInputConfig = (function() { + + /** + * Properties of a BatchPredictInputConfig. + * @memberof google.cloud.automl.v1 + * @interface IBatchPredictInputConfig + * @property {google.cloud.automl.v1.IGcsSource|null} [gcsSource] BatchPredictInputConfig gcsSource + */ + + /** + * Constructs a new BatchPredictInputConfig. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a BatchPredictInputConfig. + * @implements IBatchPredictInputConfig + * @constructor + * @param {google.cloud.automl.v1.IBatchPredictInputConfig=} [properties] Properties to set + */ + function BatchPredictInputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictInputConfig gcsSource. + * @member {google.cloud.automl.v1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @instance + */ + BatchPredictInputConfig.prototype.gcsSource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchPredictInputConfig source. + * @member {"gcsSource"|undefined} source + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @instance + */ + Object.defineProperty(BatchPredictInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchPredictInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {google.cloud.automl.v1.IBatchPredictInputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BatchPredictInputConfig} BatchPredictInputConfig instance + */ + BatchPredictInputConfig.create = function create(properties) { + return new BatchPredictInputConfig(properties); + }; + + /** + * Encodes the specified BatchPredictInputConfig message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {google.cloud.automl.v1.IBatchPredictInputConfig} message BatchPredictInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.automl.v1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictInputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {google.cloud.automl.v1.IBatchPredictInputConfig} message BatchPredictInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BatchPredictInputConfig} BatchPredictInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictInputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BatchPredictInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsSource = $root.google.cloud.automl.v1.GcsSource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BatchPredictInputConfig} BatchPredictInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictInputConfig message. + * @function verify + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.automl.v1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + return null; + }; + + /** + * Creates a BatchPredictInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BatchPredictInputConfig} BatchPredictInputConfig + */ + BatchPredictInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BatchPredictInputConfig) + return object; + var message = new $root.google.cloud.automl.v1.BatchPredictInputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.automl.v1.GcsSource.fromObject(object.gcsSource); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {google.cloud.automl.v1.BatchPredictInputConfig} message BatchPredictInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.automl.v1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + return object; + }; + + /** + * Converts this BatchPredictInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @instance + * @returns {Object.} JSON object + */ + BatchPredictInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictInputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.BatchPredictInputConfig"; + }; + + return BatchPredictInputConfig; + })(); + + v1.DocumentInputConfig = (function() { + + /** + * Properties of a DocumentInputConfig. + * @memberof google.cloud.automl.v1 + * @interface IDocumentInputConfig + * @property {google.cloud.automl.v1.IGcsSource|null} [gcsSource] DocumentInputConfig gcsSource + */ + + /** + * Constructs a new DocumentInputConfig. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a DocumentInputConfig. + * @implements IDocumentInputConfig + * @constructor + * @param {google.cloud.automl.v1.IDocumentInputConfig=} [properties] Properties to set + */ + function DocumentInputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentInputConfig gcsSource. + * @member {google.cloud.automl.v1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @instance + */ + DocumentInputConfig.prototype.gcsSource = null; + + /** + * Creates a new DocumentInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {google.cloud.automl.v1.IDocumentInputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DocumentInputConfig} DocumentInputConfig instance + */ + DocumentInputConfig.create = function create(properties) { + return new DocumentInputConfig(properties); + }; + + /** + * Encodes the specified DocumentInputConfig message. Does not implicitly {@link google.cloud.automl.v1.DocumentInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {google.cloud.automl.v1.IDocumentInputConfig} message DocumentInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.automl.v1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DocumentInputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DocumentInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {google.cloud.automl.v1.IDocumentInputConfig} message DocumentInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.DocumentInputConfig} DocumentInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentInputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DocumentInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsSource = $root.google.cloud.automl.v1.GcsSource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.DocumentInputConfig} DocumentInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentInputConfig message. + * @function verify + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + var error = $root.google.cloud.automl.v1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + return null; + }; + + /** + * Creates a DocumentInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.DocumentInputConfig} DocumentInputConfig + */ + DocumentInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DocumentInputConfig) + return object; + var message = new $root.google.cloud.automl.v1.DocumentInputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.automl.v1.DocumentInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.automl.v1.GcsSource.fromObject(object.gcsSource); + } + return message; + }; + + /** + * Creates a plain object from a DocumentInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {google.cloud.automl.v1.DocumentInputConfig} message DocumentInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.gcsSource = null; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + object.gcsSource = $root.google.cloud.automl.v1.GcsSource.toObject(message.gcsSource, options); + return object; + }; + + /** + * Converts this DocumentInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @instance + * @returns {Object.} JSON object + */ + DocumentInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentInputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.DocumentInputConfig"; + }; + + return DocumentInputConfig; + })(); + + v1.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.cloud.automl.v1 + * @interface IOutputConfig + * @property {google.cloud.automl.v1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.cloud.automl.v1.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.automl.v1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.automl.v1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.automl.v1.OutputConfig + * @instance + */ + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {google.cloud.automl.v1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.automl.v1.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {google.cloud.automl.v1.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.automl.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {google.cloud.automl.v1.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.automl.v1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.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.automl.v1.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.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.automl.v1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.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.automl.v1.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.automl.v1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.OutputConfig) + return object; + var message = new $root.google.cloud.automl.v1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.automl.v1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.fromObject(object.gcsDestination); + } + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {google.cloud.automl.v1.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.automl.v1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.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.automl.v1.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.automl.v1.OutputConfig"; + }; + + return OutputConfig; + })(); + + v1.BatchPredictOutputConfig = (function() { + + /** + * Properties of a BatchPredictOutputConfig. + * @memberof google.cloud.automl.v1 + * @interface IBatchPredictOutputConfig + * @property {google.cloud.automl.v1.IGcsDestination|null} [gcsDestination] BatchPredictOutputConfig gcsDestination + */ + + /** + * Constructs a new BatchPredictOutputConfig. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a BatchPredictOutputConfig. + * @implements IBatchPredictOutputConfig + * @constructor + * @param {google.cloud.automl.v1.IBatchPredictOutputConfig=} [properties] Properties to set + */ + function BatchPredictOutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictOutputConfig gcsDestination. + * @member {google.cloud.automl.v1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @instance + */ + BatchPredictOutputConfig.prototype.gcsDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchPredictOutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @instance + */ + Object.defineProperty(BatchPredictOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchPredictOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {google.cloud.automl.v1.IBatchPredictOutputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BatchPredictOutputConfig} BatchPredictOutputConfig instance + */ + BatchPredictOutputConfig.create = function create(properties) { + return new BatchPredictOutputConfig(properties); + }; + + /** + * Encodes the specified BatchPredictOutputConfig message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {google.cloud.automl.v1.IBatchPredictOutputConfig} message BatchPredictOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.automl.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {google.cloud.automl.v1.IBatchPredictOutputConfig} message BatchPredictOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BatchPredictOutputConfig} BatchPredictOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BatchPredictOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BatchPredictOutputConfig} BatchPredictOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictOutputConfig message. + * @function verify + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictOutputConfig.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.automl.v1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + return null; + }; + + /** + * Creates a BatchPredictOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BatchPredictOutputConfig} BatchPredictOutputConfig + */ + BatchPredictOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BatchPredictOutputConfig) + return object; + var message = new $root.google.cloud.automl.v1.BatchPredictOutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictOutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.fromObject(object.gcsDestination); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {google.cloud.automl.v1.BatchPredictOutputConfig} message BatchPredictOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + return object; + }; + + /** + * Converts this BatchPredictOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @instance + * @returns {Object.} JSON object + */ + BatchPredictOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictOutputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.BatchPredictOutputConfig"; + }; + + return BatchPredictOutputConfig; + })(); + + v1.ModelExportOutputConfig = (function() { + + /** + * Properties of a ModelExportOutputConfig. + * @memberof google.cloud.automl.v1 + * @interface IModelExportOutputConfig + * @property {google.cloud.automl.v1.IGcsDestination|null} [gcsDestination] ModelExportOutputConfig gcsDestination + * @property {string|null} [modelFormat] ModelExportOutputConfig modelFormat + * @property {Object.|null} [params] ModelExportOutputConfig params + */ + + /** + * Constructs a new ModelExportOutputConfig. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ModelExportOutputConfig. + * @implements IModelExportOutputConfig + * @constructor + * @param {google.cloud.automl.v1.IModelExportOutputConfig=} [properties] Properties to set + */ + function ModelExportOutputConfig(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelExportOutputConfig gcsDestination. + * @member {google.cloud.automl.v1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @instance + */ + ModelExportOutputConfig.prototype.gcsDestination = null; + + /** + * ModelExportOutputConfig modelFormat. + * @member {string} modelFormat + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @instance + */ + ModelExportOutputConfig.prototype.modelFormat = ""; + + /** + * ModelExportOutputConfig params. + * @member {Object.} params + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @instance + */ + ModelExportOutputConfig.prototype.params = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ModelExportOutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @instance + */ + Object.defineProperty(ModelExportOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ModelExportOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {google.cloud.automl.v1.IModelExportOutputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ModelExportOutputConfig} ModelExportOutputConfig instance + */ + ModelExportOutputConfig.create = function create(properties) { + return new ModelExportOutputConfig(properties); + }; + + /** + * Encodes the specified ModelExportOutputConfig message. Does not implicitly {@link google.cloud.automl.v1.ModelExportOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {google.cloud.automl.v1.IModelExportOutputConfig} message ModelExportOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelExportOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.automl.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.params[keys[i]]).ldelim(); + if (message.modelFormat != null && Object.hasOwnProperty.call(message, "modelFormat")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.modelFormat); + return writer; + }; + + /** + * Encodes the specified ModelExportOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ModelExportOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {google.cloud.automl.v1.IModelExportOutputConfig} message ModelExportOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelExportOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelExportOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ModelExportOutputConfig} ModelExportOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelExportOutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ModelExportOutputConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 4: { + message.modelFormat = reader.string(); + break; + } + case 2: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelExportOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ModelExportOutputConfig} ModelExportOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelExportOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelExportOutputConfig message. + * @function verify + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelExportOutputConfig.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.automl.v1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.modelFormat != null && message.hasOwnProperty("modelFormat")) + if (!$util.isString(message.modelFormat)) + return "modelFormat: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a ModelExportOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ModelExportOutputConfig} ModelExportOutputConfig + */ + ModelExportOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ModelExportOutputConfig) + return object; + var message = new $root.google.cloud.automl.v1.ModelExportOutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.automl.v1.ModelExportOutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.fromObject(object.gcsDestination); + } + if (object.modelFormat != null) + message.modelFormat = String(object.modelFormat); + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.automl.v1.ModelExportOutputConfig.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a ModelExportOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {google.cloud.automl.v1.ModelExportOutputConfig} message ModelExportOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelExportOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) + object.modelFormat = ""; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + if (message.modelFormat != null && message.hasOwnProperty("modelFormat")) + object.modelFormat = message.modelFormat; + return object; + }; + + /** + * Converts this ModelExportOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @instance + * @returns {Object.} JSON object + */ + ModelExportOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelExportOutputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelExportOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ModelExportOutputConfig"; + }; + + return ModelExportOutputConfig; + })(); + + v1.GcsSource = (function() { + + /** + * Properties of a GcsSource. + * @memberof google.cloud.automl.v1 + * @interface IGcsSource + * @property {Array.|null} [inputUris] GcsSource inputUris + */ + + /** + * Constructs a new GcsSource. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a GcsSource. + * @implements IGcsSource + * @constructor + * @param {google.cloud.automl.v1.IGcsSource=} [properties] Properties to set + */ + function GcsSource(properties) { + this.inputUris = []; + if (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 inputUris. + * @member {Array.} inputUris + * @memberof google.cloud.automl.v1.GcsSource + * @instance + */ + GcsSource.prototype.inputUris = $util.emptyArray; + + /** + * Creates a new GcsSource instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.GcsSource + * @static + * @param {google.cloud.automl.v1.IGcsSource=} [properties] Properties to set + * @returns {google.cloud.automl.v1.GcsSource} GcsSource instance + */ + GcsSource.create = function create(properties) { + return new GcsSource(properties); + }; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.automl.v1.GcsSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.GcsSource + * @static + * @param {google.cloud.automl.v1.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.inputUris != null && message.inputUris.length) + for (var i = 0; i < message.inputUris.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUris[i]); + return writer; + }; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.GcsSource + * @static + * @param {google.cloud.automl.v1.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.automl.v1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.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.automl.v1.GcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.inputUris && message.inputUris.length)) + message.inputUris = []; + message.inputUris.push(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.automl.v1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.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.automl.v1.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.inputUris != null && message.hasOwnProperty("inputUris")) { + if (!Array.isArray(message.inputUris)) + return "inputUris: array expected"; + for (var i = 0; i < message.inputUris.length; ++i) + if (!$util.isString(message.inputUris[i])) + return "inputUris: 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.automl.v1.GcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.GcsSource} GcsSource + */ + GcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.GcsSource) + return object; + var message = new $root.google.cloud.automl.v1.GcsSource(); + if (object.inputUris) { + if (!Array.isArray(object.inputUris)) + throw TypeError(".google.cloud.automl.v1.GcsSource.inputUris: array expected"); + message.inputUris = []; + for (var i = 0; i < object.inputUris.length; ++i) + message.inputUris[i] = String(object.inputUris[i]); + } + return message; + }; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.GcsSource + * @static + * @param {google.cloud.automl.v1.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.arrays || options.defaults) + object.inputUris = []; + if (message.inputUris && message.inputUris.length) { + object.inputUris = []; + for (var j = 0; j < message.inputUris.length; ++j) + object.inputUris[j] = message.inputUris[j]; + } + return object; + }; + + /** + * Converts this GcsSource to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.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.automl.v1.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.automl.v1.GcsSource"; + }; + + return GcsSource; + })(); + + v1.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.automl.v1 + * @interface IGcsDestination + * @property {string|null} [outputUriPrefix] GcsDestination outputUriPrefix + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.automl.v1.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 outputUriPrefix. + * @member {string} outputUriPrefix + * @memberof google.cloud.automl.v1.GcsDestination + * @instance + */ + GcsDestination.prototype.outputUriPrefix = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {google.cloud.automl.v1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.automl.v1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.automl.v1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {google.cloud.automl.v1.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.outputUriPrefix != null && Object.hasOwnProperty.call(message, "outputUriPrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUriPrefix); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {google.cloud.automl.v1.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.automl.v1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.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.automl.v1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.outputUriPrefix = 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.automl.v1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.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.automl.v1.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.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + if (!$util.isString(message.outputUriPrefix)) + return "outputUriPrefix: 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.automl.v1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.GcsDestination) + return object; + var message = new $root.google.cloud.automl.v1.GcsDestination(); + if (object.outputUriPrefix != null) + message.outputUriPrefix = String(object.outputUriPrefix); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {google.cloud.automl.v1.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.outputUriPrefix = ""; + if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + object.outputUriPrefix = message.outputUriPrefix; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.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.automl.v1.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.automl.v1.GcsDestination"; + }; + + return GcsDestination; + })(); + + v1.AnnotationSpec = (function() { + + /** + * Properties of an AnnotationSpec. + * @memberof google.cloud.automl.v1 + * @interface IAnnotationSpec + * @property {string|null} [name] AnnotationSpec name + * @property {string|null} [displayName] AnnotationSpec displayName + * @property {number|null} [exampleCount] AnnotationSpec exampleCount + */ + + /** + * Constructs a new AnnotationSpec. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an AnnotationSpec. + * @implements IAnnotationSpec + * @constructor + * @param {google.cloud.automl.v1.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 name. + * @member {string} name + * @memberof google.cloud.automl.v1.AnnotationSpec + * @instance + */ + AnnotationSpec.prototype.name = ""; + + /** + * AnnotationSpec displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1.AnnotationSpec + * @instance + */ + AnnotationSpec.prototype.displayName = ""; + + /** + * AnnotationSpec exampleCount. + * @member {number} exampleCount + * @memberof google.cloud.automl.v1.AnnotationSpec + * @instance + */ + AnnotationSpec.prototype.exampleCount = 0; + + /** + * Creates a new AnnotationSpec instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {google.cloud.automl.v1.IAnnotationSpec=} [properties] Properties to set + * @returns {google.cloud.automl.v1.AnnotationSpec} AnnotationSpec instance + */ + AnnotationSpec.create = function create(properties) { + return new AnnotationSpec(properties); + }; + + /** + * Encodes the specified AnnotationSpec message. Does not implicitly {@link google.cloud.automl.v1.AnnotationSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {google.cloud.automl.v1.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.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.exampleCount != null && Object.hasOwnProperty.call(message, "exampleCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.exampleCount); + return writer; + }; + + /** + * Encodes the specified AnnotationSpec message, length delimited. Does not implicitly {@link google.cloud.automl.v1.AnnotationSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {google.cloud.automl.v1.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.automl.v1.AnnotationSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.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.automl.v1.AnnotationSpec(); + 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.exampleCount = reader.int32(); + 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.automl.v1.AnnotationSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.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.automl.v1.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.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.exampleCount != null && message.hasOwnProperty("exampleCount")) + if (!$util.isInteger(message.exampleCount)) + return "exampleCount: integer expected"; + return null; + }; + + /** + * Creates an AnnotationSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.AnnotationSpec} AnnotationSpec + */ + AnnotationSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.AnnotationSpec) + return object; + var message = new $root.google.cloud.automl.v1.AnnotationSpec(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.exampleCount != null) + message.exampleCount = object.exampleCount | 0; + return message; + }; + + /** + * Creates a plain object from an AnnotationSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {google.cloud.automl.v1.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.name = ""; + object.displayName = ""; + object.exampleCount = 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.exampleCount != null && message.hasOwnProperty("exampleCount")) + object.exampleCount = message.exampleCount; + return object; + }; + + /** + * Converts this AnnotationSpec to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.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.automl.v1.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.automl.v1.AnnotationSpec"; + }; + + return AnnotationSpec; + })(); + + v1.Dataset = (function() { + + /** + * Properties of a Dataset. + * @memberof google.cloud.automl.v1 + * @interface IDataset + * @property {google.cloud.automl.v1.ITranslationDatasetMetadata|null} [translationDatasetMetadata] Dataset translationDatasetMetadata + * @property {google.cloud.automl.v1.IImageClassificationDatasetMetadata|null} [imageClassificationDatasetMetadata] Dataset imageClassificationDatasetMetadata + * @property {google.cloud.automl.v1.ITextClassificationDatasetMetadata|null} [textClassificationDatasetMetadata] Dataset textClassificationDatasetMetadata + * @property {google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata|null} [imageObjectDetectionDatasetMetadata] Dataset imageObjectDetectionDatasetMetadata + * @property {google.cloud.automl.v1.ITextExtractionDatasetMetadata|null} [textExtractionDatasetMetadata] Dataset textExtractionDatasetMetadata + * @property {google.cloud.automl.v1.ITextSentimentDatasetMetadata|null} [textSentimentDatasetMetadata] Dataset textSentimentDatasetMetadata + * @property {string|null} [name] Dataset name + * @property {string|null} [displayName] Dataset displayName + * @property {string|null} [description] Dataset description + * @property {number|null} [exampleCount] Dataset exampleCount + * @property {google.protobuf.ITimestamp|null} [createTime] Dataset createTime + * @property {string|null} [etag] Dataset etag + * @property {Object.|null} [labels] Dataset labels + */ + + /** + * Constructs a new Dataset. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a Dataset. + * @implements IDataset + * @constructor + * @param {google.cloud.automl.v1.IDataset=} [properties] Properties to set + */ + function Dataset(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Dataset translationDatasetMetadata. + * @member {google.cloud.automl.v1.ITranslationDatasetMetadata|null|undefined} translationDatasetMetadata + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.translationDatasetMetadata = null; + + /** + * Dataset imageClassificationDatasetMetadata. + * @member {google.cloud.automl.v1.IImageClassificationDatasetMetadata|null|undefined} imageClassificationDatasetMetadata + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.imageClassificationDatasetMetadata = null; + + /** + * Dataset textClassificationDatasetMetadata. + * @member {google.cloud.automl.v1.ITextClassificationDatasetMetadata|null|undefined} textClassificationDatasetMetadata + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.textClassificationDatasetMetadata = null; + + /** + * Dataset imageObjectDetectionDatasetMetadata. + * @member {google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata|null|undefined} imageObjectDetectionDatasetMetadata + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.imageObjectDetectionDatasetMetadata = null; + + /** + * Dataset textExtractionDatasetMetadata. + * @member {google.cloud.automl.v1.ITextExtractionDatasetMetadata|null|undefined} textExtractionDatasetMetadata + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.textExtractionDatasetMetadata = null; + + /** + * Dataset textSentimentDatasetMetadata. + * @member {google.cloud.automl.v1.ITextSentimentDatasetMetadata|null|undefined} textSentimentDatasetMetadata + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.textSentimentDatasetMetadata = null; + + /** + * Dataset name. + * @member {string} name + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.name = ""; + + /** + * Dataset displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.displayName = ""; + + /** + * Dataset description. + * @member {string} description + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.description = ""; + + /** + * Dataset exampleCount. + * @member {number} exampleCount + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.exampleCount = 0; + + /** + * Dataset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.createTime = null; + + /** + * Dataset etag. + * @member {string} etag + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.etag = ""; + + /** + * Dataset labels. + * @member {Object.} labels + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Dataset datasetMetadata. + * @member {"translationDatasetMetadata"|"imageClassificationDatasetMetadata"|"textClassificationDatasetMetadata"|"imageObjectDetectionDatasetMetadata"|"textExtractionDatasetMetadata"|"textSentimentDatasetMetadata"|undefined} datasetMetadata + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Object.defineProperty(Dataset.prototype, "datasetMetadata", { + get: $util.oneOfGetter($oneOfFields = ["translationDatasetMetadata", "imageClassificationDatasetMetadata", "textClassificationDatasetMetadata", "imageObjectDetectionDatasetMetadata", "textExtractionDatasetMetadata", "textSentimentDatasetMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Dataset instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.Dataset + * @static + * @param {google.cloud.automl.v1.IDataset=} [properties] Properties to set + * @returns {google.cloud.automl.v1.Dataset} Dataset instance + */ + Dataset.create = function create(properties) { + return new Dataset(properties); + }; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.automl.v1.Dataset.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.Dataset + * @static + * @param {google.cloud.automl.v1.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 14, wireType 2 =*/114).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.etag); + if (message.exampleCount != null && Object.hasOwnProperty.call(message, "exampleCount")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.exampleCount); + if (message.translationDatasetMetadata != null && Object.hasOwnProperty.call(message, "translationDatasetMetadata")) + $root.google.cloud.automl.v1.TranslationDatasetMetadata.encode(message.translationDatasetMetadata, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.imageClassificationDatasetMetadata != null && Object.hasOwnProperty.call(message, "imageClassificationDatasetMetadata")) + $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata.encode(message.imageClassificationDatasetMetadata, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.textClassificationDatasetMetadata != null && Object.hasOwnProperty.call(message, "textClassificationDatasetMetadata")) + $root.google.cloud.automl.v1.TextClassificationDatasetMetadata.encode(message.textClassificationDatasetMetadata, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.imageObjectDetectionDatasetMetadata != null && Object.hasOwnProperty.call(message, "imageObjectDetectionDatasetMetadata")) + $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.encode(message.imageObjectDetectionDatasetMetadata, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.textExtractionDatasetMetadata != null && Object.hasOwnProperty.call(message, "textExtractionDatasetMetadata")) + $root.google.cloud.automl.v1.TextExtractionDatasetMetadata.encode(message.textExtractionDatasetMetadata, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.textSentimentDatasetMetadata != null && Object.hasOwnProperty.call(message, "textSentimentDatasetMetadata")) + $root.google.cloud.automl.v1.TextSentimentDatasetMetadata.encode(message.textSentimentDatasetMetadata, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 39, wireType 2 =*/314).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Dataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.Dataset + * @static + * @param {google.cloud.automl.v1.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.automl.v1.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.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.automl.v1.Dataset(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 23: { + message.translationDatasetMetadata = $root.google.cloud.automl.v1.TranslationDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 24: { + message.imageClassificationDatasetMetadata = $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 25: { + message.textClassificationDatasetMetadata = $root.google.cloud.automl.v1.TextClassificationDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 26: { + message.imageObjectDetectionDatasetMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 28: { + message.textExtractionDatasetMetadata = $root.google.cloud.automl.v1.TextExtractionDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 30: { + message.textSentimentDatasetMetadata = $root.google.cloud.automl.v1.TextSentimentDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 21: { + message.exampleCount = reader.int32(); + break; + } + case 14: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 17: { + message.etag = reader.string(); + break; + } + case 39: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Dataset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.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.automl.v1.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"; + var properties = {}; + if (message.translationDatasetMetadata != null && message.hasOwnProperty("translationDatasetMetadata")) { + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TranslationDatasetMetadata.verify(message.translationDatasetMetadata); + if (error) + return "translationDatasetMetadata." + error; + } + } + if (message.imageClassificationDatasetMetadata != null && message.hasOwnProperty("imageClassificationDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata.verify(message.imageClassificationDatasetMetadata); + if (error) + return "imageClassificationDatasetMetadata." + error; + } + } + if (message.textClassificationDatasetMetadata != null && message.hasOwnProperty("textClassificationDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TextClassificationDatasetMetadata.verify(message.textClassificationDatasetMetadata); + if (error) + return "textClassificationDatasetMetadata." + error; + } + } + if (message.imageObjectDetectionDatasetMetadata != null && message.hasOwnProperty("imageObjectDetectionDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.verify(message.imageObjectDetectionDatasetMetadata); + if (error) + return "imageObjectDetectionDatasetMetadata." + error; + } + } + if (message.textExtractionDatasetMetadata != null && message.hasOwnProperty("textExtractionDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TextExtractionDatasetMetadata.verify(message.textExtractionDatasetMetadata); + if (error) + return "textExtractionDatasetMetadata." + error; + } + } + if (message.textSentimentDatasetMetadata != null && message.hasOwnProperty("textSentimentDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TextSentimentDatasetMetadata.verify(message.textSentimentDatasetMetadata); + if (error) + return "textSentimentDatasetMetadata." + error; + } + } + 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.exampleCount != null && message.hasOwnProperty("exampleCount")) + if (!$util.isInteger(message.exampleCount)) + return "exampleCount: integer expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.Dataset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.Dataset} Dataset + */ + Dataset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.Dataset) + return object; + var message = new $root.google.cloud.automl.v1.Dataset(); + if (object.translationDatasetMetadata != null) { + if (typeof object.translationDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.translationDatasetMetadata: object expected"); + message.translationDatasetMetadata = $root.google.cloud.automl.v1.TranslationDatasetMetadata.fromObject(object.translationDatasetMetadata); + } + if (object.imageClassificationDatasetMetadata != null) { + if (typeof object.imageClassificationDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.imageClassificationDatasetMetadata: object expected"); + message.imageClassificationDatasetMetadata = $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata.fromObject(object.imageClassificationDatasetMetadata); + } + if (object.textClassificationDatasetMetadata != null) { + if (typeof object.textClassificationDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.textClassificationDatasetMetadata: object expected"); + message.textClassificationDatasetMetadata = $root.google.cloud.automl.v1.TextClassificationDatasetMetadata.fromObject(object.textClassificationDatasetMetadata); + } + if (object.imageObjectDetectionDatasetMetadata != null) { + if (typeof object.imageObjectDetectionDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.imageObjectDetectionDatasetMetadata: object expected"); + message.imageObjectDetectionDatasetMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.fromObject(object.imageObjectDetectionDatasetMetadata); + } + if (object.textExtractionDatasetMetadata != null) { + if (typeof object.textExtractionDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.textExtractionDatasetMetadata: object expected"); + message.textExtractionDatasetMetadata = $root.google.cloud.automl.v1.TextExtractionDatasetMetadata.fromObject(object.textExtractionDatasetMetadata); + } + if (object.textSentimentDatasetMetadata != null) { + if (typeof object.textSentimentDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.textSentimentDatasetMetadata: object expected"); + message.textSentimentDatasetMetadata = $root.google.cloud.automl.v1.TextSentimentDatasetMetadata.fromObject(object.textSentimentDatasetMetadata); + } + 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.exampleCount != null) + message.exampleCount = object.exampleCount | 0; + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.Dataset + * @static + * @param {google.cloud.automl.v1.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.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.etag = ""; + object.exampleCount = 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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) + object.exampleCount = message.exampleCount; + if (message.translationDatasetMetadata != null && message.hasOwnProperty("translationDatasetMetadata")) { + object.translationDatasetMetadata = $root.google.cloud.automl.v1.TranslationDatasetMetadata.toObject(message.translationDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "translationDatasetMetadata"; + } + if (message.imageClassificationDatasetMetadata != null && message.hasOwnProperty("imageClassificationDatasetMetadata")) { + object.imageClassificationDatasetMetadata = $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata.toObject(message.imageClassificationDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "imageClassificationDatasetMetadata"; + } + if (message.textClassificationDatasetMetadata != null && message.hasOwnProperty("textClassificationDatasetMetadata")) { + object.textClassificationDatasetMetadata = $root.google.cloud.automl.v1.TextClassificationDatasetMetadata.toObject(message.textClassificationDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "textClassificationDatasetMetadata"; + } + if (message.imageObjectDetectionDatasetMetadata != null && message.hasOwnProperty("imageObjectDetectionDatasetMetadata")) { + object.imageObjectDetectionDatasetMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.toObject(message.imageObjectDetectionDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "imageObjectDetectionDatasetMetadata"; + } + if (message.textExtractionDatasetMetadata != null && message.hasOwnProperty("textExtractionDatasetMetadata")) { + object.textExtractionDatasetMetadata = $root.google.cloud.automl.v1.TextExtractionDatasetMetadata.toObject(message.textExtractionDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "textExtractionDatasetMetadata"; + } + if (message.textSentimentDatasetMetadata != null && message.hasOwnProperty("textSentimentDatasetMetadata")) { + object.textSentimentDatasetMetadata = $root.google.cloud.automl.v1.TextSentimentDatasetMetadata.toObject(message.textSentimentDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "textSentimentDatasetMetadata"; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this Dataset to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.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.automl.v1.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.automl.v1.Dataset"; + }; + + return Dataset; + })(); + + v1.ImageClassificationDatasetMetadata = (function() { + + /** + * Properties of an ImageClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @interface IImageClassificationDatasetMetadata + * @property {google.cloud.automl.v1.ClassificationType|null} [classificationType] ImageClassificationDatasetMetadata classificationType + */ + + /** + * Constructs a new ImageClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImageClassificationDatasetMetadata. + * @implements IImageClassificationDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1.IImageClassificationDatasetMetadata=} [properties] Properties to set + */ + function ImageClassificationDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageClassificationDatasetMetadata classificationType. + * @member {google.cloud.automl.v1.ClassificationType} classificationType + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @instance + */ + ImageClassificationDatasetMetadata.prototype.classificationType = 0; + + /** + * Creates a new ImageClassificationDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageClassificationDatasetMetadata} ImageClassificationDatasetMetadata instance + */ + ImageClassificationDatasetMetadata.create = function create(properties) { + return new ImageClassificationDatasetMetadata(properties); + }; + + /** + * Encodes the specified ImageClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationDatasetMetadata} message ImageClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.classificationType != null && Object.hasOwnProperty.call(message, "classificationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.classificationType); + return writer; + }; + + /** + * Encodes the specified ImageClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationDatasetMetadata} message ImageClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageClassificationDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImageClassificationDatasetMetadata} ImageClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.classificationType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImageClassificationDatasetMetadata} ImageClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageClassificationDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageClassificationDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + switch (message.classificationType) { + default: + return "classificationType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ImageClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImageClassificationDatasetMetadata} ImageClassificationDatasetMetadata + */ + ImageClassificationDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata(); + switch (object.classificationType) { + default: + if (typeof object.classificationType === "number") { + message.classificationType = object.classificationType; + break; + } + break; + case "CLASSIFICATION_TYPE_UNSPECIFIED": + case 0: + message.classificationType = 0; + break; + case "MULTICLASS": + case 1: + message.classificationType = 1; + break; + case "MULTILABEL": + case 2: + message.classificationType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ImageClassificationDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ImageClassificationDatasetMetadata} message ImageClassificationDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageClassificationDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.classificationType = options.enums === String ? "CLASSIFICATION_TYPE_UNSPECIFIED" : 0; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + object.classificationType = options.enums === String ? $root.google.cloud.automl.v1.ClassificationType[message.classificationType] === undefined ? message.classificationType : $root.google.cloud.automl.v1.ClassificationType[message.classificationType] : message.classificationType; + return object; + }; + + /** + * Converts this ImageClassificationDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageClassificationDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageClassificationDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageClassificationDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ImageClassificationDatasetMetadata"; + }; + + return ImageClassificationDatasetMetadata; + })(); + + v1.ImageObjectDetectionDatasetMetadata = (function() { + + /** + * Properties of an ImageObjectDetectionDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @interface IImageObjectDetectionDatasetMetadata + */ + + /** + * Constructs a new ImageObjectDetectionDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImageObjectDetectionDatasetMetadata. + * @implements IImageObjectDetectionDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata=} [properties] Properties to set + */ + function ImageObjectDetectionDatasetMetadata(properties) { + if (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 ImageObjectDetectionDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata} ImageObjectDetectionDatasetMetadata instance + */ + ImageObjectDetectionDatasetMetadata.create = function create(properties) { + return new ImageObjectDetectionDatasetMetadata(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata} message ImageObjectDetectionDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata} message ImageObjectDetectionDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata} ImageObjectDetectionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata} ImageObjectDetectionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata} ImageObjectDetectionDatasetMetadata + */ + ImageObjectDetectionDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata) + return object; + return new $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata(); + }; + + /** + * Creates a plain object from an ImageObjectDetectionDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata} message ImageObjectDetectionDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionDatasetMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ImageObjectDetectionDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata"; + }; + + return ImageObjectDetectionDatasetMetadata; + })(); + + v1.ImageClassificationModelMetadata = (function() { + + /** + * Properties of an ImageClassificationModelMetadata. + * @memberof google.cloud.automl.v1 + * @interface IImageClassificationModelMetadata + * @property {string|null} [baseModelId] ImageClassificationModelMetadata baseModelId + * @property {number|Long|null} [trainBudgetMilliNodeHours] ImageClassificationModelMetadata trainBudgetMilliNodeHours + * @property {number|Long|null} [trainCostMilliNodeHours] ImageClassificationModelMetadata trainCostMilliNodeHours + * @property {string|null} [stopReason] ImageClassificationModelMetadata stopReason + * @property {string|null} [modelType] ImageClassificationModelMetadata modelType + * @property {number|null} [nodeQps] ImageClassificationModelMetadata nodeQps + * @property {number|Long|null} [nodeCount] ImageClassificationModelMetadata nodeCount + */ + + /** + * Constructs a new ImageClassificationModelMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImageClassificationModelMetadata. + * @implements IImageClassificationModelMetadata + * @constructor + * @param {google.cloud.automl.v1.IImageClassificationModelMetadata=} [properties] Properties to set + */ + function ImageClassificationModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageClassificationModelMetadata baseModelId. + * @member {string} baseModelId + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.baseModelId = ""; + + /** + * ImageClassificationModelMetadata trainBudgetMilliNodeHours. + * @member {number|Long} trainBudgetMilliNodeHours + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.trainBudgetMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImageClassificationModelMetadata trainCostMilliNodeHours. + * @member {number|Long} trainCostMilliNodeHours + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.trainCostMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImageClassificationModelMetadata stopReason. + * @member {string} stopReason + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.stopReason = ""; + + /** + * ImageClassificationModelMetadata modelType. + * @member {string} modelType + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.modelType = ""; + + /** + * ImageClassificationModelMetadata nodeQps. + * @member {number} nodeQps + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.nodeQps = 0; + + /** + * ImageClassificationModelMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImageClassificationModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageClassificationModelMetadata} ImageClassificationModelMetadata instance + */ + ImageClassificationModelMetadata.create = function create(properties) { + return new ImageClassificationModelMetadata(properties); + }; + + /** + * Encodes the specified ImageClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationModelMetadata} message ImageClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseModelId != null && Object.hasOwnProperty.call(message, "baseModelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseModelId); + if (message.stopReason != null && Object.hasOwnProperty.call(message, "stopReason")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.stopReason); + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.modelType); + if (message.nodeQps != null && Object.hasOwnProperty.call(message, "nodeQps")) + writer.uint32(/* id 13, wireType 1 =*/105).double(message.nodeQps); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 14, wireType 0 =*/112).int64(message.nodeCount); + if (message.trainBudgetMilliNodeHours != null && Object.hasOwnProperty.call(message, "trainBudgetMilliNodeHours")) + writer.uint32(/* id 16, wireType 0 =*/128).int64(message.trainBudgetMilliNodeHours); + if (message.trainCostMilliNodeHours != null && Object.hasOwnProperty.call(message, "trainCostMilliNodeHours")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.trainCostMilliNodeHours); + return writer; + }; + + /** + * Encodes the specified ImageClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationModelMetadata} message ImageClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageClassificationModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImageClassificationModelMetadata} ImageClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageClassificationModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.baseModelId = reader.string(); + break; + } + case 16: { + message.trainBudgetMilliNodeHours = reader.int64(); + break; + } + case 17: { + message.trainCostMilliNodeHours = reader.int64(); + break; + } + case 5: { + message.stopReason = reader.string(); + break; + } + case 7: { + message.modelType = reader.string(); + break; + } + case 13: { + message.nodeQps = reader.double(); + break; + } + case 14: { + message.nodeCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImageClassificationModelMetadata} ImageClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageClassificationModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageClassificationModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseModelId != null && message.hasOwnProperty("baseModelId")) + if (!$util.isString(message.baseModelId)) + return "baseModelId: string expected"; + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + if (!$util.isInteger(message.trainBudgetMilliNodeHours) && !(message.trainBudgetMilliNodeHours && $util.isInteger(message.trainBudgetMilliNodeHours.low) && $util.isInteger(message.trainBudgetMilliNodeHours.high))) + return "trainBudgetMilliNodeHours: integer|Long expected"; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (!$util.isInteger(message.trainCostMilliNodeHours) && !(message.trainCostMilliNodeHours && $util.isInteger(message.trainCostMilliNodeHours.low) && $util.isInteger(message.trainCostMilliNodeHours.high))) + return "trainCostMilliNodeHours: integer|Long expected"; + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + if (!$util.isString(message.stopReason)) + return "stopReason: string expected"; + if (message.modelType != null && message.hasOwnProperty("modelType")) + if (!$util.isString(message.modelType)) + return "modelType: string expected"; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + if (typeof message.nodeQps !== "number") + return "nodeQps: number expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ImageClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImageClassificationModelMetadata} ImageClassificationModelMetadata + */ + ImageClassificationModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageClassificationModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1.ImageClassificationModelMetadata(); + if (object.baseModelId != null) + message.baseModelId = String(object.baseModelId); + if (object.trainBudgetMilliNodeHours != null) + if ($util.Long) + (message.trainBudgetMilliNodeHours = $util.Long.fromValue(object.trainBudgetMilliNodeHours)).unsigned = false; + else if (typeof object.trainBudgetMilliNodeHours === "string") + message.trainBudgetMilliNodeHours = parseInt(object.trainBudgetMilliNodeHours, 10); + else if (typeof object.trainBudgetMilliNodeHours === "number") + message.trainBudgetMilliNodeHours = object.trainBudgetMilliNodeHours; + else if (typeof object.trainBudgetMilliNodeHours === "object") + message.trainBudgetMilliNodeHours = new $util.LongBits(object.trainBudgetMilliNodeHours.low >>> 0, object.trainBudgetMilliNodeHours.high >>> 0).toNumber(); + if (object.trainCostMilliNodeHours != null) + if ($util.Long) + (message.trainCostMilliNodeHours = $util.Long.fromValue(object.trainCostMilliNodeHours)).unsigned = false; + else if (typeof object.trainCostMilliNodeHours === "string") + message.trainCostMilliNodeHours = parseInt(object.trainCostMilliNodeHours, 10); + else if (typeof object.trainCostMilliNodeHours === "number") + message.trainCostMilliNodeHours = object.trainCostMilliNodeHours; + else if (typeof object.trainCostMilliNodeHours === "object") + message.trainCostMilliNodeHours = new $util.LongBits(object.trainCostMilliNodeHours.low >>> 0, object.trainCostMilliNodeHours.high >>> 0).toNumber(); + if (object.stopReason != null) + message.stopReason = String(object.stopReason); + if (object.modelType != null) + message.modelType = String(object.modelType); + if (object.nodeQps != null) + message.nodeQps = Number(object.nodeQps); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImageClassificationModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1.ImageClassificationModelMetadata} message ImageClassificationModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageClassificationModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.baseModelId = ""; + object.stopReason = ""; + object.modelType = ""; + object.nodeQps = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainBudgetMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainBudgetMilliNodeHours = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainCostMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainCostMilliNodeHours = options.longs === String ? "0" : 0; + } + if (message.baseModelId != null && message.hasOwnProperty("baseModelId")) + object.baseModelId = message.baseModelId; + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + object.stopReason = message.stopReason; + if (message.modelType != null && message.hasOwnProperty("modelType")) + object.modelType = message.modelType; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + object.nodeQps = options.json && !isFinite(message.nodeQps) ? String(message.nodeQps) : message.nodeQps; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + if (typeof message.trainBudgetMilliNodeHours === "number") + object.trainBudgetMilliNodeHours = options.longs === String ? String(message.trainBudgetMilliNodeHours) : message.trainBudgetMilliNodeHours; + else + object.trainBudgetMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainBudgetMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainBudgetMilliNodeHours.low >>> 0, message.trainBudgetMilliNodeHours.high >>> 0).toNumber() : message.trainBudgetMilliNodeHours; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (typeof message.trainCostMilliNodeHours === "number") + object.trainCostMilliNodeHours = options.longs === String ? String(message.trainCostMilliNodeHours) : message.trainCostMilliNodeHours; + else + object.trainCostMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainCostMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainCostMilliNodeHours.low >>> 0, message.trainCostMilliNodeHours.high >>> 0).toNumber() : message.trainCostMilliNodeHours; + return object; + }; + + /** + * Converts this ImageClassificationModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageClassificationModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageClassificationModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageClassificationModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ImageClassificationModelMetadata"; + }; + + return ImageClassificationModelMetadata; + })(); + + v1.ImageObjectDetectionModelMetadata = (function() { + + /** + * Properties of an ImageObjectDetectionModelMetadata. + * @memberof google.cloud.automl.v1 + * @interface IImageObjectDetectionModelMetadata + * @property {string|null} [modelType] ImageObjectDetectionModelMetadata modelType + * @property {number|Long|null} [nodeCount] ImageObjectDetectionModelMetadata nodeCount + * @property {number|null} [nodeQps] ImageObjectDetectionModelMetadata nodeQps + * @property {string|null} [stopReason] ImageObjectDetectionModelMetadata stopReason + * @property {number|Long|null} [trainBudgetMilliNodeHours] ImageObjectDetectionModelMetadata trainBudgetMilliNodeHours + * @property {number|Long|null} [trainCostMilliNodeHours] ImageObjectDetectionModelMetadata trainCostMilliNodeHours + */ + + /** + * Constructs a new ImageObjectDetectionModelMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImageObjectDetectionModelMetadata. + * @implements IImageObjectDetectionModelMetadata + * @constructor + * @param {google.cloud.automl.v1.IImageObjectDetectionModelMetadata=} [properties] Properties to set + */ + function ImageObjectDetectionModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionModelMetadata modelType. + * @member {string} modelType + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.modelType = ""; + + /** + * ImageObjectDetectionModelMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImageObjectDetectionModelMetadata nodeQps. + * @member {number} nodeQps + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.nodeQps = 0; + + /** + * ImageObjectDetectionModelMetadata stopReason. + * @member {string} stopReason + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.stopReason = ""; + + /** + * ImageObjectDetectionModelMetadata trainBudgetMilliNodeHours. + * @member {number|Long} trainBudgetMilliNodeHours + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.trainBudgetMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImageObjectDetectionModelMetadata trainCostMilliNodeHours. + * @member {number|Long} trainCostMilliNodeHours + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.trainCostMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImageObjectDetectionModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelMetadata} ImageObjectDetectionModelMetadata instance + */ + ImageObjectDetectionModelMetadata.create = function create(properties) { + return new ImageObjectDetectionModelMetadata(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionModelMetadata} message ImageObjectDetectionModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.modelType); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.nodeCount); + if (message.nodeQps != null && Object.hasOwnProperty.call(message, "nodeQps")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.nodeQps); + if (message.stopReason != null && Object.hasOwnProperty.call(message, "stopReason")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.stopReason); + if (message.trainBudgetMilliNodeHours != null && Object.hasOwnProperty.call(message, "trainBudgetMilliNodeHours")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.trainBudgetMilliNodeHours); + if (message.trainCostMilliNodeHours != null && Object.hasOwnProperty.call(message, "trainCostMilliNodeHours")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.trainCostMilliNodeHours); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionModelMetadata} message ImageObjectDetectionModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelMetadata} ImageObjectDetectionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.modelType = reader.string(); + break; + } + case 3: { + message.nodeCount = reader.int64(); + break; + } + case 4: { + message.nodeQps = reader.double(); + break; + } + case 5: { + message.stopReason = reader.string(); + break; + } + case 6: { + message.trainBudgetMilliNodeHours = reader.int64(); + break; + } + case 7: { + message.trainCostMilliNodeHours = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelMetadata} ImageObjectDetectionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelType != null && message.hasOwnProperty("modelType")) + if (!$util.isString(message.modelType)) + return "modelType: string expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + if (typeof message.nodeQps !== "number") + return "nodeQps: number expected"; + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + if (!$util.isString(message.stopReason)) + return "stopReason: string expected"; + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + if (!$util.isInteger(message.trainBudgetMilliNodeHours) && !(message.trainBudgetMilliNodeHours && $util.isInteger(message.trainBudgetMilliNodeHours.low) && $util.isInteger(message.trainBudgetMilliNodeHours.high))) + return "trainBudgetMilliNodeHours: integer|Long expected"; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (!$util.isInteger(message.trainCostMilliNodeHours) && !(message.trainCostMilliNodeHours && $util.isInteger(message.trainCostMilliNodeHours.low) && $util.isInteger(message.trainCostMilliNodeHours.high))) + return "trainCostMilliNodeHours: integer|Long expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelMetadata} ImageObjectDetectionModelMetadata + */ + ImageObjectDetectionModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata(); + if (object.modelType != null) + message.modelType = String(object.modelType); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); + if (object.nodeQps != null) + message.nodeQps = Number(object.nodeQps); + if (object.stopReason != null) + message.stopReason = String(object.stopReason); + if (object.trainBudgetMilliNodeHours != null) + if ($util.Long) + (message.trainBudgetMilliNodeHours = $util.Long.fromValue(object.trainBudgetMilliNodeHours)).unsigned = false; + else if (typeof object.trainBudgetMilliNodeHours === "string") + message.trainBudgetMilliNodeHours = parseInt(object.trainBudgetMilliNodeHours, 10); + else if (typeof object.trainBudgetMilliNodeHours === "number") + message.trainBudgetMilliNodeHours = object.trainBudgetMilliNodeHours; + else if (typeof object.trainBudgetMilliNodeHours === "object") + message.trainBudgetMilliNodeHours = new $util.LongBits(object.trainBudgetMilliNodeHours.low >>> 0, object.trainBudgetMilliNodeHours.high >>> 0).toNumber(); + if (object.trainCostMilliNodeHours != null) + if ($util.Long) + (message.trainCostMilliNodeHours = $util.Long.fromValue(object.trainCostMilliNodeHours)).unsigned = false; + else if (typeof object.trainCostMilliNodeHours === "string") + message.trainCostMilliNodeHours = parseInt(object.trainCostMilliNodeHours, 10); + else if (typeof object.trainCostMilliNodeHours === "number") + message.trainCostMilliNodeHours = object.trainCostMilliNodeHours; + else if (typeof object.trainCostMilliNodeHours === "object") + message.trainCostMilliNodeHours = new $util.LongBits(object.trainCostMilliNodeHours.low >>> 0, object.trainCostMilliNodeHours.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @static + * @param {google.cloud.automl.v1.ImageObjectDetectionModelMetadata} message ImageObjectDetectionModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modelType = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + object.nodeQps = 0; + object.stopReason = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainBudgetMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainBudgetMilliNodeHours = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainCostMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainCostMilliNodeHours = options.longs === String ? "0" : 0; + } + if (message.modelType != null && message.hasOwnProperty("modelType")) + object.modelType = message.modelType; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + object.nodeQps = options.json && !isFinite(message.nodeQps) ? String(message.nodeQps) : message.nodeQps; + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + object.stopReason = message.stopReason; + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + if (typeof message.trainBudgetMilliNodeHours === "number") + object.trainBudgetMilliNodeHours = options.longs === String ? String(message.trainBudgetMilliNodeHours) : message.trainBudgetMilliNodeHours; + else + object.trainBudgetMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainBudgetMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainBudgetMilliNodeHours.low >>> 0, message.trainBudgetMilliNodeHours.high >>> 0).toNumber() : message.trainBudgetMilliNodeHours; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (typeof message.trainCostMilliNodeHours === "number") + object.trainCostMilliNodeHours = options.longs === String ? String(message.trainCostMilliNodeHours) : message.trainCostMilliNodeHours; + else + object.trainCostMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainCostMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainCostMilliNodeHours.low >>> 0, message.trainCostMilliNodeHours.high >>> 0).toNumber() : message.trainCostMilliNodeHours; + return object; + }; + + /** + * Converts this ImageObjectDetectionModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ImageObjectDetectionModelMetadata"; + }; + + return ImageObjectDetectionModelMetadata; + })(); + + v1.ImageClassificationModelDeploymentMetadata = (function() { + + /** + * Properties of an ImageClassificationModelDeploymentMetadata. + * @memberof google.cloud.automl.v1 + * @interface IImageClassificationModelDeploymentMetadata + * @property {number|Long|null} [nodeCount] ImageClassificationModelDeploymentMetadata nodeCount + */ + + /** + * Constructs a new ImageClassificationModelDeploymentMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImageClassificationModelDeploymentMetadata. + * @implements IImageClassificationModelDeploymentMetadata + * @constructor + * @param {google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata=} [properties] Properties to set + */ + function ImageClassificationModelDeploymentMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageClassificationModelDeploymentMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @instance + */ + ImageClassificationModelDeploymentMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImageClassificationModelDeploymentMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} ImageClassificationModelDeploymentMetadata instance + */ + ImageClassificationModelDeploymentMetadata.create = function create(properties) { + return new ImageClassificationModelDeploymentMetadata(properties); + }; + + /** + * Encodes the specified ImageClassificationModelDeploymentMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata} message ImageClassificationModelDeploymentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationModelDeploymentMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.nodeCount); + return writer; + }; + + /** + * Encodes the specified ImageClassificationModelDeploymentMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata} message ImageClassificationModelDeploymentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationModelDeploymentMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageClassificationModelDeploymentMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} ImageClassificationModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationModelDeploymentMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nodeCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageClassificationModelDeploymentMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} ImageClassificationModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationModelDeploymentMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageClassificationModelDeploymentMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageClassificationModelDeploymentMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ImageClassificationModelDeploymentMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} ImageClassificationModelDeploymentMetadata + */ + ImageClassificationModelDeploymentMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) + return object; + var message = new $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata(); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImageClassificationModelDeploymentMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} message ImageClassificationModelDeploymentMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageClassificationModelDeploymentMetadata.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.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + return object; + }; + + /** + * Converts this ImageClassificationModelDeploymentMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageClassificationModelDeploymentMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageClassificationModelDeploymentMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageClassificationModelDeploymentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata"; + }; + + return ImageClassificationModelDeploymentMetadata; + })(); + + v1.ImageObjectDetectionModelDeploymentMetadata = (function() { + + /** + * Properties of an ImageObjectDetectionModelDeploymentMetadata. + * @memberof google.cloud.automl.v1 + * @interface IImageObjectDetectionModelDeploymentMetadata + * @property {number|Long|null} [nodeCount] ImageObjectDetectionModelDeploymentMetadata nodeCount + */ + + /** + * Constructs a new ImageObjectDetectionModelDeploymentMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImageObjectDetectionModelDeploymentMetadata. + * @implements IImageObjectDetectionModelDeploymentMetadata + * @constructor + * @param {google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata=} [properties] Properties to set + */ + function ImageObjectDetectionModelDeploymentMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionModelDeploymentMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @instance + */ + ImageObjectDetectionModelDeploymentMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImageObjectDetectionModelDeploymentMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} ImageObjectDetectionModelDeploymentMetadata instance + */ + ImageObjectDetectionModelDeploymentMetadata.create = function create(properties) { + return new ImageObjectDetectionModelDeploymentMetadata(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionModelDeploymentMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata} message ImageObjectDetectionModelDeploymentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionModelDeploymentMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.nodeCount); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionModelDeploymentMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata} message ImageObjectDetectionModelDeploymentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionModelDeploymentMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionModelDeploymentMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} ImageObjectDetectionModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionModelDeploymentMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nodeCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionModelDeploymentMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} ImageObjectDetectionModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionModelDeploymentMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionModelDeploymentMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionModelDeploymentMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionModelDeploymentMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} ImageObjectDetectionModelDeploymentMetadata + */ + ImageObjectDetectionModelDeploymentMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) + return object; + var message = new $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata(); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionModelDeploymentMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} message ImageObjectDetectionModelDeploymentMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionModelDeploymentMetadata.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.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + return object; + }; + + /** + * Converts this ImageObjectDetectionModelDeploymentMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionModelDeploymentMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionModelDeploymentMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionModelDeploymentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata"; + }; + + return ImageObjectDetectionModelDeploymentMetadata; + })(); + + v1.TextClassificationDatasetMetadata = (function() { + + /** + * Properties of a TextClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITextClassificationDatasetMetadata + * @property {google.cloud.automl.v1.ClassificationType|null} [classificationType] TextClassificationDatasetMetadata classificationType + */ + + /** + * Constructs a new TextClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextClassificationDatasetMetadata. + * @implements ITextClassificationDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1.ITextClassificationDatasetMetadata=} [properties] Properties to set + */ + function TextClassificationDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextClassificationDatasetMetadata classificationType. + * @member {google.cloud.automl.v1.ClassificationType} classificationType + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @instance + */ + TextClassificationDatasetMetadata.prototype.classificationType = 0; + + /** + * Creates a new TextClassificationDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextClassificationDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextClassificationDatasetMetadata} TextClassificationDatasetMetadata instance + */ + TextClassificationDatasetMetadata.create = function create(properties) { + return new TextClassificationDatasetMetadata(properties); + }; + + /** + * Encodes the specified TextClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextClassificationDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextClassificationDatasetMetadata} message TextClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.classificationType != null && Object.hasOwnProperty.call(message, "classificationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.classificationType); + return writer; + }; + + /** + * Encodes the specified TextClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextClassificationDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextClassificationDatasetMetadata} message TextClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextClassificationDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextClassificationDatasetMetadata} TextClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextClassificationDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.classificationType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextClassificationDatasetMetadata} TextClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextClassificationDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextClassificationDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + switch (message.classificationType) { + default: + return "classificationType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TextClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextClassificationDatasetMetadata} TextClassificationDatasetMetadata + */ + TextClassificationDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextClassificationDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1.TextClassificationDatasetMetadata(); + switch (object.classificationType) { + default: + if (typeof object.classificationType === "number") { + message.classificationType = object.classificationType; + break; + } + break; + case "CLASSIFICATION_TYPE_UNSPECIFIED": + case 0: + message.classificationType = 0; + break; + case "MULTICLASS": + case 1: + message.classificationType = 1; + break; + case "MULTILABEL": + case 2: + message.classificationType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TextClassificationDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.TextClassificationDatasetMetadata} message TextClassificationDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextClassificationDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.classificationType = options.enums === String ? "CLASSIFICATION_TYPE_UNSPECIFIED" : 0; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + object.classificationType = options.enums === String ? $root.google.cloud.automl.v1.ClassificationType[message.classificationType] === undefined ? message.classificationType : $root.google.cloud.automl.v1.ClassificationType[message.classificationType] : message.classificationType; + return object; + }; + + /** + * Converts this TextClassificationDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TextClassificationDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextClassificationDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextClassificationDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextClassificationDatasetMetadata"; + }; + + return TextClassificationDatasetMetadata; + })(); + + v1.TextClassificationModelMetadata = (function() { + + /** + * Properties of a TextClassificationModelMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITextClassificationModelMetadata + * @property {google.cloud.automl.v1.ClassificationType|null} [classificationType] TextClassificationModelMetadata classificationType + */ + + /** + * Constructs a new TextClassificationModelMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextClassificationModelMetadata. + * @implements ITextClassificationModelMetadata + * @constructor + * @param {google.cloud.automl.v1.ITextClassificationModelMetadata=} [properties] Properties to set + */ + function TextClassificationModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextClassificationModelMetadata classificationType. + * @member {google.cloud.automl.v1.ClassificationType} classificationType + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @instance + */ + TextClassificationModelMetadata.prototype.classificationType = 0; + + /** + * Creates a new TextClassificationModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextClassificationModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextClassificationModelMetadata} TextClassificationModelMetadata instance + */ + TextClassificationModelMetadata.create = function create(properties) { + return new TextClassificationModelMetadata(properties); + }; + + /** + * Encodes the specified TextClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextClassificationModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextClassificationModelMetadata} message TextClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.classificationType != null && Object.hasOwnProperty.call(message, "classificationType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.classificationType); + return writer; + }; + + /** + * Encodes the specified TextClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextClassificationModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextClassificationModelMetadata} message TextClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextClassificationModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextClassificationModelMetadata} TextClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextClassificationModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.classificationType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextClassificationModelMetadata} TextClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextClassificationModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextClassificationModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + switch (message.classificationType) { + default: + return "classificationType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TextClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextClassificationModelMetadata} TextClassificationModelMetadata + */ + TextClassificationModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextClassificationModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1.TextClassificationModelMetadata(); + switch (object.classificationType) { + default: + if (typeof object.classificationType === "number") { + message.classificationType = object.classificationType; + break; + } + break; + case "CLASSIFICATION_TYPE_UNSPECIFIED": + case 0: + message.classificationType = 0; + break; + case "MULTICLASS": + case 1: + message.classificationType = 1; + break; + case "MULTILABEL": + case 2: + message.classificationType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TextClassificationModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1.TextClassificationModelMetadata} message TextClassificationModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextClassificationModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.classificationType = options.enums === String ? "CLASSIFICATION_TYPE_UNSPECIFIED" : 0; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + object.classificationType = options.enums === String ? $root.google.cloud.automl.v1.ClassificationType[message.classificationType] === undefined ? message.classificationType : $root.google.cloud.automl.v1.ClassificationType[message.classificationType] : message.classificationType; + return object; + }; + + /** + * Converts this TextClassificationModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TextClassificationModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextClassificationModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextClassificationModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextClassificationModelMetadata"; + }; + + return TextClassificationModelMetadata; + })(); + + v1.TextExtractionDatasetMetadata = (function() { + + /** + * Properties of a TextExtractionDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITextExtractionDatasetMetadata + */ + + /** + * Constructs a new TextExtractionDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextExtractionDatasetMetadata. + * @implements ITextExtractionDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1.ITextExtractionDatasetMetadata=} [properties] Properties to set + */ + function TextExtractionDatasetMetadata(properties) { + if (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 TextExtractionDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextExtractionDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextExtractionDatasetMetadata} TextExtractionDatasetMetadata instance + */ + TextExtractionDatasetMetadata.create = function create(properties) { + return new TextExtractionDatasetMetadata(properties); + }; + + /** + * Encodes the specified TextExtractionDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextExtractionDatasetMetadata} message TextExtractionDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified TextExtractionDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextExtractionDatasetMetadata} message TextExtractionDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextExtractionDatasetMetadata} TextExtractionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextExtractionDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextExtractionDatasetMetadata} TextExtractionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a TextExtractionDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextExtractionDatasetMetadata} TextExtractionDatasetMetadata + */ + TextExtractionDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextExtractionDatasetMetadata) + return object; + return new $root.google.cloud.automl.v1.TextExtractionDatasetMetadata(); + }; + + /** + * Creates a plain object from a TextExtractionDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {google.cloud.automl.v1.TextExtractionDatasetMetadata} message TextExtractionDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionDatasetMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this TextExtractionDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TextExtractionDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextExtractionDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextExtractionDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextExtractionDatasetMetadata"; + }; + + return TextExtractionDatasetMetadata; + })(); + + v1.TextExtractionModelMetadata = (function() { + + /** + * Properties of a TextExtractionModelMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITextExtractionModelMetadata + */ + + /** + * Constructs a new TextExtractionModelMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextExtractionModelMetadata. + * @implements ITextExtractionModelMetadata + * @constructor + * @param {google.cloud.automl.v1.ITextExtractionModelMetadata=} [properties] Properties to set + */ + function TextExtractionModelMetadata(properties) { + if (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 TextExtractionModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextExtractionModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextExtractionModelMetadata} TextExtractionModelMetadata instance + */ + TextExtractionModelMetadata.create = function create(properties) { + return new TextExtractionModelMetadata(properties); + }; + + /** + * Encodes the specified TextExtractionModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextExtractionModelMetadata} message TextExtractionModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified TextExtractionModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextExtractionModelMetadata} message TextExtractionModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextExtractionModelMetadata} TextExtractionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextExtractionModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextExtractionModelMetadata} TextExtractionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a TextExtractionModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextExtractionModelMetadata} TextExtractionModelMetadata + */ + TextExtractionModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextExtractionModelMetadata) + return object; + return new $root.google.cloud.automl.v1.TextExtractionModelMetadata(); + }; + + /** + * Creates a plain object from a TextExtractionModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {google.cloud.automl.v1.TextExtractionModelMetadata} message TextExtractionModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionModelMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this TextExtractionModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TextExtractionModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextExtractionModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextExtractionModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextExtractionModelMetadata"; + }; + + return TextExtractionModelMetadata; + })(); + + v1.TextSentimentDatasetMetadata = (function() { + + /** + * Properties of a TextSentimentDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITextSentimentDatasetMetadata + * @property {number|null} [sentimentMax] TextSentimentDatasetMetadata sentimentMax + */ + + /** + * Constructs a new TextSentimentDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextSentimentDatasetMetadata. + * @implements ITextSentimentDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1.ITextSentimentDatasetMetadata=} [properties] Properties to set + */ + function TextSentimentDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSentimentDatasetMetadata sentimentMax. + * @member {number} sentimentMax + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @instance + */ + TextSentimentDatasetMetadata.prototype.sentimentMax = 0; + + /** + * Creates a new TextSentimentDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextSentimentDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextSentimentDatasetMetadata} TextSentimentDatasetMetadata instance + */ + TextSentimentDatasetMetadata.create = function create(properties) { + return new TextSentimentDatasetMetadata(properties); + }; + + /** + * Encodes the specified TextSentimentDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextSentimentDatasetMetadata} message TextSentimentDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sentimentMax != null && Object.hasOwnProperty.call(message, "sentimentMax")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sentimentMax); + return writer; + }; + + /** + * Encodes the specified TextSentimentDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextSentimentDatasetMetadata} message TextSentimentDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextSentimentDatasetMetadata} TextSentimentDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextSentimentDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sentimentMax = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextSentimentDatasetMetadata} TextSentimentDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sentimentMax != null && message.hasOwnProperty("sentimentMax")) + if (!$util.isInteger(message.sentimentMax)) + return "sentimentMax: integer expected"; + return null; + }; + + /** + * Creates a TextSentimentDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextSentimentDatasetMetadata} TextSentimentDatasetMetadata + */ + TextSentimentDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextSentimentDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1.TextSentimentDatasetMetadata(); + if (object.sentimentMax != null) + message.sentimentMax = object.sentimentMax | 0; + return message; + }; + + /** + * Creates a plain object from a TextSentimentDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {google.cloud.automl.v1.TextSentimentDatasetMetadata} message TextSentimentDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sentimentMax = 0; + if (message.sentimentMax != null && message.hasOwnProperty("sentimentMax")) + object.sentimentMax = message.sentimentMax; + return object; + }; + + /** + * Converts this TextSentimentDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TextSentimentDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSentimentDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSentimentDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextSentimentDatasetMetadata"; + }; + + return TextSentimentDatasetMetadata; + })(); + + v1.TextSentimentModelMetadata = (function() { + + /** + * Properties of a TextSentimentModelMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITextSentimentModelMetadata + */ + + /** + * Constructs a new TextSentimentModelMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextSentimentModelMetadata. + * @implements ITextSentimentModelMetadata + * @constructor + * @param {google.cloud.automl.v1.ITextSentimentModelMetadata=} [properties] Properties to set + */ + function TextSentimentModelMetadata(properties) { + if (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 TextSentimentModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextSentimentModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextSentimentModelMetadata} TextSentimentModelMetadata instance + */ + TextSentimentModelMetadata.create = function create(properties) { + return new TextSentimentModelMetadata(properties); + }; + + /** + * Encodes the specified TextSentimentModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextSentimentModelMetadata} message TextSentimentModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified TextSentimentModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextSentimentModelMetadata} message TextSentimentModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextSentimentModelMetadata} TextSentimentModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextSentimentModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextSentimentModelMetadata} TextSentimentModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a TextSentimentModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextSentimentModelMetadata} TextSentimentModelMetadata + */ + TextSentimentModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextSentimentModelMetadata) + return object; + return new $root.google.cloud.automl.v1.TextSentimentModelMetadata(); + }; + + /** + * Creates a plain object from a TextSentimentModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {google.cloud.automl.v1.TextSentimentModelMetadata} message TextSentimentModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentModelMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this TextSentimentModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TextSentimentModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSentimentModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSentimentModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextSentimentModelMetadata"; + }; + + return TextSentimentModelMetadata; + })(); + + v1.Model = (function() { + + /** + * Properties of a Model. + * @memberof google.cloud.automl.v1 + * @interface IModel + * @property {google.cloud.automl.v1.ITranslationModelMetadata|null} [translationModelMetadata] Model translationModelMetadata + * @property {google.cloud.automl.v1.IImageClassificationModelMetadata|null} [imageClassificationModelMetadata] Model imageClassificationModelMetadata + * @property {google.cloud.automl.v1.ITextClassificationModelMetadata|null} [textClassificationModelMetadata] Model textClassificationModelMetadata + * @property {google.cloud.automl.v1.IImageObjectDetectionModelMetadata|null} [imageObjectDetectionModelMetadata] Model imageObjectDetectionModelMetadata + * @property {google.cloud.automl.v1.ITextExtractionModelMetadata|null} [textExtractionModelMetadata] Model textExtractionModelMetadata + * @property {google.cloud.automl.v1.ITextSentimentModelMetadata|null} [textSentimentModelMetadata] Model textSentimentModelMetadata + * @property {string|null} [name] Model name + * @property {string|null} [displayName] Model displayName + * @property {string|null} [datasetId] Model datasetId + * @property {google.protobuf.ITimestamp|null} [createTime] Model createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Model updateTime + * @property {google.cloud.automl.v1.Model.DeploymentState|null} [deploymentState] Model deploymentState + * @property {string|null} [etag] Model etag + * @property {Object.|null} [labels] Model labels + */ + + /** + * Constructs a new Model. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a Model. + * @implements IModel + * @constructor + * @param {google.cloud.automl.v1.IModel=} [properties] Properties to set + */ + function Model(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Model translationModelMetadata. + * @member {google.cloud.automl.v1.ITranslationModelMetadata|null|undefined} translationModelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.translationModelMetadata = null; + + /** + * Model imageClassificationModelMetadata. + * @member {google.cloud.automl.v1.IImageClassificationModelMetadata|null|undefined} imageClassificationModelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.imageClassificationModelMetadata = null; + + /** + * Model textClassificationModelMetadata. + * @member {google.cloud.automl.v1.ITextClassificationModelMetadata|null|undefined} textClassificationModelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.textClassificationModelMetadata = null; + + /** + * Model imageObjectDetectionModelMetadata. + * @member {google.cloud.automl.v1.IImageObjectDetectionModelMetadata|null|undefined} imageObjectDetectionModelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.imageObjectDetectionModelMetadata = null; + + /** + * Model textExtractionModelMetadata. + * @member {google.cloud.automl.v1.ITextExtractionModelMetadata|null|undefined} textExtractionModelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.textExtractionModelMetadata = null; + + /** + * Model textSentimentModelMetadata. + * @member {google.cloud.automl.v1.ITextSentimentModelMetadata|null|undefined} textSentimentModelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.textSentimentModelMetadata = null; + + /** + * Model name. + * @member {string} name + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.name = ""; + + /** + * Model displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.displayName = ""; + + /** + * Model datasetId. + * @member {string} datasetId + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.datasetId = ""; + + /** + * Model createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.createTime = null; + + /** + * Model updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.updateTime = null; + + /** + * Model deploymentState. + * @member {google.cloud.automl.v1.Model.DeploymentState} deploymentState + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.deploymentState = 0; + + /** + * Model etag. + * @member {string} etag + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.etag = ""; + + /** + * Model labels. + * @member {Object.} labels + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Model modelMetadata. + * @member {"translationModelMetadata"|"imageClassificationModelMetadata"|"textClassificationModelMetadata"|"imageObjectDetectionModelMetadata"|"textExtractionModelMetadata"|"textSentimentModelMetadata"|undefined} modelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Object.defineProperty(Model.prototype, "modelMetadata", { + get: $util.oneOfGetter($oneOfFields = ["translationModelMetadata", "imageClassificationModelMetadata", "textClassificationModelMetadata", "imageObjectDetectionModelMetadata", "textExtractionModelMetadata", "textSentimentModelMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Model instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.Model + * @static + * @param {google.cloud.automl.v1.IModel=} [properties] Properties to set + * @returns {google.cloud.automl.v1.Model} Model instance + */ + Model.create = function create(properties) { + return new Model(properties); + }; + + /** + * Encodes the specified Model message. Does not implicitly {@link google.cloud.automl.v1.Model.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.Model + * @static + * @param {google.cloud.automl.v1.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.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.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.datasetId); + 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.deploymentState != null && Object.hasOwnProperty.call(message, "deploymentState")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.deploymentState); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.etag); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.imageClassificationModelMetadata != null && Object.hasOwnProperty.call(message, "imageClassificationModelMetadata")) + $root.google.cloud.automl.v1.ImageClassificationModelMetadata.encode(message.imageClassificationModelMetadata, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.textClassificationModelMetadata != null && Object.hasOwnProperty.call(message, "textClassificationModelMetadata")) + $root.google.cloud.automl.v1.TextClassificationModelMetadata.encode(message.textClassificationModelMetadata, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.translationModelMetadata != null && Object.hasOwnProperty.call(message, "translationModelMetadata")) + $root.google.cloud.automl.v1.TranslationModelMetadata.encode(message.translationModelMetadata, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.textExtractionModelMetadata != null && Object.hasOwnProperty.call(message, "textExtractionModelMetadata")) + $root.google.cloud.automl.v1.TextExtractionModelMetadata.encode(message.textExtractionModelMetadata, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.imageObjectDetectionModelMetadata != null && Object.hasOwnProperty.call(message, "imageObjectDetectionModelMetadata")) + $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.encode(message.imageObjectDetectionModelMetadata, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.textSentimentModelMetadata != null && Object.hasOwnProperty.call(message, "textSentimentModelMetadata")) + $root.google.cloud.automl.v1.TextSentimentModelMetadata.encode(message.textSentimentModelMetadata, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 34, wireType 2 =*/274).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Model.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.Model + * @static + * @param {google.cloud.automl.v1.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Model message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.Model(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 15: { + message.translationModelMetadata = $root.google.cloud.automl.v1.TranslationModelMetadata.decode(reader, reader.uint32()); + break; + } + case 13: { + message.imageClassificationModelMetadata = $root.google.cloud.automl.v1.ImageClassificationModelMetadata.decode(reader, reader.uint32()); + break; + } + case 14: { + message.textClassificationModelMetadata = $root.google.cloud.automl.v1.TextClassificationModelMetadata.decode(reader, reader.uint32()); + break; + } + case 20: { + message.imageObjectDetectionModelMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.decode(reader, reader.uint32()); + break; + } + case 19: { + message.textExtractionModelMetadata = $root.google.cloud.automl.v1.TextExtractionModelMetadata.decode(reader, reader.uint32()); + break; + } + case 22: { + message.textSentimentModelMetadata = $root.google.cloud.automl.v1.TextSentimentModelMetadata.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.datasetId = reader.string(); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.deploymentState = reader.int32(); + break; + } + case 10: { + message.etag = reader.string(); + break; + } + case 34: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Model message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Model message. + * @function verify + * @memberof google.cloud.automl.v1.Model + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Model.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.translationModelMetadata != null && message.hasOwnProperty("translationModelMetadata")) { + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TranslationModelMetadata.verify(message.translationModelMetadata); + if (error) + return "translationModelMetadata." + error; + } + } + if (message.imageClassificationModelMetadata != null && message.hasOwnProperty("imageClassificationModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1.ImageClassificationModelMetadata.verify(message.imageClassificationModelMetadata); + if (error) + return "imageClassificationModelMetadata." + error; + } + } + if (message.textClassificationModelMetadata != null && message.hasOwnProperty("textClassificationModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TextClassificationModelMetadata.verify(message.textClassificationModelMetadata); + if (error) + return "textClassificationModelMetadata." + error; + } + } + if (message.imageObjectDetectionModelMetadata != null && message.hasOwnProperty("imageObjectDetectionModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.verify(message.imageObjectDetectionModelMetadata); + if (error) + return "imageObjectDetectionModelMetadata." + error; + } + } + if (message.textExtractionModelMetadata != null && message.hasOwnProperty("textExtractionModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TextExtractionModelMetadata.verify(message.textExtractionModelMetadata); + if (error) + return "textExtractionModelMetadata." + error; + } + } + if (message.textSentimentModelMetadata != null && message.hasOwnProperty("textSentimentModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TextSentimentModelMetadata.verify(message.textSentimentModelMetadata); + if (error) + return "textSentimentModelMetadata." + error; + } + } + 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.datasetId != null && message.hasOwnProperty("datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: 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.deploymentState != null && message.hasOwnProperty("deploymentState")) + switch (message.deploymentState) { + default: + return "deploymentState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Model message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.Model + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.Model} Model + */ + Model.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.Model) + return object; + var message = new $root.google.cloud.automl.v1.Model(); + if (object.translationModelMetadata != null) { + if (typeof object.translationModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Model.translationModelMetadata: object expected"); + message.translationModelMetadata = $root.google.cloud.automl.v1.TranslationModelMetadata.fromObject(object.translationModelMetadata); + } + if (object.imageClassificationModelMetadata != null) { + if (typeof object.imageClassificationModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Model.imageClassificationModelMetadata: object expected"); + message.imageClassificationModelMetadata = $root.google.cloud.automl.v1.ImageClassificationModelMetadata.fromObject(object.imageClassificationModelMetadata); + } + if (object.textClassificationModelMetadata != null) { + if (typeof object.textClassificationModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Model.textClassificationModelMetadata: object expected"); + message.textClassificationModelMetadata = $root.google.cloud.automl.v1.TextClassificationModelMetadata.fromObject(object.textClassificationModelMetadata); + } + if (object.imageObjectDetectionModelMetadata != null) { + if (typeof object.imageObjectDetectionModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Model.imageObjectDetectionModelMetadata: object expected"); + message.imageObjectDetectionModelMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.fromObject(object.imageObjectDetectionModelMetadata); + } + if (object.textExtractionModelMetadata != null) { + if (typeof object.textExtractionModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Model.textExtractionModelMetadata: object expected"); + message.textExtractionModelMetadata = $root.google.cloud.automl.v1.TextExtractionModelMetadata.fromObject(object.textExtractionModelMetadata); + } + if (object.textSentimentModelMetadata != null) { + if (typeof object.textSentimentModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Model.textSentimentModelMetadata: object expected"); + message.textSentimentModelMetadata = $root.google.cloud.automl.v1.TextSentimentModelMetadata.fromObject(object.textSentimentModelMetadata); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.automl.v1.Model.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.automl.v1.Model.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.deploymentState) { + default: + if (typeof object.deploymentState === "number") { + message.deploymentState = object.deploymentState; + break; + } + break; + case "DEPLOYMENT_STATE_UNSPECIFIED": + case 0: + message.deploymentState = 0; + break; + case "DEPLOYED": + case 1: + message.deploymentState = 1; + break; + case "UNDEPLOYED": + case 2: + message.deploymentState = 2; + break; + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.automl.v1.Model.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Model message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.Model + * @static + * @param {google.cloud.automl.v1.Model} message Model + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Model.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.datasetId = ""; + object.createTime = null; + object.deploymentState = options.enums === String ? "DEPLOYMENT_STATE_UNSPECIFIED" : 0; + object.etag = ""; + object.updateTime = 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.datasetId != null && message.hasOwnProperty("datasetId")) + object.datasetId = message.datasetId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.deploymentState != null && message.hasOwnProperty("deploymentState")) + object.deploymentState = options.enums === String ? $root.google.cloud.automl.v1.Model.DeploymentState[message.deploymentState] === undefined ? message.deploymentState : $root.google.cloud.automl.v1.Model.DeploymentState[message.deploymentState] : message.deploymentState; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.imageClassificationModelMetadata != null && message.hasOwnProperty("imageClassificationModelMetadata")) { + object.imageClassificationModelMetadata = $root.google.cloud.automl.v1.ImageClassificationModelMetadata.toObject(message.imageClassificationModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "imageClassificationModelMetadata"; + } + if (message.textClassificationModelMetadata != null && message.hasOwnProperty("textClassificationModelMetadata")) { + object.textClassificationModelMetadata = $root.google.cloud.automl.v1.TextClassificationModelMetadata.toObject(message.textClassificationModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "textClassificationModelMetadata"; + } + if (message.translationModelMetadata != null && message.hasOwnProperty("translationModelMetadata")) { + object.translationModelMetadata = $root.google.cloud.automl.v1.TranslationModelMetadata.toObject(message.translationModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "translationModelMetadata"; + } + if (message.textExtractionModelMetadata != null && message.hasOwnProperty("textExtractionModelMetadata")) { + object.textExtractionModelMetadata = $root.google.cloud.automl.v1.TextExtractionModelMetadata.toObject(message.textExtractionModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "textExtractionModelMetadata"; + } + if (message.imageObjectDetectionModelMetadata != null && message.hasOwnProperty("imageObjectDetectionModelMetadata")) { + object.imageObjectDetectionModelMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.toObject(message.imageObjectDetectionModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "imageObjectDetectionModelMetadata"; + } + if (message.textSentimentModelMetadata != null && message.hasOwnProperty("textSentimentModelMetadata")) { + object.textSentimentModelMetadata = $root.google.cloud.automl.v1.TextSentimentModelMetadata.toObject(message.textSentimentModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "textSentimentModelMetadata"; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this Model to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.Model + * @instance + * @returns {Object.} JSON object + */ + Model.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Model + * @function getTypeUrl + * @memberof google.cloud.automl.v1.Model + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.Model"; + }; + + /** + * DeploymentState enum. + * @name google.cloud.automl.v1.Model.DeploymentState + * @enum {number} + * @property {number} DEPLOYMENT_STATE_UNSPECIFIED=0 DEPLOYMENT_STATE_UNSPECIFIED value + * @property {number} DEPLOYED=1 DEPLOYED value + * @property {number} UNDEPLOYED=2 UNDEPLOYED value + */ + Model.DeploymentState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEPLOYMENT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEPLOYED"] = 1; + values[valuesById[2] = "UNDEPLOYED"] = 2; + return values; + })(); + + return Model; + })(); + + v1.ModelEvaluation = (function() { + + /** + * Properties of a ModelEvaluation. + * @memberof google.cloud.automl.v1 + * @interface IModelEvaluation + * @property {google.cloud.automl.v1.IClassificationEvaluationMetrics|null} [classificationEvaluationMetrics] ModelEvaluation classificationEvaluationMetrics + * @property {google.cloud.automl.v1.ITranslationEvaluationMetrics|null} [translationEvaluationMetrics] ModelEvaluation translationEvaluationMetrics + * @property {google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics|null} [imageObjectDetectionEvaluationMetrics] ModelEvaluation imageObjectDetectionEvaluationMetrics + * @property {google.cloud.automl.v1.ITextSentimentEvaluationMetrics|null} [textSentimentEvaluationMetrics] ModelEvaluation textSentimentEvaluationMetrics + * @property {google.cloud.automl.v1.ITextExtractionEvaluationMetrics|null} [textExtractionEvaluationMetrics] ModelEvaluation textExtractionEvaluationMetrics + * @property {string|null} [name] ModelEvaluation name + * @property {string|null} [annotationSpecId] ModelEvaluation annotationSpecId + * @property {string|null} [displayName] ModelEvaluation displayName + * @property {google.protobuf.ITimestamp|null} [createTime] ModelEvaluation createTime + * @property {number|null} [evaluatedExampleCount] ModelEvaluation evaluatedExampleCount + */ + + /** + * Constructs a new ModelEvaluation. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ModelEvaluation. + * @implements IModelEvaluation + * @constructor + * @param {google.cloud.automl.v1.IModelEvaluation=} [properties] Properties to set + */ + function ModelEvaluation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelEvaluation classificationEvaluationMetrics. + * @member {google.cloud.automl.v1.IClassificationEvaluationMetrics|null|undefined} classificationEvaluationMetrics + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.classificationEvaluationMetrics = null; + + /** + * ModelEvaluation translationEvaluationMetrics. + * @member {google.cloud.automl.v1.ITranslationEvaluationMetrics|null|undefined} translationEvaluationMetrics + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.translationEvaluationMetrics = null; + + /** + * ModelEvaluation imageObjectDetectionEvaluationMetrics. + * @member {google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics|null|undefined} imageObjectDetectionEvaluationMetrics + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.imageObjectDetectionEvaluationMetrics = null; + + /** + * ModelEvaluation textSentimentEvaluationMetrics. + * @member {google.cloud.automl.v1.ITextSentimentEvaluationMetrics|null|undefined} textSentimentEvaluationMetrics + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.textSentimentEvaluationMetrics = null; + + /** + * ModelEvaluation textExtractionEvaluationMetrics. + * @member {google.cloud.automl.v1.ITextExtractionEvaluationMetrics|null|undefined} textExtractionEvaluationMetrics + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.textExtractionEvaluationMetrics = null; + + /** + * ModelEvaluation name. + * @member {string} name + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.name = ""; + + /** + * ModelEvaluation annotationSpecId. + * @member {string} annotationSpecId + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.annotationSpecId = ""; + + /** + * ModelEvaluation displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.displayName = ""; + + /** + * ModelEvaluation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.createTime = null; + + /** + * ModelEvaluation evaluatedExampleCount. + * @member {number} evaluatedExampleCount + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.evaluatedExampleCount = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ModelEvaluation metrics. + * @member {"classificationEvaluationMetrics"|"translationEvaluationMetrics"|"imageObjectDetectionEvaluationMetrics"|"textSentimentEvaluationMetrics"|"textExtractionEvaluationMetrics"|undefined} metrics + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + Object.defineProperty(ModelEvaluation.prototype, "metrics", { + get: $util.oneOfGetter($oneOfFields = ["classificationEvaluationMetrics", "translationEvaluationMetrics", "imageObjectDetectionEvaluationMetrics", "textSentimentEvaluationMetrics", "textExtractionEvaluationMetrics"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ModelEvaluation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {google.cloud.automl.v1.IModelEvaluation=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ModelEvaluation} ModelEvaluation instance + */ + ModelEvaluation.create = function create(properties) { + return new ModelEvaluation(properties); + }; + + /** + * Encodes the specified ModelEvaluation message. Does not implicitly {@link google.cloud.automl.v1.ModelEvaluation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {google.cloud.automl.v1.IModelEvaluation} message ModelEvaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelEvaluation.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.annotationSpecId != null && Object.hasOwnProperty.call(message, "annotationSpecId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.annotationSpecId); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.evaluatedExampleCount != null && Object.hasOwnProperty.call(message, "evaluatedExampleCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.evaluatedExampleCount); + if (message.classificationEvaluationMetrics != null && Object.hasOwnProperty.call(message, "classificationEvaluationMetrics")) + $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.encode(message.classificationEvaluationMetrics, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.translationEvaluationMetrics != null && Object.hasOwnProperty.call(message, "translationEvaluationMetrics")) + $root.google.cloud.automl.v1.TranslationEvaluationMetrics.encode(message.translationEvaluationMetrics, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.textSentimentEvaluationMetrics != null && Object.hasOwnProperty.call(message, "textSentimentEvaluationMetrics")) + $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics.encode(message.textSentimentEvaluationMetrics, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.imageObjectDetectionEvaluationMetrics != null && Object.hasOwnProperty.call(message, "imageObjectDetectionEvaluationMetrics")) + $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.encode(message.imageObjectDetectionEvaluationMetrics, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.textExtractionEvaluationMetrics != null && Object.hasOwnProperty.call(message, "textExtractionEvaluationMetrics")) + $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.encode(message.textExtractionEvaluationMetrics, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified ModelEvaluation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ModelEvaluation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {google.cloud.automl.v1.IModelEvaluation} message ModelEvaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelEvaluation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ModelEvaluation} ModelEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelEvaluation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ModelEvaluation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + message.classificationEvaluationMetrics = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 9: { + message.translationEvaluationMetrics = $root.google.cloud.automl.v1.TranslationEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 12: { + message.imageObjectDetectionEvaluationMetrics = $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 11: { + message.textSentimentEvaluationMetrics = $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 13: { + message.textExtractionEvaluationMetrics = $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.annotationSpecId = reader.string(); + break; + } + case 15: { + message.displayName = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.evaluatedExampleCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ModelEvaluation} ModelEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelEvaluation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelEvaluation message. + * @function verify + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelEvaluation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.classificationEvaluationMetrics != null && message.hasOwnProperty("classificationEvaluationMetrics")) { + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.verify(message.classificationEvaluationMetrics); + if (error) + return "classificationEvaluationMetrics." + error; + } + } + if (message.translationEvaluationMetrics != null && message.hasOwnProperty("translationEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1.TranslationEvaluationMetrics.verify(message.translationEvaluationMetrics); + if (error) + return "translationEvaluationMetrics." + error; + } + } + if (message.imageObjectDetectionEvaluationMetrics != null && message.hasOwnProperty("imageObjectDetectionEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.verify(message.imageObjectDetectionEvaluationMetrics); + if (error) + return "imageObjectDetectionEvaluationMetrics." + error; + } + } + if (message.textSentimentEvaluationMetrics != null && message.hasOwnProperty("textSentimentEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics.verify(message.textSentimentEvaluationMetrics); + if (error) + return "textSentimentEvaluationMetrics." + error; + } + } + if (message.textExtractionEvaluationMetrics != null && message.hasOwnProperty("textExtractionEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.verify(message.textExtractionEvaluationMetrics); + if (error) + return "textExtractionEvaluationMetrics." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + if (!$util.isString(message.annotationSpecId)) + return "annotationSpecId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: 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.evaluatedExampleCount != null && message.hasOwnProperty("evaluatedExampleCount")) + if (!$util.isInteger(message.evaluatedExampleCount)) + return "evaluatedExampleCount: integer expected"; + return null; + }; + + /** + * Creates a ModelEvaluation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ModelEvaluation} ModelEvaluation + */ + ModelEvaluation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ModelEvaluation) + return object; + var message = new $root.google.cloud.automl.v1.ModelEvaluation(); + if (object.classificationEvaluationMetrics != null) { + if (typeof object.classificationEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1.ModelEvaluation.classificationEvaluationMetrics: object expected"); + message.classificationEvaluationMetrics = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.fromObject(object.classificationEvaluationMetrics); + } + if (object.translationEvaluationMetrics != null) { + if (typeof object.translationEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1.ModelEvaluation.translationEvaluationMetrics: object expected"); + message.translationEvaluationMetrics = $root.google.cloud.automl.v1.TranslationEvaluationMetrics.fromObject(object.translationEvaluationMetrics); + } + if (object.imageObjectDetectionEvaluationMetrics != null) { + if (typeof object.imageObjectDetectionEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1.ModelEvaluation.imageObjectDetectionEvaluationMetrics: object expected"); + message.imageObjectDetectionEvaluationMetrics = $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.fromObject(object.imageObjectDetectionEvaluationMetrics); + } + if (object.textSentimentEvaluationMetrics != null) { + if (typeof object.textSentimentEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1.ModelEvaluation.textSentimentEvaluationMetrics: object expected"); + message.textSentimentEvaluationMetrics = $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics.fromObject(object.textSentimentEvaluationMetrics); + } + if (object.textExtractionEvaluationMetrics != null) { + if (typeof object.textExtractionEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1.ModelEvaluation.textExtractionEvaluationMetrics: object expected"); + message.textExtractionEvaluationMetrics = $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.fromObject(object.textExtractionEvaluationMetrics); + } + if (object.name != null) + message.name = String(object.name); + if (object.annotationSpecId != null) + message.annotationSpecId = String(object.annotationSpecId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.automl.v1.ModelEvaluation.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.evaluatedExampleCount != null) + message.evaluatedExampleCount = object.evaluatedExampleCount | 0; + return message; + }; + + /** + * Creates a plain object from a ModelEvaluation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {google.cloud.automl.v1.ModelEvaluation} message ModelEvaluation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelEvaluation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.annotationSpecId = ""; + object.createTime = null; + object.evaluatedExampleCount = 0; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + object.annotationSpecId = message.annotationSpecId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.evaluatedExampleCount != null && message.hasOwnProperty("evaluatedExampleCount")) + object.evaluatedExampleCount = message.evaluatedExampleCount; + if (message.classificationEvaluationMetrics != null && message.hasOwnProperty("classificationEvaluationMetrics")) { + object.classificationEvaluationMetrics = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.toObject(message.classificationEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "classificationEvaluationMetrics"; + } + if (message.translationEvaluationMetrics != null && message.hasOwnProperty("translationEvaluationMetrics")) { + object.translationEvaluationMetrics = $root.google.cloud.automl.v1.TranslationEvaluationMetrics.toObject(message.translationEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "translationEvaluationMetrics"; + } + if (message.textSentimentEvaluationMetrics != null && message.hasOwnProperty("textSentimentEvaluationMetrics")) { + object.textSentimentEvaluationMetrics = $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics.toObject(message.textSentimentEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "textSentimentEvaluationMetrics"; + } + if (message.imageObjectDetectionEvaluationMetrics != null && message.hasOwnProperty("imageObjectDetectionEvaluationMetrics")) { + object.imageObjectDetectionEvaluationMetrics = $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.toObject(message.imageObjectDetectionEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "imageObjectDetectionEvaluationMetrics"; + } + if (message.textExtractionEvaluationMetrics != null && message.hasOwnProperty("textExtractionEvaluationMetrics")) { + object.textExtractionEvaluationMetrics = $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.toObject(message.textExtractionEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "textExtractionEvaluationMetrics"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this ModelEvaluation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + * @returns {Object.} JSON object + */ + ModelEvaluation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelEvaluation + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelEvaluation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ModelEvaluation"; + }; + + return ModelEvaluation; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.automl.v1 + * @interface IOperationMetadata + * @property {google.cloud.automl.v1.IDeleteOperationMetadata|null} [deleteDetails] OperationMetadata deleteDetails + * @property {google.cloud.automl.v1.IDeployModelOperationMetadata|null} [deployModelDetails] OperationMetadata deployModelDetails + * @property {google.cloud.automl.v1.IUndeployModelOperationMetadata|null} [undeployModelDetails] OperationMetadata undeployModelDetails + * @property {google.cloud.automl.v1.ICreateModelOperationMetadata|null} [createModelDetails] OperationMetadata createModelDetails + * @property {google.cloud.automl.v1.ICreateDatasetOperationMetadata|null} [createDatasetDetails] OperationMetadata createDatasetDetails + * @property {google.cloud.automl.v1.IImportDataOperationMetadata|null} [importDataDetails] OperationMetadata importDataDetails + * @property {google.cloud.automl.v1.IBatchPredictOperationMetadata|null} [batchPredictDetails] OperationMetadata batchPredictDetails + * @property {google.cloud.automl.v1.IExportDataOperationMetadata|null} [exportDataDetails] OperationMetadata exportDataDetails + * @property {google.cloud.automl.v1.IExportModelOperationMetadata|null} [exportModelDetails] OperationMetadata exportModelDetails + * @property {number|null} [progressPercent] OperationMetadata progressPercent + * @property {Array.|null} [partialFailures] OperationMetadata partialFailures + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] OperationMetadata updateTime + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(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]]; + } + + /** + * OperationMetadata deleteDetails. + * @member {google.cloud.automl.v1.IDeleteOperationMetadata|null|undefined} deleteDetails + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.deleteDetails = null; + + /** + * OperationMetadata deployModelDetails. + * @member {google.cloud.automl.v1.IDeployModelOperationMetadata|null|undefined} deployModelDetails + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.deployModelDetails = null; + + /** + * OperationMetadata undeployModelDetails. + * @member {google.cloud.automl.v1.IUndeployModelOperationMetadata|null|undefined} undeployModelDetails + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.undeployModelDetails = null; + + /** + * OperationMetadata createModelDetails. + * @member {google.cloud.automl.v1.ICreateModelOperationMetadata|null|undefined} createModelDetails + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createModelDetails = null; + + /** + * OperationMetadata createDatasetDetails. + * @member {google.cloud.automl.v1.ICreateDatasetOperationMetadata|null|undefined} createDatasetDetails + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createDatasetDetails = null; + + /** + * OperationMetadata importDataDetails. + * @member {google.cloud.automl.v1.IImportDataOperationMetadata|null|undefined} importDataDetails + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.importDataDetails = null; + + /** + * OperationMetadata batchPredictDetails. + * @member {google.cloud.automl.v1.IBatchPredictOperationMetadata|null|undefined} batchPredictDetails + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.batchPredictDetails = null; + + /** + * OperationMetadata exportDataDetails. + * @member {google.cloud.automl.v1.IExportDataOperationMetadata|null|undefined} exportDataDetails + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.exportDataDetails = null; + + /** + * OperationMetadata exportModelDetails. + * @member {google.cloud.automl.v1.IExportModelOperationMetadata|null|undefined} exportModelDetails + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.exportModelDetails = null; + + /** + * OperationMetadata progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.progressPercent = 0; + + /** + * OperationMetadata partialFailures. + * @member {Array.} partialFailures + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.partialFailures = $util.emptyArray; + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.updateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OperationMetadata details. + * @member {"deleteDetails"|"deployModelDetails"|"undeployModelDetails"|"createModelDetails"|"createDatasetDetails"|"importDataDetails"|"batchPredictDetails"|"exportDataDetails"|"exportModelDetails"|undefined} details + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + Object.defineProperty(OperationMetadata.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["deleteDetails", "deployModelDetails", "undeployModelDetails", "createModelDetails", "createDatasetDetails", "importDataDetails", "batchPredictDetails", "exportDataDetails", "exportModelDetails"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {google.cloud.automl.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {google.cloud.automl.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.deleteDetails != null && Object.hasOwnProperty.call(message, "deleteDetails")) + $root.google.cloud.automl.v1.DeleteOperationMetadata.encode(message.deleteDetails, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.createModelDetails != null && Object.hasOwnProperty.call(message, "createModelDetails")) + $root.google.cloud.automl.v1.CreateModelOperationMetadata.encode(message.createModelDetails, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.progressPercent); + if (message.importDataDetails != null && Object.hasOwnProperty.call(message, "importDataDetails")) + $root.google.cloud.automl.v1.ImportDataOperationMetadata.encode(message.importDataDetails, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.batchPredictDetails != null && Object.hasOwnProperty.call(message, "batchPredictDetails")) + $root.google.cloud.automl.v1.BatchPredictOperationMetadata.encode(message.batchPredictDetails, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.exportDataDetails != null && Object.hasOwnProperty.call(message, "exportDataDetails")) + $root.google.cloud.automl.v1.ExportDataOperationMetadata.encode(message.exportDataDetails, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.exportModelDetails != null && Object.hasOwnProperty.call(message, "exportModelDetails")) + $root.google.cloud.automl.v1.ExportModelOperationMetadata.encode(message.exportModelDetails, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.deployModelDetails != null && Object.hasOwnProperty.call(message, "deployModelDetails")) + $root.google.cloud.automl.v1.DeployModelOperationMetadata.encode(message.deployModelDetails, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.undeployModelDetails != null && Object.hasOwnProperty.call(message, "undeployModelDetails")) + $root.google.cloud.automl.v1.UndeployModelOperationMetadata.encode(message.undeployModelDetails, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.createDatasetDetails != null && Object.hasOwnProperty.call(message, "createDatasetDetails")) + $root.google.cloud.automl.v1.CreateDatasetOperationMetadata.encode(message.createDatasetDetails, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {google.cloud.automl.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + message.deleteDetails = $root.google.cloud.automl.v1.DeleteOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 24: { + message.deployModelDetails = $root.google.cloud.automl.v1.DeployModelOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 25: { + message.undeployModelDetails = $root.google.cloud.automl.v1.UndeployModelOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 10: { + message.createModelDetails = $root.google.cloud.automl.v1.CreateModelOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 30: { + message.createDatasetDetails = $root.google.cloud.automl.v1.CreateDatasetOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 15: { + message.importDataDetails = $root.google.cloud.automl.v1.ImportDataOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 16: { + message.batchPredictDetails = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 21: { + message.exportDataDetails = $root.google.cloud.automl.v1.ExportDataOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 22: { + message.exportModelDetails = $root.google.cloud.automl.v1.ExportModelOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 13: { + 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 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.deleteDetails != null && message.hasOwnProperty("deleteDetails")) { + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.DeleteOperationMetadata.verify(message.deleteDetails); + if (error) + return "deleteDetails." + error; + } + } + if (message.deployModelDetails != null && message.hasOwnProperty("deployModelDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.DeployModelOperationMetadata.verify(message.deployModelDetails); + if (error) + return "deployModelDetails." + error; + } + } + if (message.undeployModelDetails != null && message.hasOwnProperty("undeployModelDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.UndeployModelOperationMetadata.verify(message.undeployModelDetails); + if (error) + return "undeployModelDetails." + error; + } + } + if (message.createModelDetails != null && message.hasOwnProperty("createModelDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.CreateModelOperationMetadata.verify(message.createModelDetails); + if (error) + return "createModelDetails." + error; + } + } + if (message.createDatasetDetails != null && message.hasOwnProperty("createDatasetDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.CreateDatasetOperationMetadata.verify(message.createDatasetDetails); + if (error) + return "createDatasetDetails." + error; + } + } + if (message.importDataDetails != null && message.hasOwnProperty("importDataDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.ImportDataOperationMetadata.verify(message.importDataDetails); + if (error) + return "importDataDetails." + error; + } + } + if (message.batchPredictDetails != null && message.hasOwnProperty("batchPredictDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.verify(message.batchPredictDetails); + if (error) + return "batchPredictDetails." + error; + } + } + if (message.exportDataDetails != null && message.hasOwnProperty("exportDataDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.ExportDataOperationMetadata.verify(message.exportDataDetails); + if (error) + return "exportDataDetails." + error; + } + } + if (message.exportModelDetails != null && message.hasOwnProperty("exportModelDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.ExportModelOperationMetadata.verify(message.exportModelDetails); + if (error) + return "exportModelDetails." + 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; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.automl.v1.OperationMetadata(); + if (object.deleteDetails != null) { + if (typeof object.deleteDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.deleteDetails: object expected"); + message.deleteDetails = $root.google.cloud.automl.v1.DeleteOperationMetadata.fromObject(object.deleteDetails); + } + if (object.deployModelDetails != null) { + if (typeof object.deployModelDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.deployModelDetails: object expected"); + message.deployModelDetails = $root.google.cloud.automl.v1.DeployModelOperationMetadata.fromObject(object.deployModelDetails); + } + if (object.undeployModelDetails != null) { + if (typeof object.undeployModelDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.undeployModelDetails: object expected"); + message.undeployModelDetails = $root.google.cloud.automl.v1.UndeployModelOperationMetadata.fromObject(object.undeployModelDetails); + } + if (object.createModelDetails != null) { + if (typeof object.createModelDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.createModelDetails: object expected"); + message.createModelDetails = $root.google.cloud.automl.v1.CreateModelOperationMetadata.fromObject(object.createModelDetails); + } + if (object.createDatasetDetails != null) { + if (typeof object.createDatasetDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.createDatasetDetails: object expected"); + message.createDatasetDetails = $root.google.cloud.automl.v1.CreateDatasetOperationMetadata.fromObject(object.createDatasetDetails); + } + if (object.importDataDetails != null) { + if (typeof object.importDataDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.importDataDetails: object expected"); + message.importDataDetails = $root.google.cloud.automl.v1.ImportDataOperationMetadata.fromObject(object.importDataDetails); + } + if (object.batchPredictDetails != null) { + if (typeof object.batchPredictDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.batchPredictDetails: object expected"); + message.batchPredictDetails = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.fromObject(object.batchPredictDetails); + } + if (object.exportDataDetails != null) { + if (typeof object.exportDataDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.exportDataDetails: object expected"); + message.exportDataDetails = $root.google.cloud.automl.v1.ExportDataOperationMetadata.fromObject(object.exportDataDetails); + } + if (object.exportModelDetails != null) { + if (typeof object.exportModelDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.exportModelDetails: object expected"); + message.exportModelDetails = $root.google.cloud.automl.v1.ExportModelOperationMetadata.fromObject(object.exportModelDetails); + } + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.partialFailures) { + if (!Array.isArray(object.partialFailures)) + throw TypeError(".google.cloud.automl.v1.OperationMetadata.partialFailures: array expected"); + message.partialFailures = []; + for (var i = 0; i < object.partialFailures.length; ++i) { + if (typeof object.partialFailures[i] !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.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.automl.v1.OperationMetadata.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.automl.v1.OperationMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {google.cloud.automl.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.partialFailures = []; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + object.progressPercent = 0; + } + 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); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteDetails != null && message.hasOwnProperty("deleteDetails")) { + object.deleteDetails = $root.google.cloud.automl.v1.DeleteOperationMetadata.toObject(message.deleteDetails, options); + if (options.oneofs) + object.details = "deleteDetails"; + } + if (message.createModelDetails != null && message.hasOwnProperty("createModelDetails")) { + object.createModelDetails = $root.google.cloud.automl.v1.CreateModelOperationMetadata.toObject(message.createModelDetails, options); + if (options.oneofs) + object.details = "createModelDetails"; + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.importDataDetails != null && message.hasOwnProperty("importDataDetails")) { + object.importDataDetails = $root.google.cloud.automl.v1.ImportDataOperationMetadata.toObject(message.importDataDetails, options); + if (options.oneofs) + object.details = "importDataDetails"; + } + if (message.batchPredictDetails != null && message.hasOwnProperty("batchPredictDetails")) { + object.batchPredictDetails = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.toObject(message.batchPredictDetails, options); + if (options.oneofs) + object.details = "batchPredictDetails"; + } + if (message.exportDataDetails != null && message.hasOwnProperty("exportDataDetails")) { + object.exportDataDetails = $root.google.cloud.automl.v1.ExportDataOperationMetadata.toObject(message.exportDataDetails, options); + if (options.oneofs) + object.details = "exportDataDetails"; + } + if (message.exportModelDetails != null && message.hasOwnProperty("exportModelDetails")) { + object.exportModelDetails = $root.google.cloud.automl.v1.ExportModelOperationMetadata.toObject(message.exportModelDetails, options); + if (options.oneofs) + object.details = "exportModelDetails"; + } + if (message.deployModelDetails != null && message.hasOwnProperty("deployModelDetails")) { + object.deployModelDetails = $root.google.cloud.automl.v1.DeployModelOperationMetadata.toObject(message.deployModelDetails, options); + if (options.oneofs) + object.details = "deployModelDetails"; + } + if (message.undeployModelDetails != null && message.hasOwnProperty("undeployModelDetails")) { + object.undeployModelDetails = $root.google.cloud.automl.v1.UndeployModelOperationMetadata.toObject(message.undeployModelDetails, options); + if (options.oneofs) + object.details = "undeployModelDetails"; + } + if (message.createDatasetDetails != null && message.hasOwnProperty("createDatasetDetails")) { + object.createDatasetDetails = $root.google.cloud.automl.v1.CreateDatasetOperationMetadata.toObject(message.createDatasetDetails, options); + if (options.oneofs) + object.details = "createDatasetDetails"; + } + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.DeleteOperationMetadata = (function() { + + /** + * Properties of a DeleteOperationMetadata. + * @memberof google.cloud.automl.v1 + * @interface IDeleteOperationMetadata + */ + + /** + * Constructs a new DeleteOperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a DeleteOperationMetadata. + * @implements IDeleteOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.IDeleteOperationMetadata=} [properties] Properties to set + */ + function DeleteOperationMetadata(properties) { + if (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 DeleteOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @static + * @param {google.cloud.automl.v1.IDeleteOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DeleteOperationMetadata} DeleteOperationMetadata instance + */ + DeleteOperationMetadata.create = function create(properties) { + return new DeleteOperationMetadata(properties); + }; + + /** + * Encodes the specified DeleteOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.DeleteOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @static + * @param {google.cloud.automl.v1.IDeleteOperationMetadata} message DeleteOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @static + * @param {google.cloud.automl.v1.IDeleteOperationMetadata} message DeleteOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.DeleteOperationMetadata} DeleteOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DeleteOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.DeleteOperationMetadata} DeleteOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.DeleteOperationMetadata} DeleteOperationMetadata + */ + DeleteOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DeleteOperationMetadata) + return object; + return new $root.google.cloud.automl.v1.DeleteOperationMetadata(); + }; + + /** + * Creates a plain object from a DeleteOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @static + * @param {google.cloud.automl.v1.DeleteOperationMetadata} message DeleteOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.DeleteOperationMetadata"; + }; + + return DeleteOperationMetadata; + })(); + + v1.DeployModelOperationMetadata = (function() { + + /** + * Properties of a DeployModelOperationMetadata. + * @memberof google.cloud.automl.v1 + * @interface IDeployModelOperationMetadata + */ + + /** + * Constructs a new DeployModelOperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a DeployModelOperationMetadata. + * @implements IDeployModelOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.IDeployModelOperationMetadata=} [properties] Properties to set + */ + function DeployModelOperationMetadata(properties) { + if (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 DeployModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.IDeployModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DeployModelOperationMetadata} DeployModelOperationMetadata instance + */ + DeployModelOperationMetadata.create = function create(properties) { + return new DeployModelOperationMetadata(properties); + }; + + /** + * Encodes the specified DeployModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.DeployModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.IDeployModelOperationMetadata} message DeployModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeployModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeployModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.IDeployModelOperationMetadata} message DeployModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.DeployModelOperationMetadata} DeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployModelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DeployModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.DeployModelOperationMetadata} DeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployModelOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeployModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.DeployModelOperationMetadata} DeployModelOperationMetadata + */ + DeployModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DeployModelOperationMetadata) + return object; + return new $root.google.cloud.automl.v1.DeployModelOperationMetadata(); + }; + + /** + * Creates a plain object from a DeployModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.DeployModelOperationMetadata} message DeployModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployModelOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeployModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + DeployModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.DeployModelOperationMetadata"; + }; + + return DeployModelOperationMetadata; + })(); + + v1.UndeployModelOperationMetadata = (function() { + + /** + * Properties of an UndeployModelOperationMetadata. + * @memberof google.cloud.automl.v1 + * @interface IUndeployModelOperationMetadata + */ + + /** + * Constructs a new UndeployModelOperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an UndeployModelOperationMetadata. + * @implements IUndeployModelOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.IUndeployModelOperationMetadata=} [properties] Properties to set + */ + function UndeployModelOperationMetadata(properties) { + if (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 UndeployModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.IUndeployModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.UndeployModelOperationMetadata} UndeployModelOperationMetadata instance + */ + UndeployModelOperationMetadata.create = function create(properties) { + return new UndeployModelOperationMetadata(properties); + }; + + /** + * Encodes the specified UndeployModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.UndeployModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.IUndeployModelOperationMetadata} message UndeployModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UndeployModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UndeployModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.IUndeployModelOperationMetadata} message UndeployModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeployModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.UndeployModelOperationMetadata} UndeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployModelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.UndeployModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeployModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.UndeployModelOperationMetadata} UndeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeployModelOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeployModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UndeployModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.UndeployModelOperationMetadata} UndeployModelOperationMetadata + */ + UndeployModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.UndeployModelOperationMetadata) + return object; + return new $root.google.cloud.automl.v1.UndeployModelOperationMetadata(); + }; + + /** + * Creates a plain object from an UndeployModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.UndeployModelOperationMetadata} message UndeployModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeployModelOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UndeployModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + UndeployModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeployModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeployModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.UndeployModelOperationMetadata"; + }; + + return UndeployModelOperationMetadata; + })(); + + v1.CreateDatasetOperationMetadata = (function() { + + /** + * Properties of a CreateDatasetOperationMetadata. + * @memberof google.cloud.automl.v1 + * @interface ICreateDatasetOperationMetadata + */ + + /** + * Constructs a new CreateDatasetOperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a CreateDatasetOperationMetadata. + * @implements ICreateDatasetOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.ICreateDatasetOperationMetadata=} [properties] Properties to set + */ + function CreateDatasetOperationMetadata(properties) { + if (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 CreateDatasetOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata + * @static + * @param {google.cloud.automl.v1.ICreateDatasetOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.CreateDatasetOperationMetadata} CreateDatasetOperationMetadata instance + */ + CreateDatasetOperationMetadata.create = function create(properties) { + return new CreateDatasetOperationMetadata(properties); + }; + + /** + * Encodes the specified CreateDatasetOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata + * @static + * @param {google.cloud.automl.v1.ICreateDatasetOperationMetadata} message CreateDatasetOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatasetOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CreateDatasetOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata + * @static + * @param {google.cloud.automl.v1.ICreateDatasetOperationMetadata} message CreateDatasetOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatasetOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDatasetOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.CreateDatasetOperationMetadata} CreateDatasetOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatasetOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.CreateDatasetOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDatasetOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.CreateDatasetOperationMetadata} CreateDatasetOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatasetOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDatasetOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDatasetOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CreateDatasetOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.CreateDatasetOperationMetadata} CreateDatasetOperationMetadata + */ + CreateDatasetOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.CreateDatasetOperationMetadata) + return object; + return new $root.google.cloud.automl.v1.CreateDatasetOperationMetadata(); + }; + + /** + * Creates a plain object from a CreateDatasetOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata + * @static + * @param {google.cloud.automl.v1.CreateDatasetOperationMetadata} message CreateDatasetOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDatasetOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CreateDatasetOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateDatasetOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDatasetOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDatasetOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.CreateDatasetOperationMetadata"; + }; + + return CreateDatasetOperationMetadata; + })(); + + v1.CreateModelOperationMetadata = (function() { + + /** + * Properties of a CreateModelOperationMetadata. + * @memberof google.cloud.automl.v1 + * @interface ICreateModelOperationMetadata + */ + + /** + * Constructs a new CreateModelOperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a CreateModelOperationMetadata. + * @implements ICreateModelOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.ICreateModelOperationMetadata=} [properties] Properties to set + */ + function CreateModelOperationMetadata(properties) { + if (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 CreateModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.ICreateModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.CreateModelOperationMetadata} CreateModelOperationMetadata instance + */ + CreateModelOperationMetadata.create = function create(properties) { + return new CreateModelOperationMetadata(properties); + }; + + /** + * Encodes the specified CreateModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.CreateModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.ICreateModelOperationMetadata} message CreateModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CreateModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.ICreateModelOperationMetadata} message CreateModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.CreateModelOperationMetadata} CreateModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateModelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.CreateModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.CreateModelOperationMetadata} CreateModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateModelOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CreateModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.CreateModelOperationMetadata} CreateModelOperationMetadata + */ + CreateModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.CreateModelOperationMetadata) + return object; + return new $root.google.cloud.automl.v1.CreateModelOperationMetadata(); + }; + + /** + * Creates a plain object from a CreateModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.CreateModelOperationMetadata} message CreateModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateModelOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CreateModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.CreateModelOperationMetadata"; + }; + + return CreateModelOperationMetadata; + })(); + + v1.ImportDataOperationMetadata = (function() { + + /** + * Properties of an ImportDataOperationMetadata. + * @memberof google.cloud.automl.v1 + * @interface IImportDataOperationMetadata + */ + + /** + * Constructs a new ImportDataOperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImportDataOperationMetadata. + * @implements IImportDataOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.IImportDataOperationMetadata=} [properties] Properties to set + */ + function ImportDataOperationMetadata(properties) { + if (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 ImportDataOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1.IImportDataOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImportDataOperationMetadata} ImportDataOperationMetadata instance + */ + ImportDataOperationMetadata.create = function create(properties) { + return new ImportDataOperationMetadata(properties); + }; + + /** + * Encodes the specified ImportDataOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImportDataOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1.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(); + return writer; + }; + + /** + * Encodes the specified ImportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImportDataOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1.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.automl.v1.ImportDataOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.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.automl.v1.ImportDataOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + 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.automl.v1.ImportDataOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.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.automl.v1.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"; + return null; + }; + + /** + * Creates an ImportDataOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImportDataOperationMetadata} ImportDataOperationMetadata + */ + ImportDataOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImportDataOperationMetadata) + return object; + return new $root.google.cloud.automl.v1.ImportDataOperationMetadata(); + }; + + /** + * Creates a plain object from an ImportDataOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1.ImportDataOperationMetadata} message ImportDataOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDataOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ImportDataOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.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.automl.v1.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.automl.v1.ImportDataOperationMetadata"; + }; + + return ImportDataOperationMetadata; + })(); + + v1.ExportDataOperationMetadata = (function() { + + /** + * Properties of an ExportDataOperationMetadata. + * @memberof google.cloud.automl.v1 + * @interface IExportDataOperationMetadata + * @property {google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo|null} [outputInfo] ExportDataOperationMetadata outputInfo + */ + + /** + * Constructs a new ExportDataOperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ExportDataOperationMetadata. + * @implements IExportDataOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.IExportDataOperationMetadata=} [properties] Properties to set + */ + function ExportDataOperationMetadata(properties) { + if (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 outputInfo. + * @member {google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo|null|undefined} outputInfo + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @instance + */ + ExportDataOperationMetadata.prototype.outputInfo = null; + + /** + * Creates a new ExportDataOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1.IExportDataOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata} ExportDataOperationMetadata instance + */ + ExportDataOperationMetadata.create = function create(properties) { + return new ExportDataOperationMetadata(properties); + }; + + /** + * Encodes the specified ExportDataOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1.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.outputInfo != null && Object.hasOwnProperty.call(message, "outputInfo")) + $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.encode(message.outputInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1.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.automl.v1.ExportDataOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.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.automl.v1.ExportDataOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.outputInfo = $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.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.automl.v1.ExportDataOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.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.automl.v1.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.outputInfo != null && message.hasOwnProperty("outputInfo")) { + var error = $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.verify(message.outputInfo); + if (error) + return "outputInfo." + error; + } + return null; + }; + + /** + * Creates an ExportDataOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata} ExportDataOperationMetadata + */ + ExportDataOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExportDataOperationMetadata) + return object; + var message = new $root.google.cloud.automl.v1.ExportDataOperationMetadata(); + if (object.outputInfo != null) { + if (typeof object.outputInfo !== "object") + throw TypeError(".google.cloud.automl.v1.ExportDataOperationMetadata.outputInfo: object expected"); + message.outputInfo = $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.fromObject(object.outputInfo); + } + return message; + }; + + /** + * Creates a plain object from an ExportDataOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1.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.defaults) + object.outputInfo = null; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + object.outputInfo = $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.toObject(message.outputInfo, options); + return object; + }; + + /** + * Converts this ExportDataOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.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.automl.v1.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.automl.v1.ExportDataOperationMetadata"; + }; + + ExportDataOperationMetadata.ExportDataOutputInfo = (function() { + + /** + * Properties of an ExportDataOutputInfo. + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @interface IExportDataOutputInfo + * @property {string|null} [gcsOutputDirectory] ExportDataOutputInfo gcsOutputDirectory + */ + + /** + * Constructs a new ExportDataOutputInfo. + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @classdesc Represents an ExportDataOutputInfo. + * @implements IExportDataOutputInfo + * @constructor + * @param {google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo=} [properties] Properties to set + */ + function ExportDataOutputInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportDataOutputInfo gcsOutputDirectory. + * @member {string|null|undefined} gcsOutputDirectory + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @instance + */ + ExportDataOutputInfo.prototype.gcsOutputDirectory = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportDataOutputInfo outputLocation. + * @member {"gcsOutputDirectory"|undefined} outputLocation + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @instance + */ + Object.defineProperty(ExportDataOutputInfo.prototype, "outputLocation", { + get: $util.oneOfGetter($oneOfFields = ["gcsOutputDirectory"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportDataOutputInfo instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo} ExportDataOutputInfo instance + */ + ExportDataOutputInfo.create = function create(properties) { + return new ExportDataOutputInfo(properties); + }; + + /** + * Encodes the specified ExportDataOutputInfo message. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo} message ExportDataOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataOutputInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsOutputDirectory != null && Object.hasOwnProperty.call(message, "gcsOutputDirectory")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsOutputDirectory); + return writer; + }; + + /** + * Encodes the specified ExportDataOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo} message ExportDataOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataOutputInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportDataOutputInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo} ExportDataOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataOutputInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsOutputDirectory = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportDataOutputInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo} ExportDataOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataOutputInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportDataOutputInfo message. + * @function verify + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportDataOutputInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + properties.outputLocation = 1; + if (!$util.isString(message.gcsOutputDirectory)) + return "gcsOutputDirectory: string expected"; + } + return null; + }; + + /** + * Creates an ExportDataOutputInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo} ExportDataOutputInfo + */ + ExportDataOutputInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo) + return object; + var message = new $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo(); + if (object.gcsOutputDirectory != null) + message.gcsOutputDirectory = String(object.gcsOutputDirectory); + return message; + }; + + /** + * Creates a plain object from an ExportDataOutputInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo} message ExportDataOutputInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportDataOutputInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + object.gcsOutputDirectory = message.gcsOutputDirectory; + if (options.oneofs) + object.outputLocation = "gcsOutputDirectory"; + } + return object; + }; + + /** + * Converts this ExportDataOutputInfo to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @instance + * @returns {Object.} JSON object + */ + ExportDataOutputInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportDataOutputInfo + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportDataOutputInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo"; + }; + + return ExportDataOutputInfo; + })(); + + return ExportDataOperationMetadata; + })(); + + v1.BatchPredictOperationMetadata = (function() { + + /** + * Properties of a BatchPredictOperationMetadata. + * @memberof google.cloud.automl.v1 + * @interface IBatchPredictOperationMetadata + * @property {google.cloud.automl.v1.IBatchPredictInputConfig|null} [inputConfig] BatchPredictOperationMetadata inputConfig + * @property {google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo|null} [outputInfo] BatchPredictOperationMetadata outputInfo + */ + + /** + * Constructs a new BatchPredictOperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a BatchPredictOperationMetadata. + * @implements IBatchPredictOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.IBatchPredictOperationMetadata=} [properties] Properties to set + */ + function BatchPredictOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictOperationMetadata inputConfig. + * @member {google.cloud.automl.v1.IBatchPredictInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @instance + */ + BatchPredictOperationMetadata.prototype.inputConfig = null; + + /** + * BatchPredictOperationMetadata outputInfo. + * @member {google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo|null|undefined} outputInfo + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @instance + */ + BatchPredictOperationMetadata.prototype.outputInfo = null; + + /** + * Creates a new BatchPredictOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @static + * @param {google.cloud.automl.v1.IBatchPredictOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata} BatchPredictOperationMetadata instance + */ + BatchPredictOperationMetadata.create = function create(properties) { + return new BatchPredictOperationMetadata(properties); + }; + + /** + * Encodes the specified BatchPredictOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @static + * @param {google.cloud.automl.v1.IBatchPredictOperationMetadata} message BatchPredictOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.automl.v1.BatchPredictInputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputInfo != null && Object.hasOwnProperty.call(message, "outputInfo")) + $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.encode(message.outputInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @static + * @param {google.cloud.automl.v1.IBatchPredictOperationMetadata} message BatchPredictOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata} BatchPredictOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BatchPredictOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputConfig = $root.google.cloud.automl.v1.BatchPredictInputConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.outputInfo = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata} BatchPredictOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.automl.v1.BatchPredictInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) { + var error = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify(message.outputInfo); + if (error) + return "outputInfo." + error; + } + return null; + }; + + /** + * Creates a BatchPredictOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata} BatchPredictOperationMetadata + */ + BatchPredictOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BatchPredictOperationMetadata) + return object; + var message = new $root.google.cloud.automl.v1.BatchPredictOperationMetadata(); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictOperationMetadata.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1.BatchPredictInputConfig.fromObject(object.inputConfig); + } + if (object.outputInfo != null) { + if (typeof object.outputInfo !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictOperationMetadata.outputInfo: object expected"); + message.outputInfo = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.fromObject(object.outputInfo); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @static + * @param {google.cloud.automl.v1.BatchPredictOperationMetadata} message BatchPredictOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputConfig = null; + object.outputInfo = null; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.automl.v1.BatchPredictInputConfig.toObject(message.inputConfig, options); + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + object.outputInfo = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.toObject(message.outputInfo, options); + return object; + }; + + /** + * Converts this BatchPredictOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchPredictOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.BatchPredictOperationMetadata"; + }; + + BatchPredictOperationMetadata.BatchPredictOutputInfo = (function() { + + /** + * Properties of a BatchPredictOutputInfo. + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @interface IBatchPredictOutputInfo + * @property {string|null} [gcsOutputDirectory] BatchPredictOutputInfo gcsOutputDirectory + */ + + /** + * Constructs a new BatchPredictOutputInfo. + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @classdesc Represents a BatchPredictOutputInfo. + * @implements IBatchPredictOutputInfo + * @constructor + * @param {google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo=} [properties] Properties to set + */ + function BatchPredictOutputInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictOutputInfo gcsOutputDirectory. + * @member {string|null|undefined} gcsOutputDirectory + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @instance + */ + BatchPredictOutputInfo.prototype.gcsOutputDirectory = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchPredictOutputInfo outputLocation. + * @member {"gcsOutputDirectory"|undefined} outputLocation + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @instance + */ + Object.defineProperty(BatchPredictOutputInfo.prototype, "outputLocation", { + get: $util.oneOfGetter($oneOfFields = ["gcsOutputDirectory"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchPredictOutputInfo instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo} BatchPredictOutputInfo instance + */ + BatchPredictOutputInfo.create = function create(properties) { + return new BatchPredictOutputInfo(properties); + }; + + /** + * Encodes the specified BatchPredictOutputInfo message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo} message BatchPredictOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOutputInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsOutputDirectory != null && Object.hasOwnProperty.call(message, "gcsOutputDirectory")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsOutputDirectory); + return writer; + }; + + /** + * Encodes the specified BatchPredictOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo} message BatchPredictOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOutputInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictOutputInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo} BatchPredictOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOutputInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsOutputDirectory = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictOutputInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo} BatchPredictOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOutputInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictOutputInfo message. + * @function verify + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictOutputInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + properties.outputLocation = 1; + if (!$util.isString(message.gcsOutputDirectory)) + return "gcsOutputDirectory: string expected"; + } + return null; + }; + + /** + * Creates a BatchPredictOutputInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo} BatchPredictOutputInfo + */ + BatchPredictOutputInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo) + return object; + var message = new $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo(); + if (object.gcsOutputDirectory != null) + message.gcsOutputDirectory = String(object.gcsOutputDirectory); + return message; + }; + + /** + * Creates a plain object from a BatchPredictOutputInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo} message BatchPredictOutputInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictOutputInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + object.gcsOutputDirectory = message.gcsOutputDirectory; + if (options.oneofs) + object.outputLocation = "gcsOutputDirectory"; + } + return object; + }; + + /** + * Converts this BatchPredictOutputInfo to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @instance + * @returns {Object.} JSON object + */ + BatchPredictOutputInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictOutputInfo + * @function getTypeUrl + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictOutputInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo"; + }; + + return BatchPredictOutputInfo; + })(); + + return BatchPredictOperationMetadata; + })(); + + v1.ExportModelOperationMetadata = (function() { + + /** + * Properties of an ExportModelOperationMetadata. + * @memberof google.cloud.automl.v1 + * @interface IExportModelOperationMetadata + * @property {google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo|null} [outputInfo] ExportModelOperationMetadata outputInfo + */ + + /** + * Constructs a new ExportModelOperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ExportModelOperationMetadata. + * @implements IExportModelOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.IExportModelOperationMetadata=} [properties] Properties to set + */ + function ExportModelOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportModelOperationMetadata outputInfo. + * @member {google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo|null|undefined} outputInfo + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @instance + */ + ExportModelOperationMetadata.prototype.outputInfo = null; + + /** + * Creates a new ExportModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.IExportModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata} ExportModelOperationMetadata instance + */ + ExportModelOperationMetadata.create = function create(properties) { + return new ExportModelOperationMetadata(properties); + }; + + /** + * Encodes the specified ExportModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.IExportModelOperationMetadata} message ExportModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputInfo != null && Object.hasOwnProperty.call(message, "outputInfo")) + $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.encode(message.outputInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.IExportModelOperationMetadata} message ExportModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata} ExportModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExportModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.outputInfo = $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata} ExportModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportModelOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) { + var error = $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.verify(message.outputInfo); + if (error) + return "outputInfo." + error; + } + return null; + }; + + /** + * Creates an ExportModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata} ExportModelOperationMetadata + */ + ExportModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExportModelOperationMetadata) + return object; + var message = new $root.google.cloud.automl.v1.ExportModelOperationMetadata(); + if (object.outputInfo != null) { + if (typeof object.outputInfo !== "object") + throw TypeError(".google.cloud.automl.v1.ExportModelOperationMetadata.outputInfo: object expected"); + message.outputInfo = $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.fromObject(object.outputInfo); + } + return message; + }; + + /** + * Creates a plain object from an ExportModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.ExportModelOperationMetadata} message ExportModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportModelOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputInfo = null; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + object.outputInfo = $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.toObject(message.outputInfo, options); + return object; + }; + + /** + * Converts this ExportModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ExportModelOperationMetadata"; + }; + + ExportModelOperationMetadata.ExportModelOutputInfo = (function() { + + /** + * Properties of an ExportModelOutputInfo. + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @interface IExportModelOutputInfo + * @property {string|null} [gcsOutputDirectory] ExportModelOutputInfo gcsOutputDirectory + */ + + /** + * Constructs a new ExportModelOutputInfo. + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @classdesc Represents an ExportModelOutputInfo. + * @implements IExportModelOutputInfo + * @constructor + * @param {google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo=} [properties] Properties to set + */ + function ExportModelOutputInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportModelOutputInfo gcsOutputDirectory. + * @member {string} gcsOutputDirectory + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @instance + */ + ExportModelOutputInfo.prototype.gcsOutputDirectory = ""; + + /** + * Creates a new ExportModelOutputInfo instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo} ExportModelOutputInfo instance + */ + ExportModelOutputInfo.create = function create(properties) { + return new ExportModelOutputInfo(properties); + }; + + /** + * Encodes the specified ExportModelOutputInfo message. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo} message ExportModelOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelOutputInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsOutputDirectory != null && Object.hasOwnProperty.call(message, "gcsOutputDirectory")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsOutputDirectory); + return writer; + }; + + /** + * Encodes the specified ExportModelOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo} message ExportModelOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelOutputInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportModelOutputInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo} ExportModelOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelOutputInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsOutputDirectory = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportModelOutputInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo} ExportModelOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelOutputInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportModelOutputInfo message. + * @function verify + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportModelOutputInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) + if (!$util.isString(message.gcsOutputDirectory)) + return "gcsOutputDirectory: string expected"; + return null; + }; + + /** + * Creates an ExportModelOutputInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo} ExportModelOutputInfo + */ + ExportModelOutputInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo) + return object; + var message = new $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo(); + if (object.gcsOutputDirectory != null) + message.gcsOutputDirectory = String(object.gcsOutputDirectory); + return message; + }; + + /** + * Creates a plain object from an ExportModelOutputInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo} message ExportModelOutputInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportModelOutputInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.gcsOutputDirectory = ""; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) + object.gcsOutputDirectory = message.gcsOutputDirectory; + return object; + }; + + /** + * Converts this ExportModelOutputInfo to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @instance + * @returns {Object.} JSON object + */ + ExportModelOutputInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportModelOutputInfo + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportModelOutputInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo"; + }; + + return ExportModelOutputInfo; + })(); + + return ExportModelOperationMetadata; + })(); + + v1.PredictionService = (function() { + + /** + * Constructs a new PredictionService service. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a PredictionService + * @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 PredictionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (PredictionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PredictionService; + + /** + * Creates new PredictionService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.automl.v1.PredictionService + * @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 {PredictionService} RPC service. Useful where requests and/or responses are streamed. + */ + PredictionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.automl.v1.PredictionService|predict}. + * @memberof google.cloud.automl.v1.PredictionService + * @typedef PredictCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.PredictResponse} [response] PredictResponse + */ + + /** + * Calls Predict. + * @function predict + * @memberof google.cloud.automl.v1.PredictionService + * @instance + * @param {google.cloud.automl.v1.IPredictRequest} request PredictRequest message or plain object + * @param {google.cloud.automl.v1.PredictionService.PredictCallback} callback Node-style callback called with the error, if any, and PredictResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PredictionService.prototype.predict = function predict(request, callback) { + return this.rpcCall(predict, $root.google.cloud.automl.v1.PredictRequest, $root.google.cloud.automl.v1.PredictResponse, request, callback); + }, "name", { value: "Predict" }); + + /** + * Calls Predict. + * @function predict + * @memberof google.cloud.automl.v1.PredictionService + * @instance + * @param {google.cloud.automl.v1.IPredictRequest} request PredictRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.PredictionService|batchPredict}. + * @memberof google.cloud.automl.v1.PredictionService + * @typedef BatchPredictCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchPredict. + * @function batchPredict + * @memberof google.cloud.automl.v1.PredictionService + * @instance + * @param {google.cloud.automl.v1.IBatchPredictRequest} request BatchPredictRequest message or plain object + * @param {google.cloud.automl.v1.PredictionService.BatchPredictCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PredictionService.prototype.batchPredict = function batchPredict(request, callback) { + return this.rpcCall(batchPredict, $root.google.cloud.automl.v1.BatchPredictRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchPredict" }); + + /** + * Calls BatchPredict. + * @function batchPredict + * @memberof google.cloud.automl.v1.PredictionService + * @instance + * @param {google.cloud.automl.v1.IBatchPredictRequest} request BatchPredictRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return PredictionService; + })(); + + v1.PredictRequest = (function() { + + /** + * Properties of a PredictRequest. + * @memberof google.cloud.automl.v1 + * @interface IPredictRequest + * @property {string|null} [name] PredictRequest name + * @property {google.cloud.automl.v1.IExamplePayload|null} [payload] PredictRequest payload + * @property {Object.|null} [params] PredictRequest params + */ + + /** + * Constructs a new PredictRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a PredictRequest. + * @implements IPredictRequest + * @constructor + * @param {google.cloud.automl.v1.IPredictRequest=} [properties] Properties to set + */ + function PredictRequest(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PredictRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.PredictRequest + * @instance + */ + PredictRequest.prototype.name = ""; + + /** + * PredictRequest payload. + * @member {google.cloud.automl.v1.IExamplePayload|null|undefined} payload + * @memberof google.cloud.automl.v1.PredictRequest + * @instance + */ + PredictRequest.prototype.payload = null; + + /** + * PredictRequest params. + * @member {Object.} params + * @memberof google.cloud.automl.v1.PredictRequest + * @instance + */ + PredictRequest.prototype.params = $util.emptyObject; + + /** + * Creates a new PredictRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {google.cloud.automl.v1.IPredictRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.PredictRequest} PredictRequest instance + */ + PredictRequest.create = function create(properties) { + return new PredictRequest(properties); + }; + + /** + * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.automl.v1.PredictRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {google.cloud.automl.v1.IPredictRequest} message PredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictRequest.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.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.cloud.automl.v1.ExamplePayload.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.params[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.PredictRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {google.cloud.automl.v1.IPredictRequest} message PredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PredictRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.PredictRequest} PredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.PredictRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.payload = $root.google.cloud.automl.v1.ExamplePayload.decode(reader, reader.uint32()); + break; + } + case 3: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PredictRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.PredictRequest} PredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PredictRequest message. + * @function verify + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PredictRequest.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.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.cloud.automl.v1.ExamplePayload.verify(message.payload); + if (error) + return "payload." + error; + } + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.PredictRequest} PredictRequest + */ + PredictRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.PredictRequest) + return object; + var message = new $root.google.cloud.automl.v1.PredictRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.automl.v1.PredictRequest.payload: object expected"); + message.payload = $root.google.cloud.automl.v1.ExamplePayload.fromObject(object.payload); + } + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.automl.v1.PredictRequest.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {google.cloud.automl.v1.PredictRequest} message PredictRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PredictRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) { + object.name = ""; + object.payload = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.cloud.automl.v1.ExamplePayload.toObject(message.payload, options); + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + return object; + }; + + /** + * Converts this PredictRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.PredictRequest + * @instance + * @returns {Object.} JSON object + */ + PredictRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PredictRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PredictRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.PredictRequest"; + }; + + return PredictRequest; + })(); + + v1.PredictResponse = (function() { + + /** + * Properties of a PredictResponse. + * @memberof google.cloud.automl.v1 + * @interface IPredictResponse + * @property {Array.|null} [payload] PredictResponse payload + * @property {google.cloud.automl.v1.IExamplePayload|null} [preprocessedInput] PredictResponse preprocessedInput + * @property {Object.|null} [metadata] PredictResponse metadata + */ + + /** + * Constructs a new PredictResponse. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a PredictResponse. + * @implements IPredictResponse + * @constructor + * @param {google.cloud.automl.v1.IPredictResponse=} [properties] Properties to set + */ + function PredictResponse(properties) { + this.payload = []; + this.metadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PredictResponse payload. + * @member {Array.} payload + * @memberof google.cloud.automl.v1.PredictResponse + * @instance + */ + PredictResponse.prototype.payload = $util.emptyArray; + + /** + * PredictResponse preprocessedInput. + * @member {google.cloud.automl.v1.IExamplePayload|null|undefined} preprocessedInput + * @memberof google.cloud.automl.v1.PredictResponse + * @instance + */ + PredictResponse.prototype.preprocessedInput = null; + + /** + * PredictResponse metadata. + * @member {Object.} metadata + * @memberof google.cloud.automl.v1.PredictResponse + * @instance + */ + PredictResponse.prototype.metadata = $util.emptyObject; + + /** + * Creates a new PredictResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {google.cloud.automl.v1.IPredictResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1.PredictResponse} PredictResponse instance + */ + PredictResponse.create = function create(properties) { + return new PredictResponse(properties); + }; + + /** + * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.automl.v1.PredictResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {google.cloud.automl.v1.IPredictResponse} message PredictResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.payload != null && message.payload.length) + for (var i = 0; i < message.payload.length; ++i) + $root.google.cloud.automl.v1.AnnotationPayload.encode(message.payload[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + if (message.preprocessedInput != null && Object.hasOwnProperty.call(message, "preprocessedInput")) + $root.google.cloud.automl.v1.ExamplePayload.encode(message.preprocessedInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.PredictResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {google.cloud.automl.v1.IPredictResponse} message PredictResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PredictResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.PredictResponse} PredictResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.PredictResponse(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.payload && message.payload.length)) + message.payload = []; + message.payload.push($root.google.cloud.automl.v1.AnnotationPayload.decode(reader, reader.uint32())); + break; + } + case 3: { + message.preprocessedInput = $root.google.cloud.automl.v1.ExamplePayload.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.metadata === $util.emptyObject) + message.metadata = {}; + 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.metadata[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PredictResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.PredictResponse} PredictResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PredictResponse message. + * @function verify + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PredictResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.payload != null && message.hasOwnProperty("payload")) { + if (!Array.isArray(message.payload)) + return "payload: array expected"; + for (var i = 0; i < message.payload.length; ++i) { + var error = $root.google.cloud.automl.v1.AnnotationPayload.verify(message.payload[i]); + if (error) + return "payload." + error; + } + } + if (message.preprocessedInput != null && message.hasOwnProperty("preprocessedInput")) { + var error = $root.google.cloud.automl.v1.ExamplePayload.verify(message.preprocessedInput); + if (error) + return "preprocessedInput." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.PredictResponse} PredictResponse + */ + PredictResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.PredictResponse) + return object; + var message = new $root.google.cloud.automl.v1.PredictResponse(); + if (object.payload) { + if (!Array.isArray(object.payload)) + throw TypeError(".google.cloud.automl.v1.PredictResponse.payload: array expected"); + message.payload = []; + for (var i = 0; i < object.payload.length; ++i) { + if (typeof object.payload[i] !== "object") + throw TypeError(".google.cloud.automl.v1.PredictResponse.payload: object expected"); + message.payload[i] = $root.google.cloud.automl.v1.AnnotationPayload.fromObject(object.payload[i]); + } + } + if (object.preprocessedInput != null) { + if (typeof object.preprocessedInput !== "object") + throw TypeError(".google.cloud.automl.v1.PredictResponse.preprocessedInput: object expected"); + message.preprocessedInput = $root.google.cloud.automl.v1.ExamplePayload.fromObject(object.preprocessedInput); + } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.automl.v1.PredictResponse.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {google.cloud.automl.v1.PredictResponse} message PredictResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PredictResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.payload = []; + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) + object.preprocessedInput = null; + if (message.payload && message.payload.length) { + object.payload = []; + for (var j = 0; j < message.payload.length; ++j) + object.payload[j] = $root.google.cloud.automl.v1.AnnotationPayload.toObject(message.payload[j], options); + } + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + if (message.preprocessedInput != null && message.hasOwnProperty("preprocessedInput")) + object.preprocessedInput = $root.google.cloud.automl.v1.ExamplePayload.toObject(message.preprocessedInput, options); + return object; + }; + + /** + * Converts this PredictResponse to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.PredictResponse + * @instance + * @returns {Object.} JSON object + */ + PredictResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PredictResponse + * @function getTypeUrl + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PredictResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.PredictResponse"; + }; + + return PredictResponse; + })(); + + v1.BatchPredictRequest = (function() { + + /** + * Properties of a BatchPredictRequest. + * @memberof google.cloud.automl.v1 + * @interface IBatchPredictRequest + * @property {string|null} [name] BatchPredictRequest name + * @property {google.cloud.automl.v1.IBatchPredictInputConfig|null} [inputConfig] BatchPredictRequest inputConfig + * @property {google.cloud.automl.v1.IBatchPredictOutputConfig|null} [outputConfig] BatchPredictRequest outputConfig + * @property {Object.|null} [params] BatchPredictRequest params + */ + + /** + * Constructs a new BatchPredictRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a BatchPredictRequest. + * @implements IBatchPredictRequest + * @constructor + * @param {google.cloud.automl.v1.IBatchPredictRequest=} [properties] Properties to set + */ + function BatchPredictRequest(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @instance + */ + BatchPredictRequest.prototype.name = ""; + + /** + * BatchPredictRequest inputConfig. + * @member {google.cloud.automl.v1.IBatchPredictInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @instance + */ + BatchPredictRequest.prototype.inputConfig = null; + + /** + * BatchPredictRequest outputConfig. + * @member {google.cloud.automl.v1.IBatchPredictOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @instance + */ + BatchPredictRequest.prototype.outputConfig = null; + + /** + * BatchPredictRequest params. + * @member {Object.} params + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @instance + */ + BatchPredictRequest.prototype.params = $util.emptyObject; + + /** + * Creates a new BatchPredictRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {google.cloud.automl.v1.IBatchPredictRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BatchPredictRequest} BatchPredictRequest instance + */ + BatchPredictRequest.create = function create(properties) { + return new BatchPredictRequest(properties); + }; + + /** + * Encodes the specified BatchPredictRequest message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {google.cloud.automl.v1.IBatchPredictRequest} message BatchPredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictRequest.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.automl.v1.BatchPredictInputConfig.encode(message.inputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.automl.v1.BatchPredictOutputConfig.encode(message.outputConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.params[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {google.cloud.automl.v1.IBatchPredictRequest} message BatchPredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BatchPredictRequest} BatchPredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BatchPredictRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.inputConfig = $root.google.cloud.automl.v1.BatchPredictInputConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outputConfig = $root.google.cloud.automl.v1.BatchPredictOutputConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BatchPredictRequest} BatchPredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictRequest message. + * @function verify + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictRequest.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.automl.v1.BatchPredictInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.automl.v1.BatchPredictOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a BatchPredictRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BatchPredictRequest} BatchPredictRequest + */ + BatchPredictRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BatchPredictRequest) + return object; + var message = new $root.google.cloud.automl.v1.BatchPredictRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1.BatchPredictInputConfig.fromObject(object.inputConfig); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.automl.v1.BatchPredictOutputConfig.fromObject(object.outputConfig); + } + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictRequest.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {google.cloud.automl.v1.BatchPredictRequest} message BatchPredictRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) { + object.name = ""; + object.inputConfig = null; + object.outputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.automl.v1.BatchPredictInputConfig.toObject(message.inputConfig, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.automl.v1.BatchPredictOutputConfig.toObject(message.outputConfig, options); + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + return object; + }; + + /** + * Converts this BatchPredictRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @instance + * @returns {Object.} JSON object + */ + BatchPredictRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.BatchPredictRequest"; + }; + + return BatchPredictRequest; + })(); + + v1.BatchPredictResult = (function() { + + /** + * Properties of a BatchPredictResult. + * @memberof google.cloud.automl.v1 + * @interface IBatchPredictResult + * @property {Object.|null} [metadata] BatchPredictResult metadata + */ + + /** + * Constructs a new BatchPredictResult. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a BatchPredictResult. + * @implements IBatchPredictResult + * @constructor + * @param {google.cloud.automl.v1.IBatchPredictResult=} [properties] Properties to set + */ + function BatchPredictResult(properties) { + this.metadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictResult metadata. + * @member {Object.} metadata + * @memberof google.cloud.automl.v1.BatchPredictResult + * @instance + */ + BatchPredictResult.prototype.metadata = $util.emptyObject; + + /** + * Creates a new BatchPredictResult instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {google.cloud.automl.v1.IBatchPredictResult=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BatchPredictResult} BatchPredictResult instance + */ + BatchPredictResult.create = function create(properties) { + return new BatchPredictResult(properties); + }; + + /** + * Encodes the specified BatchPredictResult message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {google.cloud.automl.v1.IBatchPredictResult} message BatchPredictResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), 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 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictResult message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {google.cloud.automl.v1.IBatchPredictResult} message BatchPredictResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BatchPredictResult} BatchPredictResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BatchPredictResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.metadata === $util.emptyObject) + message.metadata = {}; + 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.metadata[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BatchPredictResult} BatchPredictResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictResult message. + * @function verify + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a BatchPredictResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BatchPredictResult} BatchPredictResult + */ + BatchPredictResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BatchPredictResult) + return object; + var message = new $root.google.cloud.automl.v1.BatchPredictResult(); + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictResult.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {google.cloud.automl.v1.BatchPredictResult} message BatchPredictResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.metadata = {}; + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + return object; + }; + + /** + * Converts this BatchPredictResult to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BatchPredictResult + * @instance + * @returns {Object.} JSON object + */ + BatchPredictResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictResult + * @function getTypeUrl + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.BatchPredictResult"; + }; + + return BatchPredictResult; + })(); + + v1.AutoMl = (function() { + + /** + * Constructs a new AutoMl service. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an AutoMl + * @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 AutoMl(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AutoMl.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AutoMl; + + /** + * Creates new AutoMl service using the specified rpc implementation. + * @function create + * @memberof google.cloud.automl.v1.AutoMl + * @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 {AutoMl} RPC service. Useful where requests and/or responses are streamed. + */ + AutoMl.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|createDataset}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef CreateDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateDataset. + * @function createDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.ICreateDatasetRequest} request CreateDatasetRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.CreateDatasetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.createDataset = function createDataset(request, callback) { + return this.rpcCall(createDataset, $root.google.cloud.automl.v1.CreateDatasetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateDataset" }); + + /** + * Calls CreateDataset. + * @function createDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.ICreateDatasetRequest} request CreateDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|getDataset}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef GetDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.Dataset} [response] Dataset + */ + + /** + * Calls GetDataset. + * @function getDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetDatasetRequest} request GetDatasetRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.GetDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getDataset = function getDataset(request, callback) { + return this.rpcCall(getDataset, $root.google.cloud.automl.v1.GetDatasetRequest, $root.google.cloud.automl.v1.Dataset, request, callback); + }, "name", { value: "GetDataset" }); + + /** + * Calls GetDataset. + * @function getDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetDatasetRequest} request GetDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|listDatasets}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef ListDatasetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.ListDatasetsResponse} [response] ListDatasetsResponse + */ + + /** + * Calls ListDatasets. + * @function listDatasets + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IListDatasetsRequest} request ListDatasetsRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.ListDatasetsCallback} callback Node-style callback called with the error, if any, and ListDatasetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.listDatasets = function listDatasets(request, callback) { + return this.rpcCall(listDatasets, $root.google.cloud.automl.v1.ListDatasetsRequest, $root.google.cloud.automl.v1.ListDatasetsResponse, request, callback); + }, "name", { value: "ListDatasets" }); + + /** + * Calls ListDatasets. + * @function listDatasets + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IListDatasetsRequest} request ListDatasetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|updateDataset}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef UpdateDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.Dataset} [response] Dataset + */ + + /** + * Calls UpdateDataset. + * @function updateDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IUpdateDatasetRequest} request UpdateDatasetRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.UpdateDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.updateDataset = function updateDataset(request, callback) { + return this.rpcCall(updateDataset, $root.google.cloud.automl.v1.UpdateDatasetRequest, $root.google.cloud.automl.v1.Dataset, request, callback); + }, "name", { value: "UpdateDataset" }); + + /** + * Calls UpdateDataset. + * @function updateDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IUpdateDatasetRequest} request UpdateDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|deleteDataset}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef DeleteDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteDataset. + * @function deleteDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IDeleteDatasetRequest} request DeleteDatasetRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.DeleteDatasetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.deleteDataset = function deleteDataset(request, callback) { + return this.rpcCall(deleteDataset, $root.google.cloud.automl.v1.DeleteDatasetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteDataset" }); + + /** + * Calls DeleteDataset. + * @function deleteDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IDeleteDatasetRequest} request DeleteDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|importData}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef ImportDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportData. + * @function importData + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IImportDataRequest} request ImportDataRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.ImportDataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.importData = function importData(request, callback) { + return this.rpcCall(importData, $root.google.cloud.automl.v1.ImportDataRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportData" }); + + /** + * Calls ImportData. + * @function importData + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IImportDataRequest} request ImportDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|exportData}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef ExportDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportData. + * @function exportData + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IExportDataRequest} request ExportDataRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.ExportDataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.exportData = function exportData(request, callback) { + return this.rpcCall(exportData, $root.google.cloud.automl.v1.ExportDataRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportData" }); + + /** + * Calls ExportData. + * @function exportData + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IExportDataRequest} request ExportDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|getAnnotationSpec}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef GetAnnotationSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.AnnotationSpec} [response] AnnotationSpec + */ + + /** + * Calls GetAnnotationSpec. + * @function getAnnotationSpec + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetAnnotationSpecRequest} request GetAnnotationSpecRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.GetAnnotationSpecCallback} callback Node-style callback called with the error, if any, and AnnotationSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getAnnotationSpec = function getAnnotationSpec(request, callback) { + return this.rpcCall(getAnnotationSpec, $root.google.cloud.automl.v1.GetAnnotationSpecRequest, $root.google.cloud.automl.v1.AnnotationSpec, request, callback); + }, "name", { value: "GetAnnotationSpec" }); + + /** + * Calls GetAnnotationSpec. + * @function getAnnotationSpec + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetAnnotationSpecRequest} request GetAnnotationSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|createModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef CreateModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateModel. + * @function createModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.ICreateModelRequest} request CreateModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.CreateModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.createModel = function createModel(request, callback) { + return this.rpcCall(createModel, $root.google.cloud.automl.v1.CreateModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateModel" }); + + /** + * Calls CreateModel. + * @function createModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.ICreateModelRequest} request CreateModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|getModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef GetModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.Model} [response] Model + */ + + /** + * Calls GetModel. + * @function getModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetModelRequest} request GetModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.GetModelCallback} callback Node-style callback called with the error, if any, and Model + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getModel = function getModel(request, callback) { + return this.rpcCall(getModel, $root.google.cloud.automl.v1.GetModelRequest, $root.google.cloud.automl.v1.Model, request, callback); + }, "name", { value: "GetModel" }); + + /** + * Calls GetModel. + * @function getModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetModelRequest} request GetModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|listModels}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef ListModelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.ListModelsResponse} [response] ListModelsResponse + */ + + /** + * Calls ListModels. + * @function listModels + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IListModelsRequest} request ListModelsRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.ListModelsCallback} callback Node-style callback called with the error, if any, and ListModelsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.listModels = function listModels(request, callback) { + return this.rpcCall(listModels, $root.google.cloud.automl.v1.ListModelsRequest, $root.google.cloud.automl.v1.ListModelsResponse, request, callback); + }, "name", { value: "ListModels" }); + + /** + * Calls ListModels. + * @function listModels + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IListModelsRequest} request ListModelsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|deleteModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef DeleteModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteModel. + * @function deleteModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IDeleteModelRequest} request DeleteModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.DeleteModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.deleteModel = function deleteModel(request, callback) { + return this.rpcCall(deleteModel, $root.google.cloud.automl.v1.DeleteModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteModel" }); + + /** + * Calls DeleteModel. + * @function deleteModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IDeleteModelRequest} request DeleteModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|updateModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef UpdateModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.Model} [response] Model + */ + + /** + * Calls UpdateModel. + * @function updateModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IUpdateModelRequest} request UpdateModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.UpdateModelCallback} callback Node-style callback called with the error, if any, and Model + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.updateModel = function updateModel(request, callback) { + return this.rpcCall(updateModel, $root.google.cloud.automl.v1.UpdateModelRequest, $root.google.cloud.automl.v1.Model, request, callback); + }, "name", { value: "UpdateModel" }); + + /** + * Calls UpdateModel. + * @function updateModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IUpdateModelRequest} request UpdateModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|deployModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef DeployModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeployModel. + * @function deployModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IDeployModelRequest} request DeployModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.DeployModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.deployModel = function deployModel(request, callback) { + return this.rpcCall(deployModel, $root.google.cloud.automl.v1.DeployModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeployModel" }); + + /** + * Calls DeployModel. + * @function deployModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IDeployModelRequest} request DeployModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|undeployModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef UndeployModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UndeployModel. + * @function undeployModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IUndeployModelRequest} request UndeployModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.UndeployModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.undeployModel = function undeployModel(request, callback) { + return this.rpcCall(undeployModel, $root.google.cloud.automl.v1.UndeployModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UndeployModel" }); + + /** + * Calls UndeployModel. + * @function undeployModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IUndeployModelRequest} request UndeployModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|exportModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef ExportModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportModel. + * @function exportModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IExportModelRequest} request ExportModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.ExportModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.exportModel = function exportModel(request, callback) { + return this.rpcCall(exportModel, $root.google.cloud.automl.v1.ExportModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportModel" }); + + /** + * Calls ExportModel. + * @function exportModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IExportModelRequest} request ExportModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|getModelEvaluation}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef GetModelEvaluationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.ModelEvaluation} [response] ModelEvaluation + */ + + /** + * Calls GetModelEvaluation. + * @function getModelEvaluation + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetModelEvaluationRequest} request GetModelEvaluationRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.GetModelEvaluationCallback} callback Node-style callback called with the error, if any, and ModelEvaluation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getModelEvaluation = function getModelEvaluation(request, callback) { + return this.rpcCall(getModelEvaluation, $root.google.cloud.automl.v1.GetModelEvaluationRequest, $root.google.cloud.automl.v1.ModelEvaluation, request, callback); + }, "name", { value: "GetModelEvaluation" }); + + /** + * Calls GetModelEvaluation. + * @function getModelEvaluation + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetModelEvaluationRequest} request GetModelEvaluationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|listModelEvaluations}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef ListModelEvaluationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.ListModelEvaluationsResponse} [response] ListModelEvaluationsResponse + */ + + /** + * Calls ListModelEvaluations. + * @function listModelEvaluations + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IListModelEvaluationsRequest} request ListModelEvaluationsRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.ListModelEvaluationsCallback} callback Node-style callback called with the error, if any, and ListModelEvaluationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.listModelEvaluations = function listModelEvaluations(request, callback) { + return this.rpcCall(listModelEvaluations, $root.google.cloud.automl.v1.ListModelEvaluationsRequest, $root.google.cloud.automl.v1.ListModelEvaluationsResponse, request, callback); + }, "name", { value: "ListModelEvaluations" }); + + /** + * Calls ListModelEvaluations. + * @function listModelEvaluations + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IListModelEvaluationsRequest} request ListModelEvaluationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AutoMl; + })(); + + v1.CreateDatasetRequest = (function() { + + /** + * Properties of a CreateDatasetRequest. + * @memberof google.cloud.automl.v1 + * @interface ICreateDatasetRequest + * @property {string|null} [parent] CreateDatasetRequest parent + * @property {google.cloud.automl.v1.IDataset|null} [dataset] CreateDatasetRequest dataset + */ + + /** + * Constructs a new CreateDatasetRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a CreateDatasetRequest. + * @implements ICreateDatasetRequest + * @constructor + * @param {google.cloud.automl.v1.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.automl.v1.CreateDatasetRequest + * @instance + */ + CreateDatasetRequest.prototype.parent = ""; + + /** + * CreateDatasetRequest dataset. + * @member {google.cloud.automl.v1.IDataset|null|undefined} dataset + * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @instance + */ + CreateDatasetRequest.prototype.dataset = null; + + /** + * Creates a new CreateDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @static + * @param {google.cloud.automl.v1.ICreateDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.CreateDatasetRequest} CreateDatasetRequest instance + */ + CreateDatasetRequest.create = function create(properties) { + return new CreateDatasetRequest(properties); + }; + + /** + * Encodes the specified CreateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @static + * @param {google.cloud.automl.v1.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.automl.v1.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.automl.v1.CreateDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @static + * @param {google.cloud.automl.v1.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.automl.v1.CreateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.CreateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.CreateDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.CreateDatasetRequest} CreateDatasetRequest + */ + CreateDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.CreateDatasetRequest) + return object; + var message = new $root.google.cloud.automl.v1.CreateDatasetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.dataset != null) { + if (typeof object.dataset !== "object") + throw TypeError(".google.cloud.automl.v1.CreateDatasetRequest.dataset: object expected"); + message.dataset = $root.google.cloud.automl.v1.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.automl.v1.CreateDatasetRequest + * @static + * @param {google.cloud.automl.v1.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.automl.v1.Dataset.toObject(message.dataset, options); + return object; + }; + + /** + * Converts this CreateDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.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.automl.v1.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.automl.v1.CreateDatasetRequest"; + }; + + return CreateDatasetRequest; + })(); + + v1.GetDatasetRequest = (function() { + + /** + * Properties of a GetDatasetRequest. + * @memberof google.cloud.automl.v1 + * @interface IGetDatasetRequest + * @property {string|null} [name] GetDatasetRequest name + */ + + /** + * Constructs a new GetDatasetRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a GetDatasetRequest. + * @implements IGetDatasetRequest + * @constructor + * @param {google.cloud.automl.v1.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.automl.v1.GetDatasetRequest + * @instance + */ + GetDatasetRequest.prototype.name = ""; + + /** + * Creates a new GetDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.GetDatasetRequest + * @static + * @param {google.cloud.automl.v1.IGetDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.GetDatasetRequest} GetDatasetRequest instance + */ + GetDatasetRequest.create = function create(properties) { + return new GetDatasetRequest(properties); + }; + + /** + * Encodes the specified GetDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.GetDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.GetDatasetRequest + * @static + * @param {google.cloud.automl.v1.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.automl.v1.GetDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.GetDatasetRequest + * @static + * @param {google.cloud.automl.v1.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.automl.v1.GetDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.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.automl.v1.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.automl.v1.GetDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.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.automl.v1.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.automl.v1.GetDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.GetDatasetRequest} GetDatasetRequest + */ + GetDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.GetDatasetRequest) + return object; + var message = new $root.google.cloud.automl.v1.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.automl.v1.GetDatasetRequest + * @static + * @param {google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.GetDatasetRequest"; + }; + + return GetDatasetRequest; + })(); + + v1.ListDatasetsRequest = (function() { + + /** + * Properties of a ListDatasetsRequest. + * @memberof google.cloud.automl.v1 + * @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.automl.v1 + * @classdesc Represents a ListDatasetsRequest. + * @implements IListDatasetsRequest + * @constructor + * @param {google.cloud.automl.v1.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.automl.v1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.parent = ""; + + /** + * ListDatasetsRequest filter. + * @member {string} filter + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.filter = ""; + + /** + * ListDatasetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.pageSize = 0; + + /** + * ListDatasetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDatasetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @static + * @param {google.cloud.automl.v1.IListDatasetsRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ListDatasetsRequest} ListDatasetsRequest instance + */ + ListDatasetsRequest.create = function create(properties) { + return new ListDatasetsRequest(properties); + }; + + /** + * Encodes the specified ListDatasetsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @static + * @param {google.cloud.automl.v1.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 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @static + * @param {google.cloud.automl.v1.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.automl.v1.ListDatasetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.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.automl.v1.ListDatasetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 6: { + 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.automl.v1.ListDatasetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.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.automl.v1.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.automl.v1.ListDatasetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ListDatasetsRequest} ListDatasetsRequest + */ + ListDatasetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ListDatasetsRequest) + return object; + var message = new $root.google.cloud.automl.v1.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.automl.v1.ListDatasetsRequest + * @static + * @param {google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.ListDatasetsRequest"; + }; + + return ListDatasetsRequest; + })(); + + v1.ListDatasetsResponse = (function() { + + /** + * Properties of a ListDatasetsResponse. + * @memberof google.cloud.automl.v1 + * @interface IListDatasetsResponse + * @property {Array.|null} [datasets] ListDatasetsResponse datasets + * @property {string|null} [nextPageToken] ListDatasetsResponse nextPageToken + */ + + /** + * Constructs a new ListDatasetsResponse. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ListDatasetsResponse. + * @implements IListDatasetsResponse + * @constructor + * @param {google.cloud.automl.v1.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.automl.v1.ListDatasetsResponse + * @instance + */ + ListDatasetsResponse.prototype.datasets = $util.emptyArray; + + /** + * ListDatasetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @instance + */ + ListDatasetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDatasetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @static + * @param {google.cloud.automl.v1.IListDatasetsResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ListDatasetsResponse} ListDatasetsResponse instance + */ + ListDatasetsResponse.create = function create(properties) { + return new ListDatasetsResponse(properties); + }; + + /** + * Encodes the specified ListDatasetsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @static + * @param {google.cloud.automl.v1.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.automl.v1.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.automl.v1.ListDatasetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @static + * @param {google.cloud.automl.v1.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.automl.v1.ListDatasetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.ListDatasetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.ListDatasetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ListDatasetsResponse} ListDatasetsResponse + */ + ListDatasetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ListDatasetsResponse) + return object; + var message = new $root.google.cloud.automl.v1.ListDatasetsResponse(); + if (object.datasets) { + if (!Array.isArray(object.datasets)) + throw TypeError(".google.cloud.automl.v1.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.automl.v1.ListDatasetsResponse.datasets: object expected"); + message.datasets[i] = $root.google.cloud.automl.v1.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.automl.v1.ListDatasetsResponse + * @static + * @param {google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.ListDatasetsResponse"; + }; + + return ListDatasetsResponse; + })(); + + v1.UpdateDatasetRequest = (function() { + + /** + * Properties of an UpdateDatasetRequest. + * @memberof google.cloud.automl.v1 + * @interface IUpdateDatasetRequest + * @property {google.cloud.automl.v1.IDataset|null} [dataset] UpdateDatasetRequest dataset + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDatasetRequest updateMask + */ + + /** + * Constructs a new UpdateDatasetRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an UpdateDatasetRequest. + * @implements IUpdateDatasetRequest + * @constructor + * @param {google.cloud.automl.v1.IUpdateDatasetRequest=} [properties] Properties to set + */ + function UpdateDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDatasetRequest dataset. + * @member {google.cloud.automl.v1.IDataset|null|undefined} dataset + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @instance + */ + UpdateDatasetRequest.prototype.dataset = null; + + /** + * UpdateDatasetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @instance + */ + UpdateDatasetRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @static + * @param {google.cloud.automl.v1.IUpdateDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.UpdateDatasetRequest} UpdateDatasetRequest instance + */ + UpdateDatasetRequest.create = function create(properties) { + return new UpdateDatasetRequest(properties); + }; + + /** + * Encodes the specified UpdateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.UpdateDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @static + * @param {google.cloud.automl.v1.IUpdateDatasetRequest} message UpdateDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatasetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + $root.google.cloud.automl.v1.Dataset.encode(message.dataset, 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 UpdateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UpdateDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @static + * @param {google.cloud.automl.v1.IUpdateDatasetRequest} message UpdateDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.UpdateDatasetRequest} UpdateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatasetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.UpdateDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataset = $root.google.cloud.automl.v1.Dataset.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 UpdateDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.UpdateDatasetRequest} UpdateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDatasetRequest message. + * @function verify + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDatasetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) { + var error = $root.google.cloud.automl.v1.Dataset.verify(message.dataset); + if (error) + return "dataset." + 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 UpdateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.UpdateDatasetRequest} UpdateDatasetRequest + */ + UpdateDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.UpdateDatasetRequest) + return object; + var message = new $root.google.cloud.automl.v1.UpdateDatasetRequest(); + if (object.dataset != null) { + if (typeof object.dataset !== "object") + throw TypeError(".google.cloud.automl.v1.UpdateDatasetRequest.dataset: object expected"); + message.dataset = $root.google.cloud.automl.v1.Dataset.fromObject(object.dataset); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.automl.v1.UpdateDatasetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @static + * @param {google.cloud.automl.v1.UpdateDatasetRequest} message UpdateDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDatasetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = null; + object.updateMask = null; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = $root.google.cloud.automl.v1.Dataset.toObject(message.dataset, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.UpdateDatasetRequest"; + }; + + return UpdateDatasetRequest; + })(); + + v1.DeleteDatasetRequest = (function() { + + /** + * Properties of a DeleteDatasetRequest. + * @memberof google.cloud.automl.v1 + * @interface IDeleteDatasetRequest + * @property {string|null} [name] DeleteDatasetRequest name + */ + + /** + * Constructs a new DeleteDatasetRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a DeleteDatasetRequest. + * @implements IDeleteDatasetRequest + * @constructor + * @param {google.cloud.automl.v1.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.automl.v1.DeleteDatasetRequest + * @instance + */ + DeleteDatasetRequest.prototype.name = ""; + + /** + * Creates a new DeleteDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @static + * @param {google.cloud.automl.v1.IDeleteDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DeleteDatasetRequest} DeleteDatasetRequest instance + */ + DeleteDatasetRequest.create = function create(properties) { + return new DeleteDatasetRequest(properties); + }; + + /** + * Encodes the specified DeleteDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.DeleteDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @static + * @param {google.cloud.automl.v1.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.automl.v1.DeleteDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @static + * @param {google.cloud.automl.v1.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.automl.v1.DeleteDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.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.automl.v1.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.automl.v1.DeleteDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.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.automl.v1.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.automl.v1.DeleteDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.DeleteDatasetRequest} DeleteDatasetRequest + */ + DeleteDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DeleteDatasetRequest) + return object; + var message = new $root.google.cloud.automl.v1.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.automl.v1.DeleteDatasetRequest + * @static + * @param {google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.DeleteDatasetRequest"; + }; + + return DeleteDatasetRequest; + })(); + + v1.ImportDataRequest = (function() { + + /** + * Properties of an ImportDataRequest. + * @memberof google.cloud.automl.v1 + * @interface IImportDataRequest + * @property {string|null} [name] ImportDataRequest name + * @property {google.cloud.automl.v1.IInputConfig|null} [inputConfig] ImportDataRequest inputConfig + */ + + /** + * Constructs a new ImportDataRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImportDataRequest. + * @implements IImportDataRequest + * @constructor + * @param {google.cloud.automl.v1.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.automl.v1.ImportDataRequest + * @instance + */ + ImportDataRequest.prototype.name = ""; + + /** + * ImportDataRequest inputConfig. + * @member {google.cloud.automl.v1.IInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1.ImportDataRequest + * @instance + */ + ImportDataRequest.prototype.inputConfig = null; + + /** + * Creates a new ImportDataRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImportDataRequest + * @static + * @param {google.cloud.automl.v1.IImportDataRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImportDataRequest} ImportDataRequest instance + */ + ImportDataRequest.create = function create(properties) { + return new ImportDataRequest(properties); + }; + + /** + * Encodes the specified ImportDataRequest message. Does not implicitly {@link google.cloud.automl.v1.ImportDataRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImportDataRequest + * @static + * @param {google.cloud.automl.v1.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.automl.v1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImportDataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImportDataRequest + * @static + * @param {google.cloud.automl.v1.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.automl.v1.ImportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.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.automl.v1.ImportDataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.inputConfig = $root.google.cloud.automl.v1.InputConfig.decode(reader, reader.uint32()); + 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.automl.v1.ImportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.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.automl.v1.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.automl.v1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + return null; + }; + + /** + * Creates an ImportDataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImportDataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImportDataRequest} ImportDataRequest + */ + ImportDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImportDataRequest) + return object; + var message = new $root.google.cloud.automl.v1.ImportDataRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.ImportDataRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1.InputConfig.fromObject(object.inputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ImportDataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImportDataRequest + * @static + * @param {google.cloud.automl.v1.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; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.automl.v1.InputConfig.toObject(message.inputConfig, options); + return object; + }; + + /** + * Converts this ImportDataRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.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.automl.v1.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.automl.v1.ImportDataRequest"; + }; + + return ImportDataRequest; + })(); + + v1.ExportDataRequest = (function() { + + /** + * Properties of an ExportDataRequest. + * @memberof google.cloud.automl.v1 + * @interface IExportDataRequest + * @property {string|null} [name] ExportDataRequest name + * @property {google.cloud.automl.v1.IOutputConfig|null} [outputConfig] ExportDataRequest outputConfig + */ + + /** + * Constructs a new ExportDataRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ExportDataRequest. + * @implements IExportDataRequest + * @constructor + * @param {google.cloud.automl.v1.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.automl.v1.ExportDataRequest + * @instance + */ + ExportDataRequest.prototype.name = ""; + + /** + * ExportDataRequest outputConfig. + * @member {google.cloud.automl.v1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.automl.v1.ExportDataRequest + * @instance + */ + ExportDataRequest.prototype.outputConfig = null; + + /** + * Creates a new ExportDataRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ExportDataRequest + * @static + * @param {google.cloud.automl.v1.IExportDataRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExportDataRequest} ExportDataRequest instance + */ + ExportDataRequest.create = function create(properties) { + return new ExportDataRequest(properties); + }; + + /** + * Encodes the specified ExportDataRequest message. Does not implicitly {@link google.cloud.automl.v1.ExportDataRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ExportDataRequest + * @static + * @param {google.cloud.automl.v1.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.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.automl.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportDataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ExportDataRequest + * @static + * @param {google.cloud.automl.v1.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.automl.v1.ExportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.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.automl.v1.ExportDataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.outputConfig = $root.google.cloud.automl.v1.OutputConfig.decode(reader, reader.uint32()); + 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.automl.v1.ExportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.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.automl.v1.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.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.automl.v1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportDataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ExportDataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ExportDataRequest} ExportDataRequest + */ + ExportDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExportDataRequest) + return object; + var message = new $root.google.cloud.automl.v1.ExportDataRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.ExportDataRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.automl.v1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportDataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ExportDataRequest + * @static + * @param {google.cloud.automl.v1.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.outputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.automl.v1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportDataRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.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.automl.v1.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.automl.v1.ExportDataRequest"; + }; + + return ExportDataRequest; + })(); + + v1.GetAnnotationSpecRequest = (function() { + + /** + * Properties of a GetAnnotationSpecRequest. + * @memberof google.cloud.automl.v1 + * @interface IGetAnnotationSpecRequest + * @property {string|null} [name] GetAnnotationSpecRequest name + */ + + /** + * Constructs a new GetAnnotationSpecRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a GetAnnotationSpecRequest. + * @implements IGetAnnotationSpecRequest + * @constructor + * @param {google.cloud.automl.v1.IGetAnnotationSpecRequest=} [properties] Properties to set + */ + function GetAnnotationSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAnnotationSpecRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @instance + */ + GetAnnotationSpecRequest.prototype.name = ""; + + /** + * Creates a new GetAnnotationSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @static + * @param {google.cloud.automl.v1.IGetAnnotationSpecRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.GetAnnotationSpecRequest} GetAnnotationSpecRequest instance + */ + GetAnnotationSpecRequest.create = function create(properties) { + return new GetAnnotationSpecRequest(properties); + }; + + /** + * Encodes the specified GetAnnotationSpecRequest message. Does not implicitly {@link google.cloud.automl.v1.GetAnnotationSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @static + * @param {google.cloud.automl.v1.IGetAnnotationSpecRequest} message GetAnnotationSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnnotationSpecRequest.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 GetAnnotationSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetAnnotationSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @static + * @param {google.cloud.automl.v1.IGetAnnotationSpecRequest} message GetAnnotationSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnnotationSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAnnotationSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.GetAnnotationSpecRequest} GetAnnotationSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnnotationSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.GetAnnotationSpecRequest(); + 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 GetAnnotationSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.GetAnnotationSpecRequest} GetAnnotationSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnnotationSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAnnotationSpecRequest message. + * @function verify + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAnnotationSpecRequest.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 GetAnnotationSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.GetAnnotationSpecRequest} GetAnnotationSpecRequest + */ + GetAnnotationSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.GetAnnotationSpecRequest) + return object; + var message = new $root.google.cloud.automl.v1.GetAnnotationSpecRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAnnotationSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @static + * @param {google.cloud.automl.v1.GetAnnotationSpecRequest} message GetAnnotationSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAnnotationSpecRequest.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 GetAnnotationSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @instance + * @returns {Object.} JSON object + */ + GetAnnotationSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAnnotationSpecRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAnnotationSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.GetAnnotationSpecRequest"; + }; + + return GetAnnotationSpecRequest; + })(); + + v1.CreateModelRequest = (function() { + + /** + * Properties of a CreateModelRequest. + * @memberof google.cloud.automl.v1 + * @interface ICreateModelRequest + * @property {string|null} [parent] CreateModelRequest parent + * @property {google.cloud.automl.v1.IModel|null} [model] CreateModelRequest model + */ + + /** + * Constructs a new CreateModelRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a CreateModelRequest. + * @implements ICreateModelRequest + * @constructor + * @param {google.cloud.automl.v1.ICreateModelRequest=} [properties] Properties to set + */ + function CreateModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateModelRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1.CreateModelRequest + * @instance + */ + CreateModelRequest.prototype.parent = ""; + + /** + * CreateModelRequest model. + * @member {google.cloud.automl.v1.IModel|null|undefined} model + * @memberof google.cloud.automl.v1.CreateModelRequest + * @instance + */ + CreateModelRequest.prototype.model = null; + + /** + * Creates a new CreateModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.CreateModelRequest + * @static + * @param {google.cloud.automl.v1.ICreateModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.CreateModelRequest} CreateModelRequest instance + */ + CreateModelRequest.create = function create(properties) { + return new CreateModelRequest(properties); + }; + + /** + * Encodes the specified CreateModelRequest message. Does not implicitly {@link google.cloud.automl.v1.CreateModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.CreateModelRequest + * @static + * @param {google.cloud.automl.v1.ICreateModelRequest} message CreateModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateModelRequest.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.model != null && Object.hasOwnProperty.call(message, "model")) + $root.google.cloud.automl.v1.Model.encode(message.model, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.CreateModelRequest + * @static + * @param {google.cloud.automl.v1.ICreateModelRequest} message CreateModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.CreateModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.CreateModelRequest} CreateModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.CreateModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 4: { + message.model = $root.google.cloud.automl.v1.Model.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.CreateModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.CreateModelRequest} CreateModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1.CreateModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateModelRequest.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.model != null && message.hasOwnProperty("model")) { + var error = $root.google.cloud.automl.v1.Model.verify(message.model); + if (error) + return "model." + error; + } + return null; + }; + + /** + * Creates a CreateModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.CreateModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.CreateModelRequest} CreateModelRequest + */ + CreateModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.CreateModelRequest) + return object; + var message = new $root.google.cloud.automl.v1.CreateModelRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.model != null) { + if (typeof object.model !== "object") + throw TypeError(".google.cloud.automl.v1.CreateModelRequest.model: object expected"); + message.model = $root.google.cloud.automl.v1.Model.fromObject(object.model); + } + return message; + }; + + /** + * Creates a plain object from a CreateModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.CreateModelRequest + * @static + * @param {google.cloud.automl.v1.CreateModelRequest} message CreateModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.model = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.model != null && message.hasOwnProperty("model")) + object.model = $root.google.cloud.automl.v1.Model.toObject(message.model, options); + return object; + }; + + /** + * Converts this CreateModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.CreateModelRequest + * @instance + * @returns {Object.} JSON object + */ + CreateModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.CreateModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.CreateModelRequest"; + }; + + return CreateModelRequest; + })(); + + v1.GetModelRequest = (function() { + + /** + * Properties of a GetModelRequest. + * @memberof google.cloud.automl.v1 + * @interface IGetModelRequest + * @property {string|null} [name] GetModelRequest name + */ + + /** + * Constructs a new GetModelRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a GetModelRequest. + * @implements IGetModelRequest + * @constructor + * @param {google.cloud.automl.v1.IGetModelRequest=} [properties] Properties to set + */ + function GetModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.GetModelRequest + * @instance + */ + GetModelRequest.prototype.name = ""; + + /** + * Creates a new GetModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.GetModelRequest + * @static + * @param {google.cloud.automl.v1.IGetModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.GetModelRequest} GetModelRequest instance + */ + GetModelRequest.create = function create(properties) { + return new GetModelRequest(properties); + }; + + /** + * Encodes the specified GetModelRequest message. Does not implicitly {@link google.cloud.automl.v1.GetModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.GetModelRequest + * @static + * @param {google.cloud.automl.v1.IGetModelRequest} message GetModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelRequest.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 GetModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.GetModelRequest + * @static + * @param {google.cloud.automl.v1.IGetModelRequest} message GetModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.GetModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.GetModelRequest} GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.GetModelRequest(); + 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 GetModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.GetModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.GetModelRequest} GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1.GetModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetModelRequest.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 GetModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.GetModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.GetModelRequest} GetModelRequest + */ + GetModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.GetModelRequest) + return object; + var message = new $root.google.cloud.automl.v1.GetModelRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.GetModelRequest + * @static + * @param {google.cloud.automl.v1.GetModelRequest} message GetModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetModelRequest.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 GetModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.GetModelRequest + * @instance + * @returns {Object.} JSON object + */ + GetModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.GetModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.GetModelRequest"; + }; + + return GetModelRequest; + })(); + + v1.ListModelsRequest = (function() { + + /** + * Properties of a ListModelsRequest. + * @memberof google.cloud.automl.v1 + * @interface IListModelsRequest + * @property {string|null} [parent] ListModelsRequest parent + * @property {string|null} [filter] ListModelsRequest filter + * @property {number|null} [pageSize] ListModelsRequest pageSize + * @property {string|null} [pageToken] ListModelsRequest pageToken + */ + + /** + * Constructs a new ListModelsRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ListModelsRequest. + * @implements IListModelsRequest + * @constructor + * @param {google.cloud.automl.v1.IListModelsRequest=} [properties] Properties to set + */ + function ListModelsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelsRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.parent = ""; + + /** + * ListModelsRequest filter. + * @member {string} filter + * @memberof google.cloud.automl.v1.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.filter = ""; + + /** + * ListModelsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.automl.v1.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.pageSize = 0; + + /** + * ListModelsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.automl.v1.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListModelsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ListModelsRequest + * @static + * @param {google.cloud.automl.v1.IListModelsRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ListModelsRequest} ListModelsRequest instance + */ + ListModelsRequest.create = function create(properties) { + return new ListModelsRequest(properties); + }; + + /** + * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListModelsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ListModelsRequest + * @static + * @param {google.cloud.automl.v1.IListModelsRequest} message ListModelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsRequest.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 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ListModelsRequest + * @static + * @param {google.cloud.automl.v1.IListModelsRequest} message ListModelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ListModelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ListModelsRequest} ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListModelsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ListModelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ListModelsRequest} ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelsRequest message. + * @function verify + * @memberof google.cloud.automl.v1.ListModelsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelsRequest.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 ListModelsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ListModelsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ListModelsRequest} ListModelsRequest + */ + ListModelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ListModelsRequest) + return object; + var message = new $root.google.cloud.automl.v1.ListModelsRequest(); + 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 ListModelsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ListModelsRequest + * @static + * @param {google.cloud.automl.v1.ListModelsRequest} message ListModelsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelsRequest.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 ListModelsRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ListModelsRequest + * @instance + * @returns {Object.} JSON object + */ + ListModelsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelsRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ListModelsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ListModelsRequest"; + }; + + return ListModelsRequest; + })(); + + v1.ListModelsResponse = (function() { + + /** + * Properties of a ListModelsResponse. + * @memberof google.cloud.automl.v1 + * @interface IListModelsResponse + * @property {Array.|null} [model] ListModelsResponse model + * @property {string|null} [nextPageToken] ListModelsResponse nextPageToken + */ + + /** + * Constructs a new ListModelsResponse. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ListModelsResponse. + * @implements IListModelsResponse + * @constructor + * @param {google.cloud.automl.v1.IListModelsResponse=} [properties] Properties to set + */ + function ListModelsResponse(properties) { + this.model = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelsResponse model. + * @member {Array.} model + * @memberof google.cloud.automl.v1.ListModelsResponse + * @instance + */ + ListModelsResponse.prototype.model = $util.emptyArray; + + /** + * ListModelsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.automl.v1.ListModelsResponse + * @instance + */ + ListModelsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListModelsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ListModelsResponse + * @static + * @param {google.cloud.automl.v1.IListModelsResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ListModelsResponse} ListModelsResponse instance + */ + ListModelsResponse.create = function create(properties) { + return new ListModelsResponse(properties); + }; + + /** + * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListModelsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ListModelsResponse + * @static + * @param {google.cloud.automl.v1.IListModelsResponse} message ListModelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && message.model.length) + for (var i = 0; i < message.model.length; ++i) + $root.google.cloud.automl.v1.Model.encode(message.model[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 ListModelsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ListModelsResponse + * @static + * @param {google.cloud.automl.v1.IListModelsResponse} message ListModelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ListModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ListModelsResponse} ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListModelsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.model && message.model.length)) + message.model = []; + message.model.push($root.google.cloud.automl.v1.Model.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ListModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ListModelsResponse} ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelsResponse message. + * @function verify + * @memberof google.cloud.automl.v1.ListModelsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) { + if (!Array.isArray(message.model)) + return "model: array expected"; + for (var i = 0; i < message.model.length; ++i) { + var error = $root.google.cloud.automl.v1.Model.verify(message.model[i]); + if (error) + return "model." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ListModelsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ListModelsResponse} ListModelsResponse + */ + ListModelsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ListModelsResponse) + return object; + var message = new $root.google.cloud.automl.v1.ListModelsResponse(); + if (object.model) { + if (!Array.isArray(object.model)) + throw TypeError(".google.cloud.automl.v1.ListModelsResponse.model: array expected"); + message.model = []; + for (var i = 0; i < object.model.length; ++i) { + if (typeof object.model[i] !== "object") + throw TypeError(".google.cloud.automl.v1.ListModelsResponse.model: object expected"); + message.model[i] = $root.google.cloud.automl.v1.Model.fromObject(object.model[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ListModelsResponse + * @static + * @param {google.cloud.automl.v1.ListModelsResponse} message ListModelsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.model = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.model && message.model.length) { + object.model = []; + for (var j = 0; j < message.model.length; ++j) + object.model[j] = $root.google.cloud.automl.v1.Model.toObject(message.model[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListModelsResponse to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ListModelsResponse + * @instance + * @returns {Object.} JSON object + */ + ListModelsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelsResponse + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ListModelsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ListModelsResponse"; + }; + + return ListModelsResponse; + })(); + + v1.DeleteModelRequest = (function() { + + /** + * Properties of a DeleteModelRequest. + * @memberof google.cloud.automl.v1 + * @interface IDeleteModelRequest + * @property {string|null} [name] DeleteModelRequest name + */ + + /** + * Constructs a new DeleteModelRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a DeleteModelRequest. + * @implements IDeleteModelRequest + * @constructor + * @param {google.cloud.automl.v1.IDeleteModelRequest=} [properties] Properties to set + */ + function DeleteModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @instance + */ + DeleteModelRequest.prototype.name = ""; + + /** + * Creates a new DeleteModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @static + * @param {google.cloud.automl.v1.IDeleteModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DeleteModelRequest} DeleteModelRequest instance + */ + DeleteModelRequest.create = function create(properties) { + return new DeleteModelRequest(properties); + }; + + /** + * Encodes the specified DeleteModelRequest message. Does not implicitly {@link google.cloud.automl.v1.DeleteModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @static + * @param {google.cloud.automl.v1.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteModelRequest.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 DeleteModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @static + * @param {google.cloud.automl.v1.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.DeleteModelRequest} DeleteModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DeleteModelRequest(); + 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 DeleteModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.DeleteModelRequest} DeleteModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteModelRequest.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 DeleteModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.DeleteModelRequest} DeleteModelRequest + */ + DeleteModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DeleteModelRequest) + return object; + var message = new $root.google.cloud.automl.v1.DeleteModelRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @static + * @param {google.cloud.automl.v1.DeleteModelRequest} message DeleteModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteModelRequest.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 DeleteModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.DeleteModelRequest"; + }; + + return DeleteModelRequest; + })(); + + v1.UpdateModelRequest = (function() { + + /** + * Properties of an UpdateModelRequest. + * @memberof google.cloud.automl.v1 + * @interface IUpdateModelRequest + * @property {google.cloud.automl.v1.IModel|null} [model] UpdateModelRequest model + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateModelRequest updateMask + */ + + /** + * Constructs a new UpdateModelRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an UpdateModelRequest. + * @implements IUpdateModelRequest + * @constructor + * @param {google.cloud.automl.v1.IUpdateModelRequest=} [properties] Properties to set + */ + function UpdateModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateModelRequest model. + * @member {google.cloud.automl.v1.IModel|null|undefined} model + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @instance + */ + UpdateModelRequest.prototype.model = null; + + /** + * UpdateModelRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @instance + */ + UpdateModelRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @static + * @param {google.cloud.automl.v1.IUpdateModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.UpdateModelRequest} UpdateModelRequest instance + */ + UpdateModelRequest.create = function create(properties) { + return new UpdateModelRequest(properties); + }; + + /** + * Encodes the specified UpdateModelRequest message. Does not implicitly {@link google.cloud.automl.v1.UpdateModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @static + * @param {google.cloud.automl.v1.IUpdateModelRequest} message UpdateModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateModelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + $root.google.cloud.automl.v1.Model.encode(message.model, 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 UpdateModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UpdateModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @static + * @param {google.cloud.automl.v1.IUpdateModelRequest} message UpdateModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.UpdateModelRequest} UpdateModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.UpdateModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = $root.google.cloud.automl.v1.Model.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 UpdateModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.UpdateModelRequest} UpdateModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateModelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) { + var error = $root.google.cloud.automl.v1.Model.verify(message.model); + if (error) + return "model." + 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 UpdateModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.UpdateModelRequest} UpdateModelRequest + */ + UpdateModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.UpdateModelRequest) + return object; + var message = new $root.google.cloud.automl.v1.UpdateModelRequest(); + if (object.model != null) { + if (typeof object.model !== "object") + throw TypeError(".google.cloud.automl.v1.UpdateModelRequest.model: object expected"); + message.model = $root.google.cloud.automl.v1.Model.fromObject(object.model); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.automl.v1.UpdateModelRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @static + * @param {google.cloud.automl.v1.UpdateModelRequest} message UpdateModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = null; + object.updateMask = null; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = $root.google.cloud.automl.v1.Model.toObject(message.model, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.UpdateModelRequest"; + }; + + return UpdateModelRequest; + })(); + + v1.DeployModelRequest = (function() { + + /** + * Properties of a DeployModelRequest. + * @memberof google.cloud.automl.v1 + * @interface IDeployModelRequest + * @property {google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata|null} [imageObjectDetectionModelDeploymentMetadata] DeployModelRequest imageObjectDetectionModelDeploymentMetadata + * @property {google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata|null} [imageClassificationModelDeploymentMetadata] DeployModelRequest imageClassificationModelDeploymentMetadata + * @property {string|null} [name] DeployModelRequest name + */ + + /** + * Constructs a new DeployModelRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a DeployModelRequest. + * @implements IDeployModelRequest + * @constructor + * @param {google.cloud.automl.v1.IDeployModelRequest=} [properties] Properties to set + */ + function DeployModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployModelRequest imageObjectDetectionModelDeploymentMetadata. + * @member {google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata|null|undefined} imageObjectDetectionModelDeploymentMetadata + * @memberof google.cloud.automl.v1.DeployModelRequest + * @instance + */ + DeployModelRequest.prototype.imageObjectDetectionModelDeploymentMetadata = null; + + /** + * DeployModelRequest imageClassificationModelDeploymentMetadata. + * @member {google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata|null|undefined} imageClassificationModelDeploymentMetadata + * @memberof google.cloud.automl.v1.DeployModelRequest + * @instance + */ + DeployModelRequest.prototype.imageClassificationModelDeploymentMetadata = null; + + /** + * DeployModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.DeployModelRequest + * @instance + */ + DeployModelRequest.prototype.name = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeployModelRequest modelDeploymentMetadata. + * @member {"imageObjectDetectionModelDeploymentMetadata"|"imageClassificationModelDeploymentMetadata"|undefined} modelDeploymentMetadata + * @memberof google.cloud.automl.v1.DeployModelRequest + * @instance + */ + Object.defineProperty(DeployModelRequest.prototype, "modelDeploymentMetadata", { + get: $util.oneOfGetter($oneOfFields = ["imageObjectDetectionModelDeploymentMetadata", "imageClassificationModelDeploymentMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeployModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.DeployModelRequest + * @static + * @param {google.cloud.automl.v1.IDeployModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DeployModelRequest} DeployModelRequest instance + */ + DeployModelRequest.create = function create(properties) { + return new DeployModelRequest(properties); + }; + + /** + * Encodes the specified DeployModelRequest message. Does not implicitly {@link google.cloud.automl.v1.DeployModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.DeployModelRequest + * @static + * @param {google.cloud.automl.v1.IDeployModelRequest} message DeployModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployModelRequest.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.imageObjectDetectionModelDeploymentMetadata != null && Object.hasOwnProperty.call(message, "imageObjectDetectionModelDeploymentMetadata")) + $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.encode(message.imageObjectDetectionModelDeploymentMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageClassificationModelDeploymentMetadata != null && Object.hasOwnProperty.call(message, "imageClassificationModelDeploymentMetadata")) + $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.encode(message.imageClassificationModelDeploymentMetadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeployModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.DeployModelRequest + * @static + * @param {google.cloud.automl.v1.IDeployModelRequest} message DeployModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.DeployModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.DeployModelRequest} DeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DeployModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.imageObjectDetectionModelDeploymentMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.decode(reader, reader.uint32()); + break; + } + case 4: { + message.imageClassificationModelDeploymentMetadata = $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.DeployModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.DeployModelRequest} DeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1.DeployModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployModelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.imageObjectDetectionModelDeploymentMetadata != null && message.hasOwnProperty("imageObjectDetectionModelDeploymentMetadata")) { + properties.modelDeploymentMetadata = 1; + { + var error = $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.verify(message.imageObjectDetectionModelDeploymentMetadata); + if (error) + return "imageObjectDetectionModelDeploymentMetadata." + error; + } + } + if (message.imageClassificationModelDeploymentMetadata != null && message.hasOwnProperty("imageClassificationModelDeploymentMetadata")) { + if (properties.modelDeploymentMetadata === 1) + return "modelDeploymentMetadata: multiple values"; + properties.modelDeploymentMetadata = 1; + { + var error = $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.verify(message.imageClassificationModelDeploymentMetadata); + if (error) + return "imageClassificationModelDeploymentMetadata." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeployModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.DeployModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.DeployModelRequest} DeployModelRequest + */ + DeployModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DeployModelRequest) + return object; + var message = new $root.google.cloud.automl.v1.DeployModelRequest(); + if (object.imageObjectDetectionModelDeploymentMetadata != null) { + if (typeof object.imageObjectDetectionModelDeploymentMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.DeployModelRequest.imageObjectDetectionModelDeploymentMetadata: object expected"); + message.imageObjectDetectionModelDeploymentMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.fromObject(object.imageObjectDetectionModelDeploymentMetadata); + } + if (object.imageClassificationModelDeploymentMetadata != null) { + if (typeof object.imageClassificationModelDeploymentMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.DeployModelRequest.imageClassificationModelDeploymentMetadata: object expected"); + message.imageClassificationModelDeploymentMetadata = $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.fromObject(object.imageClassificationModelDeploymentMetadata); + } + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeployModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.DeployModelRequest + * @static + * @param {google.cloud.automl.v1.DeployModelRequest} message DeployModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployModelRequest.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.imageObjectDetectionModelDeploymentMetadata != null && message.hasOwnProperty("imageObjectDetectionModelDeploymentMetadata")) { + object.imageObjectDetectionModelDeploymentMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.toObject(message.imageObjectDetectionModelDeploymentMetadata, options); + if (options.oneofs) + object.modelDeploymentMetadata = "imageObjectDetectionModelDeploymentMetadata"; + } + if (message.imageClassificationModelDeploymentMetadata != null && message.hasOwnProperty("imageClassificationModelDeploymentMetadata")) { + object.imageClassificationModelDeploymentMetadata = $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.toObject(message.imageClassificationModelDeploymentMetadata, options); + if (options.oneofs) + object.modelDeploymentMetadata = "imageClassificationModelDeploymentMetadata"; + } + return object; + }; + + /** + * Converts this DeployModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.DeployModelRequest + * @instance + * @returns {Object.} JSON object + */ + DeployModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.DeployModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.DeployModelRequest"; + }; + + return DeployModelRequest; + })(); + + v1.UndeployModelRequest = (function() { + + /** + * Properties of an UndeployModelRequest. + * @memberof google.cloud.automl.v1 + * @interface IUndeployModelRequest + * @property {string|null} [name] UndeployModelRequest name + */ + + /** + * Constructs a new UndeployModelRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an UndeployModelRequest. + * @implements IUndeployModelRequest + * @constructor + * @param {google.cloud.automl.v1.IUndeployModelRequest=} [properties] Properties to set + */ + function UndeployModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeployModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @instance + */ + UndeployModelRequest.prototype.name = ""; + + /** + * Creates a new UndeployModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @static + * @param {google.cloud.automl.v1.IUndeployModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.UndeployModelRequest} UndeployModelRequest instance + */ + UndeployModelRequest.create = function create(properties) { + return new UndeployModelRequest(properties); + }; + + /** + * Encodes the specified UndeployModelRequest message. Does not implicitly {@link google.cloud.automl.v1.UndeployModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @static + * @param {google.cloud.automl.v1.IUndeployModelRequest} message UndeployModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployModelRequest.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 UndeployModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UndeployModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @static + * @param {google.cloud.automl.v1.IUndeployModelRequest} message UndeployModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeployModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.UndeployModelRequest} UndeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.UndeployModelRequest(); + 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 an UndeployModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.UndeployModelRequest} UndeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeployModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeployModelRequest.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 an UndeployModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.UndeployModelRequest} UndeployModelRequest + */ + UndeployModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.UndeployModelRequest) + return object; + var message = new $root.google.cloud.automl.v1.UndeployModelRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an UndeployModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @static + * @param {google.cloud.automl.v1.UndeployModelRequest} message UndeployModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeployModelRequest.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 UndeployModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @instance + * @returns {Object.} JSON object + */ + UndeployModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeployModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeployModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.UndeployModelRequest"; + }; + + return UndeployModelRequest; + })(); + + v1.ExportModelRequest = (function() { + + /** + * Properties of an ExportModelRequest. + * @memberof google.cloud.automl.v1 + * @interface IExportModelRequest + * @property {string|null} [name] ExportModelRequest name + * @property {google.cloud.automl.v1.IModelExportOutputConfig|null} [outputConfig] ExportModelRequest outputConfig + */ + + /** + * Constructs a new ExportModelRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ExportModelRequest. + * @implements IExportModelRequest + * @constructor + * @param {google.cloud.automl.v1.IExportModelRequest=} [properties] Properties to set + */ + function ExportModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.ExportModelRequest + * @instance + */ + ExportModelRequest.prototype.name = ""; + + /** + * ExportModelRequest outputConfig. + * @member {google.cloud.automl.v1.IModelExportOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.automl.v1.ExportModelRequest + * @instance + */ + ExportModelRequest.prototype.outputConfig = null; + + /** + * Creates a new ExportModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ExportModelRequest + * @static + * @param {google.cloud.automl.v1.IExportModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExportModelRequest} ExportModelRequest instance + */ + ExportModelRequest.create = function create(properties) { + return new ExportModelRequest(properties); + }; + + /** + * Encodes the specified ExportModelRequest message. Does not implicitly {@link google.cloud.automl.v1.ExportModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ExportModelRequest + * @static + * @param {google.cloud.automl.v1.IExportModelRequest} message ExportModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelRequest.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.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.automl.v1.ModelExportOutputConfig.encode(message.outputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ExportModelRequest + * @static + * @param {google.cloud.automl.v1.IExportModelRequest} message ExportModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ExportModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ExportModelRequest} ExportModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExportModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.outputConfig = $root.google.cloud.automl.v1.ModelExportOutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ExportModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ExportModelRequest} ExportModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1.ExportModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportModelRequest.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.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.automl.v1.ModelExportOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ExportModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ExportModelRequest} ExportModelRequest + */ + ExportModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExportModelRequest) + return object; + var message = new $root.google.cloud.automl.v1.ExportModelRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.ExportModelRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.automl.v1.ModelExportOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ExportModelRequest + * @static + * @param {google.cloud.automl.v1.ExportModelRequest} message ExportModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.outputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.automl.v1.ModelExportOutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ExportModelRequest + * @instance + * @returns {Object.} JSON object + */ + ExportModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ExportModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ExportModelRequest"; + }; + + return ExportModelRequest; + })(); + + v1.GetModelEvaluationRequest = (function() { + + /** + * Properties of a GetModelEvaluationRequest. + * @memberof google.cloud.automl.v1 + * @interface IGetModelEvaluationRequest + * @property {string|null} [name] GetModelEvaluationRequest name + */ + + /** + * Constructs a new GetModelEvaluationRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a GetModelEvaluationRequest. + * @implements IGetModelEvaluationRequest + * @constructor + * @param {google.cloud.automl.v1.IGetModelEvaluationRequest=} [properties] Properties to set + */ + function GetModelEvaluationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetModelEvaluationRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @instance + */ + GetModelEvaluationRequest.prototype.name = ""; + + /** + * Creates a new GetModelEvaluationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {google.cloud.automl.v1.IGetModelEvaluationRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.GetModelEvaluationRequest} GetModelEvaluationRequest instance + */ + GetModelEvaluationRequest.create = function create(properties) { + return new GetModelEvaluationRequest(properties); + }; + + /** + * Encodes the specified GetModelEvaluationRequest message. Does not implicitly {@link google.cloud.automl.v1.GetModelEvaluationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {google.cloud.automl.v1.IGetModelEvaluationRequest} message GetModelEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelEvaluationRequest.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 GetModelEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetModelEvaluationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {google.cloud.automl.v1.IGetModelEvaluationRequest} message GetModelEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetModelEvaluationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.GetModelEvaluationRequest} GetModelEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelEvaluationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.GetModelEvaluationRequest(); + 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 GetModelEvaluationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.GetModelEvaluationRequest} GetModelEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetModelEvaluationRequest message. + * @function verify + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetModelEvaluationRequest.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 GetModelEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.GetModelEvaluationRequest} GetModelEvaluationRequest + */ + GetModelEvaluationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.GetModelEvaluationRequest) + return object; + var message = new $root.google.cloud.automl.v1.GetModelEvaluationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetModelEvaluationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {google.cloud.automl.v1.GetModelEvaluationRequest} message GetModelEvaluationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetModelEvaluationRequest.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 GetModelEvaluationRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @instance + * @returns {Object.} JSON object + */ + GetModelEvaluationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetModelEvaluationRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetModelEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.GetModelEvaluationRequest"; + }; + + return GetModelEvaluationRequest; + })(); + + v1.ListModelEvaluationsRequest = (function() { + + /** + * Properties of a ListModelEvaluationsRequest. + * @memberof google.cloud.automl.v1 + * @interface IListModelEvaluationsRequest + * @property {string|null} [parent] ListModelEvaluationsRequest parent + * @property {string|null} [filter] ListModelEvaluationsRequest filter + * @property {number|null} [pageSize] ListModelEvaluationsRequest pageSize + * @property {string|null} [pageToken] ListModelEvaluationsRequest pageToken + */ + + /** + * Constructs a new ListModelEvaluationsRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ListModelEvaluationsRequest. + * @implements IListModelEvaluationsRequest + * @constructor + * @param {google.cloud.automl.v1.IListModelEvaluationsRequest=} [properties] Properties to set + */ + function ListModelEvaluationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelEvaluationsRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @instance + */ + ListModelEvaluationsRequest.prototype.parent = ""; + + /** + * ListModelEvaluationsRequest filter. + * @member {string} filter + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @instance + */ + ListModelEvaluationsRequest.prototype.filter = ""; + + /** + * ListModelEvaluationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @instance + */ + ListModelEvaluationsRequest.prototype.pageSize = 0; + + /** + * ListModelEvaluationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @instance + */ + ListModelEvaluationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListModelEvaluationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @static + * @param {google.cloud.automl.v1.IListModelEvaluationsRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ListModelEvaluationsRequest} ListModelEvaluationsRequest instance + */ + ListModelEvaluationsRequest.create = function create(properties) { + return new ListModelEvaluationsRequest(properties); + }; + + /** + * Encodes the specified ListModelEvaluationsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @static + * @param {google.cloud.automl.v1.IListModelEvaluationsRequest} message ListModelEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelEvaluationsRequest.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 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListModelEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @static + * @param {google.cloud.automl.v1.IListModelEvaluationsRequest} message ListModelEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelEvaluationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ListModelEvaluationsRequest} ListModelEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelEvaluationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListModelEvaluationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ListModelEvaluationsRequest} ListModelEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelEvaluationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelEvaluationsRequest message. + * @function verify + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelEvaluationsRequest.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 ListModelEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ListModelEvaluationsRequest} ListModelEvaluationsRequest + */ + ListModelEvaluationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ListModelEvaluationsRequest) + return object; + var message = new $root.google.cloud.automl.v1.ListModelEvaluationsRequest(); + 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 ListModelEvaluationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @static + * @param {google.cloud.automl.v1.ListModelEvaluationsRequest} message ListModelEvaluationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelEvaluationsRequest.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 ListModelEvaluationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListModelEvaluationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelEvaluationsRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelEvaluationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ListModelEvaluationsRequest"; + }; + + return ListModelEvaluationsRequest; + })(); + + v1.ListModelEvaluationsResponse = (function() { + + /** + * Properties of a ListModelEvaluationsResponse. + * @memberof google.cloud.automl.v1 + * @interface IListModelEvaluationsResponse + * @property {Array.|null} [modelEvaluation] ListModelEvaluationsResponse modelEvaluation + * @property {string|null} [nextPageToken] ListModelEvaluationsResponse nextPageToken + */ + + /** + * Constructs a new ListModelEvaluationsResponse. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ListModelEvaluationsResponse. + * @implements IListModelEvaluationsResponse + * @constructor + * @param {google.cloud.automl.v1.IListModelEvaluationsResponse=} [properties] Properties to set + */ + function ListModelEvaluationsResponse(properties) { + this.modelEvaluation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelEvaluationsResponse modelEvaluation. + * @member {Array.} modelEvaluation + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @instance + */ + ListModelEvaluationsResponse.prototype.modelEvaluation = $util.emptyArray; + + /** + * ListModelEvaluationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @instance + */ + ListModelEvaluationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListModelEvaluationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @static + * @param {google.cloud.automl.v1.IListModelEvaluationsResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ListModelEvaluationsResponse} ListModelEvaluationsResponse instance + */ + ListModelEvaluationsResponse.create = function create(properties) { + return new ListModelEvaluationsResponse(properties); + }; + + /** + * Encodes the specified ListModelEvaluationsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @static + * @param {google.cloud.automl.v1.IListModelEvaluationsResponse} message ListModelEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelEvaluationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelEvaluation != null && message.modelEvaluation.length) + for (var i = 0; i < message.modelEvaluation.length; ++i) + $root.google.cloud.automl.v1.ModelEvaluation.encode(message.modelEvaluation[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 ListModelEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @static + * @param {google.cloud.automl.v1.IListModelEvaluationsResponse} message ListModelEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelEvaluationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ListModelEvaluationsResponse} ListModelEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelEvaluationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListModelEvaluationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.modelEvaluation && message.modelEvaluation.length)) + message.modelEvaluation = []; + message.modelEvaluation.push($root.google.cloud.automl.v1.ModelEvaluation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ListModelEvaluationsResponse} ListModelEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelEvaluationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelEvaluationsResponse message. + * @function verify + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelEvaluationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelEvaluation != null && message.hasOwnProperty("modelEvaluation")) { + if (!Array.isArray(message.modelEvaluation)) + return "modelEvaluation: array expected"; + for (var i = 0; i < message.modelEvaluation.length; ++i) { + var error = $root.google.cloud.automl.v1.ModelEvaluation.verify(message.modelEvaluation[i]); + if (error) + return "modelEvaluation." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListModelEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ListModelEvaluationsResponse} ListModelEvaluationsResponse + */ + ListModelEvaluationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ListModelEvaluationsResponse) + return object; + var message = new $root.google.cloud.automl.v1.ListModelEvaluationsResponse(); + if (object.modelEvaluation) { + if (!Array.isArray(object.modelEvaluation)) + throw TypeError(".google.cloud.automl.v1.ListModelEvaluationsResponse.modelEvaluation: array expected"); + message.modelEvaluation = []; + for (var i = 0; i < object.modelEvaluation.length; ++i) { + if (typeof object.modelEvaluation[i] !== "object") + throw TypeError(".google.cloud.automl.v1.ListModelEvaluationsResponse.modelEvaluation: object expected"); + message.modelEvaluation[i] = $root.google.cloud.automl.v1.ModelEvaluation.fromObject(object.modelEvaluation[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListModelEvaluationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @static + * @param {google.cloud.automl.v1.ListModelEvaluationsResponse} message ListModelEvaluationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelEvaluationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.modelEvaluation = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.modelEvaluation && message.modelEvaluation.length) { + object.modelEvaluation = []; + for (var j = 0; j < message.modelEvaluation.length; ++j) + object.modelEvaluation[j] = $root.google.cloud.automl.v1.ModelEvaluation.toObject(message.modelEvaluation[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListModelEvaluationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListModelEvaluationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelEvaluationsResponse + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelEvaluationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ListModelEvaluationsResponse"; + }; + + return ListModelEvaluationsResponse; + })(); + + return v1; + })(); + + automl.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.automl + * @namespace + */ + var v1beta1 = {}; + + v1beta1.AnnotationPayload = (function() { + + /** + * Properties of an AnnotationPayload. + * @memberof google.cloud.automl.v1beta1 + * @interface IAnnotationPayload + * @property {google.cloud.automl.v1beta1.ITranslationAnnotation|null} [translation] AnnotationPayload translation + * @property {google.cloud.automl.v1beta1.IClassificationAnnotation|null} [classification] AnnotationPayload classification + * @property {google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation|null} [imageObjectDetection] AnnotationPayload imageObjectDetection + * @property {google.cloud.automl.v1beta1.IVideoClassificationAnnotation|null} [videoClassification] AnnotationPayload videoClassification + * @property {google.cloud.automl.v1beta1.IVideoObjectTrackingAnnotation|null} [videoObjectTracking] AnnotationPayload videoObjectTracking + * @property {google.cloud.automl.v1beta1.ITextExtractionAnnotation|null} [textExtraction] AnnotationPayload textExtraction + * @property {google.cloud.automl.v1beta1.ITextSentimentAnnotation|null} [textSentiment] AnnotationPayload textSentiment + * @property {google.cloud.automl.v1beta1.ITablesAnnotation|null} [tables] AnnotationPayload tables + * @property {string|null} [annotationSpecId] AnnotationPayload annotationSpecId + * @property {string|null} [displayName] AnnotationPayload displayName + */ + + /** + * Constructs a new AnnotationPayload. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an AnnotationPayload. + * @implements IAnnotationPayload + * @constructor + * @param {google.cloud.automl.v1beta1.IAnnotationPayload=} [properties] Properties to set + */ + function AnnotationPayload(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotationPayload translation. + * @member {google.cloud.automl.v1beta1.ITranslationAnnotation|null|undefined} translation + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.translation = null; + + /** + * AnnotationPayload classification. + * @member {google.cloud.automl.v1beta1.IClassificationAnnotation|null|undefined} classification + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.classification = null; + + /** + * AnnotationPayload imageObjectDetection. + * @member {google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation|null|undefined} imageObjectDetection + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.imageObjectDetection = null; + + /** + * AnnotationPayload videoClassification. + * @member {google.cloud.automl.v1beta1.IVideoClassificationAnnotation|null|undefined} videoClassification + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.videoClassification = null; + + /** + * AnnotationPayload videoObjectTracking. + * @member {google.cloud.automl.v1beta1.IVideoObjectTrackingAnnotation|null|undefined} videoObjectTracking + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.videoObjectTracking = null; + + /** + * AnnotationPayload textExtraction. + * @member {google.cloud.automl.v1beta1.ITextExtractionAnnotation|null|undefined} textExtraction + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.textExtraction = null; + + /** + * AnnotationPayload textSentiment. + * @member {google.cloud.automl.v1beta1.ITextSentimentAnnotation|null|undefined} textSentiment + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.textSentiment = null; + + /** + * AnnotationPayload tables. + * @member {google.cloud.automl.v1beta1.ITablesAnnotation|null|undefined} tables + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.tables = null; + + /** + * AnnotationPayload annotationSpecId. + * @member {string} annotationSpecId + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.annotationSpecId = ""; + + /** + * AnnotationPayload displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.displayName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AnnotationPayload detail. + * @member {"translation"|"classification"|"imageObjectDetection"|"videoClassification"|"videoObjectTracking"|"textExtraction"|"textSentiment"|"tables"|undefined} detail + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + Object.defineProperty(AnnotationPayload.prototype, "detail", { + get: $util.oneOfGetter($oneOfFields = ["translation", "classification", "imageObjectDetection", "videoClassification", "videoObjectTracking", "textExtraction", "textSentiment", "tables"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AnnotationPayload instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @static + * @param {google.cloud.automl.v1beta1.IAnnotationPayload=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.AnnotationPayload} AnnotationPayload instance + */ + AnnotationPayload.create = function create(properties) { + return new AnnotationPayload(properties); + }; + + /** + * Encodes the specified AnnotationPayload message. Does not implicitly {@link google.cloud.automl.v1beta1.AnnotationPayload.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @static + * @param {google.cloud.automl.v1beta1.IAnnotationPayload} message AnnotationPayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationPayload.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpecId != null && Object.hasOwnProperty.call(message, "annotationSpecId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotationSpecId); + if (message.translation != null && Object.hasOwnProperty.call(message, "translation")) + $root.google.cloud.automl.v1beta1.TranslationAnnotation.encode(message.translation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.classification != null && Object.hasOwnProperty.call(message, "classification")) + $root.google.cloud.automl.v1beta1.ClassificationAnnotation.encode(message.classification, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.imageObjectDetection != null && Object.hasOwnProperty.call(message, "imageObjectDetection")) + $root.google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.encode(message.imageObjectDetection, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + if (message.textExtraction != null && Object.hasOwnProperty.call(message, "textExtraction")) + $root.google.cloud.automl.v1beta1.TextExtractionAnnotation.encode(message.textExtraction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.textSentiment != null && Object.hasOwnProperty.call(message, "textSentiment")) + $root.google.cloud.automl.v1beta1.TextSentimentAnnotation.encode(message.textSentiment, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.videoObjectTracking != null && Object.hasOwnProperty.call(message, "videoObjectTracking")) + $root.google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.encode(message.videoObjectTracking, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.videoClassification != null && Object.hasOwnProperty.call(message, "videoClassification")) + $root.google.cloud.automl.v1beta1.VideoClassificationAnnotation.encode(message.videoClassification, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.tables != null && Object.hasOwnProperty.call(message, "tables")) + $root.google.cloud.automl.v1beta1.TablesAnnotation.encode(message.tables, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotationPayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.AnnotationPayload.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @static + * @param {google.cloud.automl.v1beta1.IAnnotationPayload} message AnnotationPayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationPayload.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotationPayload message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.AnnotationPayload} AnnotationPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationPayload.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.AnnotationPayload(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.translation = $root.google.cloud.automl.v1beta1.TranslationAnnotation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.classification = $root.google.cloud.automl.v1beta1.ClassificationAnnotation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.imageObjectDetection = $root.google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.decode(reader, reader.uint32()); + break; + } + case 9: { + message.videoClassification = $root.google.cloud.automl.v1beta1.VideoClassificationAnnotation.decode(reader, reader.uint32()); + break; + } + case 8: { + message.videoObjectTracking = $root.google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.decode(reader, reader.uint32()); + break; + } + case 6: { + message.textExtraction = $root.google.cloud.automl.v1beta1.TextExtractionAnnotation.decode(reader, reader.uint32()); + break; + } + case 7: { + message.textSentiment = $root.google.cloud.automl.v1beta1.TextSentimentAnnotation.decode(reader, reader.uint32()); + break; + } + case 10: { + message.tables = $root.google.cloud.automl.v1beta1.TablesAnnotation.decode(reader, reader.uint32()); + break; + } + case 1: { + message.annotationSpecId = reader.string(); + break; + } + case 5: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotationPayload message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.AnnotationPayload} AnnotationPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationPayload.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotationPayload message. + * @function verify + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotationPayload.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.translation != null && message.hasOwnProperty("translation")) { + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1beta1.TranslationAnnotation.verify(message.translation); + if (error) + return "translation." + error; + } + } + if (message.classification != null && message.hasOwnProperty("classification")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1beta1.ClassificationAnnotation.verify(message.classification); + if (error) + return "classification." + error; + } + } + if (message.imageObjectDetection != null && message.hasOwnProperty("imageObjectDetection")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.verify(message.imageObjectDetection); + if (error) + return "imageObjectDetection." + error; + } + } + if (message.videoClassification != null && message.hasOwnProperty("videoClassification")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1beta1.VideoClassificationAnnotation.verify(message.videoClassification); + if (error) + return "videoClassification." + error; + } + } + if (message.videoObjectTracking != null && message.hasOwnProperty("videoObjectTracking")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.verify(message.videoObjectTracking); + if (error) + return "videoObjectTracking." + error; + } + } + if (message.textExtraction != null && message.hasOwnProperty("textExtraction")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextExtractionAnnotation.verify(message.textExtraction); + if (error) + return "textExtraction." + error; + } + } + if (message.textSentiment != null && message.hasOwnProperty("textSentiment")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextSentimentAnnotation.verify(message.textSentiment); + if (error) + return "textSentiment." + error; + } + } + if (message.tables != null && message.hasOwnProperty("tables")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1beta1.TablesAnnotation.verify(message.tables); + if (error) + return "tables." + error; + } + } + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + if (!$util.isString(message.annotationSpecId)) + return "annotationSpecId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates an AnnotationPayload message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.AnnotationPayload} AnnotationPayload + */ + AnnotationPayload.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.AnnotationPayload) + return object; + var message = new $root.google.cloud.automl.v1beta1.AnnotationPayload(); + if (object.translation != null) { + if (typeof object.translation !== "object") + throw TypeError(".google.cloud.automl.v1beta1.AnnotationPayload.translation: object expected"); + message.translation = $root.google.cloud.automl.v1beta1.TranslationAnnotation.fromObject(object.translation); + } + if (object.classification != null) { + if (typeof object.classification !== "object") + throw TypeError(".google.cloud.automl.v1beta1.AnnotationPayload.classification: object expected"); + message.classification = $root.google.cloud.automl.v1beta1.ClassificationAnnotation.fromObject(object.classification); + } + if (object.imageObjectDetection != null) { + if (typeof object.imageObjectDetection !== "object") + throw TypeError(".google.cloud.automl.v1beta1.AnnotationPayload.imageObjectDetection: object expected"); + message.imageObjectDetection = $root.google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.fromObject(object.imageObjectDetection); + } + if (object.videoClassification != null) { + if (typeof object.videoClassification !== "object") + throw TypeError(".google.cloud.automl.v1beta1.AnnotationPayload.videoClassification: object expected"); + message.videoClassification = $root.google.cloud.automl.v1beta1.VideoClassificationAnnotation.fromObject(object.videoClassification); + } + if (object.videoObjectTracking != null) { + if (typeof object.videoObjectTracking !== "object") + throw TypeError(".google.cloud.automl.v1beta1.AnnotationPayload.videoObjectTracking: object expected"); + message.videoObjectTracking = $root.google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.fromObject(object.videoObjectTracking); + } + if (object.textExtraction != null) { + if (typeof object.textExtraction !== "object") + throw TypeError(".google.cloud.automl.v1beta1.AnnotationPayload.textExtraction: object expected"); + message.textExtraction = $root.google.cloud.automl.v1beta1.TextExtractionAnnotation.fromObject(object.textExtraction); + } + if (object.textSentiment != null) { + if (typeof object.textSentiment !== "object") + throw TypeError(".google.cloud.automl.v1beta1.AnnotationPayload.textSentiment: object expected"); + message.textSentiment = $root.google.cloud.automl.v1beta1.TextSentimentAnnotation.fromObject(object.textSentiment); + } + if (object.tables != null) { + if (typeof object.tables !== "object") + throw TypeError(".google.cloud.automl.v1beta1.AnnotationPayload.tables: object expected"); + message.tables = $root.google.cloud.automl.v1beta1.TablesAnnotation.fromObject(object.tables); + } + if (object.annotationSpecId != null) + message.annotationSpecId = String(object.annotationSpecId); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from an AnnotationPayload message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @static + * @param {google.cloud.automl.v1beta1.AnnotationPayload} message AnnotationPayload + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotationPayload.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.annotationSpecId = ""; + object.displayName = ""; + } + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + object.annotationSpecId = message.annotationSpecId; + if (message.translation != null && message.hasOwnProperty("translation")) { + object.translation = $root.google.cloud.automl.v1beta1.TranslationAnnotation.toObject(message.translation, options); + if (options.oneofs) + object.detail = "translation"; + } + if (message.classification != null && message.hasOwnProperty("classification")) { + object.classification = $root.google.cloud.automl.v1beta1.ClassificationAnnotation.toObject(message.classification, options); + if (options.oneofs) + object.detail = "classification"; + } + if (message.imageObjectDetection != null && message.hasOwnProperty("imageObjectDetection")) { + object.imageObjectDetection = $root.google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.toObject(message.imageObjectDetection, options); + if (options.oneofs) + object.detail = "imageObjectDetection"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.textExtraction != null && message.hasOwnProperty("textExtraction")) { + object.textExtraction = $root.google.cloud.automl.v1beta1.TextExtractionAnnotation.toObject(message.textExtraction, options); + if (options.oneofs) + object.detail = "textExtraction"; + } + if (message.textSentiment != null && message.hasOwnProperty("textSentiment")) { + object.textSentiment = $root.google.cloud.automl.v1beta1.TextSentimentAnnotation.toObject(message.textSentiment, options); + if (options.oneofs) + object.detail = "textSentiment"; + } + if (message.videoObjectTracking != null && message.hasOwnProperty("videoObjectTracking")) { + object.videoObjectTracking = $root.google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.toObject(message.videoObjectTracking, options); + if (options.oneofs) + object.detail = "videoObjectTracking"; + } + if (message.videoClassification != null && message.hasOwnProperty("videoClassification")) { + object.videoClassification = $root.google.cloud.automl.v1beta1.VideoClassificationAnnotation.toObject(message.videoClassification, options); + if (options.oneofs) + object.detail = "videoClassification"; + } + if (message.tables != null && message.hasOwnProperty("tables")) { + object.tables = $root.google.cloud.automl.v1beta1.TablesAnnotation.toObject(message.tables, options); + if (options.oneofs) + object.detail = "tables"; + } + return object; + }; + + /** + * Converts this AnnotationPayload to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + * @returns {Object.} JSON object + */ + AnnotationPayload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotationPayload + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotationPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.AnnotationPayload"; + }; + + return AnnotationPayload; + })(); + + /** + * ClassificationType enum. + * @name google.cloud.automl.v1beta1.ClassificationType + * @enum {number} + * @property {number} CLASSIFICATION_TYPE_UNSPECIFIED=0 CLASSIFICATION_TYPE_UNSPECIFIED value + * @property {number} MULTICLASS=1 MULTICLASS value + * @property {number} MULTILABEL=2 MULTILABEL value + */ + v1beta1.ClassificationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLASSIFICATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MULTICLASS"] = 1; + values[valuesById[2] = "MULTILABEL"] = 2; + return values; + })(); + + v1beta1.ClassificationAnnotation = (function() { + + /** + * Properties of a ClassificationAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @interface IClassificationAnnotation + * @property {number|null} [score] ClassificationAnnotation score + */ + + /** + * Constructs a new ClassificationAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ClassificationAnnotation. + * @implements IClassificationAnnotation + * @constructor + * @param {google.cloud.automl.v1beta1.IClassificationAnnotation=} [properties] Properties to set + */ + function ClassificationAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClassificationAnnotation score. + * @member {number} score + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @instance + */ + ClassificationAnnotation.prototype.score = 0; + + /** + * Creates a new ClassificationAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.IClassificationAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ClassificationAnnotation} ClassificationAnnotation instance + */ + ClassificationAnnotation.create = function create(properties) { + return new ClassificationAnnotation(properties); + }; + + /** + * Encodes the specified ClassificationAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.IClassificationAnnotation} message ClassificationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationAnnotation.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); + return writer; + }; + + /** + * Encodes the specified ClassificationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.IClassificationAnnotation} message ClassificationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassificationAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ClassificationAnnotation} ClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ClassificationAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassificationAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ClassificationAnnotation} ClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassificationAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassificationAnnotation.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"; + return null; + }; + + /** + * Creates a ClassificationAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ClassificationAnnotation} ClassificationAnnotation + */ + ClassificationAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ClassificationAnnotation) + return object; + var message = new $root.google.cloud.automl.v1beta1.ClassificationAnnotation(); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a ClassificationAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ClassificationAnnotation} message ClassificationAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassificationAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.score = 0; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this ClassificationAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @instance + * @returns {Object.} JSON object + */ + ClassificationAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassificationAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassificationAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ClassificationAnnotation"; + }; + + return ClassificationAnnotation; + })(); + + v1beta1.VideoClassificationAnnotation = (function() { + + /** + * Properties of a VideoClassificationAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @interface IVideoClassificationAnnotation + * @property {string|null} [type] VideoClassificationAnnotation type + * @property {google.cloud.automl.v1beta1.IClassificationAnnotation|null} [classificationAnnotation] VideoClassificationAnnotation classificationAnnotation + * @property {google.cloud.automl.v1beta1.ITimeSegment|null} [timeSegment] VideoClassificationAnnotation timeSegment + */ + + /** + * Constructs a new VideoClassificationAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a VideoClassificationAnnotation. + * @implements IVideoClassificationAnnotation + * @constructor + * @param {google.cloud.automl.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 type. + * @member {string} type + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @instance + */ + VideoClassificationAnnotation.prototype.type = ""; + + /** + * VideoClassificationAnnotation classificationAnnotation. + * @member {google.cloud.automl.v1beta1.IClassificationAnnotation|null|undefined} classificationAnnotation + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @instance + */ + VideoClassificationAnnotation.prototype.classificationAnnotation = null; + + /** + * VideoClassificationAnnotation timeSegment. + * @member {google.cloud.automl.v1beta1.ITimeSegment|null|undefined} timeSegment + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @instance + */ + VideoClassificationAnnotation.prototype.timeSegment = null; + + /** + * Creates a new VideoClassificationAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.IVideoClassificationAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.VideoClassificationAnnotation} VideoClassificationAnnotation instance + */ + VideoClassificationAnnotation.create = function create(properties) { + return new VideoClassificationAnnotation(properties); + }; + + /** + * Encodes the specified VideoClassificationAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @static + * @param {google.cloud.automl.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.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.classificationAnnotation != null && Object.hasOwnProperty.call(message, "classificationAnnotation")) + $root.google.cloud.automl.v1beta1.ClassificationAnnotation.encode(message.classificationAnnotation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.timeSegment != null && Object.hasOwnProperty.call(message, "timeSegment")) + $root.google.cloud.automl.v1beta1.TimeSegment.encode(message.timeSegment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoClassificationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.VideoClassificationAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.classificationAnnotation = $root.google.cloud.automl.v1beta1.ClassificationAnnotation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.timeSegment = $root.google.cloud.automl.v1beta1.TimeSegment.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.automl.v1beta1.VideoClassificationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.classificationAnnotation != null && message.hasOwnProperty("classificationAnnotation")) { + var error = $root.google.cloud.automl.v1beta1.ClassificationAnnotation.verify(message.classificationAnnotation); + if (error) + return "classificationAnnotation." + error; + } + if (message.timeSegment != null && message.hasOwnProperty("timeSegment")) { + var error = $root.google.cloud.automl.v1beta1.TimeSegment.verify(message.timeSegment); + if (error) + return "timeSegment." + error; + } + return null; + }; + + /** + * Creates a VideoClassificationAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.VideoClassificationAnnotation} VideoClassificationAnnotation + */ + VideoClassificationAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.VideoClassificationAnnotation) + return object; + var message = new $root.google.cloud.automl.v1beta1.VideoClassificationAnnotation(); + if (object.type != null) + message.type = String(object.type); + if (object.classificationAnnotation != null) { + if (typeof object.classificationAnnotation !== "object") + throw TypeError(".google.cloud.automl.v1beta1.VideoClassificationAnnotation.classificationAnnotation: object expected"); + message.classificationAnnotation = $root.google.cloud.automl.v1beta1.ClassificationAnnotation.fromObject(object.classificationAnnotation); + } + if (object.timeSegment != null) { + if (typeof object.timeSegment !== "object") + throw TypeError(".google.cloud.automl.v1beta1.VideoClassificationAnnotation.timeSegment: object expected"); + message.timeSegment = $root.google.cloud.automl.v1beta1.TimeSegment.fromObject(object.timeSegment); + } + return message; + }; + + /** + * Creates a plain object from a VideoClassificationAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @static + * @param {google.cloud.automl.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.type = ""; + object.classificationAnnotation = null; + object.timeSegment = null; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.classificationAnnotation != null && message.hasOwnProperty("classificationAnnotation")) + object.classificationAnnotation = $root.google.cloud.automl.v1beta1.ClassificationAnnotation.toObject(message.classificationAnnotation, options); + if (message.timeSegment != null && message.hasOwnProperty("timeSegment")) + object.timeSegment = $root.google.cloud.automl.v1beta1.TimeSegment.toObject(message.timeSegment, options); + return object; + }; + + /** + * Converts this VideoClassificationAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.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.automl.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.automl.v1beta1.VideoClassificationAnnotation"; + }; + + return VideoClassificationAnnotation; + })(); + + v1beta1.ClassificationEvaluationMetrics = (function() { + + /** + * Properties of a ClassificationEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @interface IClassificationEvaluationMetrics + * @property {number|null} [auPrc] ClassificationEvaluationMetrics auPrc + * @property {number|null} [baseAuPrc] ClassificationEvaluationMetrics baseAuPrc + * @property {number|null} [auRoc] ClassificationEvaluationMetrics auRoc + * @property {number|null} [logLoss] ClassificationEvaluationMetrics logLoss + * @property {Array.|null} [confidenceMetricsEntry] ClassificationEvaluationMetrics confidenceMetricsEntry + * @property {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix|null} [confusionMatrix] ClassificationEvaluationMetrics confusionMatrix + * @property {Array.|null} [annotationSpecId] ClassificationEvaluationMetrics annotationSpecId + */ + + /** + * Constructs a new ClassificationEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ClassificationEvaluationMetrics. + * @implements IClassificationEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1beta1.IClassificationEvaluationMetrics=} [properties] Properties to set + */ + function ClassificationEvaluationMetrics(properties) { + this.confidenceMetricsEntry = []; + this.annotationSpecId = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClassificationEvaluationMetrics auPrc. + * @member {number} auPrc + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.auPrc = 0; + + /** + * ClassificationEvaluationMetrics baseAuPrc. + * @member {number} baseAuPrc + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.baseAuPrc = 0; + + /** + * ClassificationEvaluationMetrics auRoc. + * @member {number} auRoc + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.auRoc = 0; + + /** + * ClassificationEvaluationMetrics logLoss. + * @member {number} logLoss + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.logLoss = 0; + + /** + * ClassificationEvaluationMetrics confidenceMetricsEntry. + * @member {Array.} confidenceMetricsEntry + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.confidenceMetricsEntry = $util.emptyArray; + + /** + * ClassificationEvaluationMetrics confusionMatrix. + * @member {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix|null|undefined} confusionMatrix + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.confusionMatrix = null; + + /** + * ClassificationEvaluationMetrics annotationSpecId. + * @member {Array.} annotationSpecId + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.annotationSpecId = $util.emptyArray; + + /** + * Creates a new ClassificationEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IClassificationEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics} ClassificationEvaluationMetrics instance + */ + ClassificationEvaluationMetrics.create = function create(properties) { + return new ClassificationEvaluationMetrics(properties); + }; + + /** + * Encodes the specified ClassificationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IClassificationEvaluationMetrics} message ClassificationEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.auPrc != null && Object.hasOwnProperty.call(message, "auPrc")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.auPrc); + if (message.baseAuPrc != null && Object.hasOwnProperty.call(message, "baseAuPrc")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.baseAuPrc); + if (message.confidenceMetricsEntry != null && message.confidenceMetricsEntry.length) + for (var i = 0; i < message.confidenceMetricsEntry.length; ++i) + $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.encode(message.confidenceMetricsEntry[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confusionMatrix != null && Object.hasOwnProperty.call(message, "confusionMatrix")) + $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.encode(message.confusionMatrix, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.annotationSpecId != null && message.annotationSpecId.length) + for (var i = 0; i < message.annotationSpecId.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.annotationSpecId[i]); + if (message.auRoc != null && Object.hasOwnProperty.call(message, "auRoc")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.auRoc); + if (message.logLoss != null && Object.hasOwnProperty.call(message, "logLoss")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.logLoss); + return writer; + }; + + /** + * Encodes the specified ClassificationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IClassificationEvaluationMetrics} message ClassificationEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassificationEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics} ClassificationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.auPrc = reader.float(); + break; + } + case 2: { + message.baseAuPrc = reader.float(); + break; + } + case 6: { + message.auRoc = reader.float(); + break; + } + case 7: { + message.logLoss = reader.float(); + break; + } + case 3: { + if (!(message.confidenceMetricsEntry && message.confidenceMetricsEntry.length)) + message.confidenceMetricsEntry = []; + message.confidenceMetricsEntry.push($root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.decode(reader, reader.uint32())); + break; + } + case 4: { + message.confusionMatrix = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.annotationSpecId && message.annotationSpecId.length)) + message.annotationSpecId = []; + message.annotationSpecId.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassificationEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics} ClassificationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassificationEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassificationEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + if (typeof message.auPrc !== "number") + return "auPrc: number expected"; + if (message.baseAuPrc != null && message.hasOwnProperty("baseAuPrc")) + if (typeof message.baseAuPrc !== "number") + return "baseAuPrc: number expected"; + if (message.auRoc != null && message.hasOwnProperty("auRoc")) + if (typeof message.auRoc !== "number") + return "auRoc: number expected"; + if (message.logLoss != null && message.hasOwnProperty("logLoss")) + if (typeof message.logLoss !== "number") + return "logLoss: number expected"; + if (message.confidenceMetricsEntry != null && message.hasOwnProperty("confidenceMetricsEntry")) { + if (!Array.isArray(message.confidenceMetricsEntry)) + return "confidenceMetricsEntry: array expected"; + for (var i = 0; i < message.confidenceMetricsEntry.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify(message.confidenceMetricsEntry[i]); + if (error) + return "confidenceMetricsEntry." + error; + } + } + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) { + var error = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.verify(message.confusionMatrix); + if (error) + return "confusionMatrix." + error; + } + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) { + if (!Array.isArray(message.annotationSpecId)) + return "annotationSpecId: array expected"; + for (var i = 0; i < message.annotationSpecId.length; ++i) + if (!$util.isString(message.annotationSpecId[i])) + return "annotationSpecId: string[] expected"; + } + return null; + }; + + /** + * Creates a ClassificationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics} ClassificationEvaluationMetrics + */ + ClassificationEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics(); + if (object.auPrc != null) + message.auPrc = Number(object.auPrc); + if (object.baseAuPrc != null) + message.baseAuPrc = Number(object.baseAuPrc); + if (object.auRoc != null) + message.auRoc = Number(object.auRoc); + if (object.logLoss != null) + message.logLoss = Number(object.logLoss); + if (object.confidenceMetricsEntry) { + if (!Array.isArray(object.confidenceMetricsEntry)) + throw TypeError(".google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.confidenceMetricsEntry: array expected"); + message.confidenceMetricsEntry = []; + for (var i = 0; i < object.confidenceMetricsEntry.length; ++i) { + if (typeof object.confidenceMetricsEntry[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.confidenceMetricsEntry: object expected"); + message.confidenceMetricsEntry[i] = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.fromObject(object.confidenceMetricsEntry[i]); + } + } + if (object.confusionMatrix != null) { + if (typeof object.confusionMatrix !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.confusionMatrix: object expected"); + message.confusionMatrix = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.fromObject(object.confusionMatrix); + } + if (object.annotationSpecId) { + if (!Array.isArray(object.annotationSpecId)) + throw TypeError(".google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.annotationSpecId: array expected"); + message.annotationSpecId = []; + for (var i = 0; i < object.annotationSpecId.length; ++i) + message.annotationSpecId[i] = String(object.annotationSpecId[i]); + } + return message; + }; + + /** + * Creates a plain object from a ClassificationEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics} message ClassificationEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassificationEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.confidenceMetricsEntry = []; + object.annotationSpecId = []; + } + if (options.defaults) { + object.auPrc = 0; + object.baseAuPrc = 0; + object.confusionMatrix = null; + object.auRoc = 0; + object.logLoss = 0; + } + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + object.auPrc = options.json && !isFinite(message.auPrc) ? String(message.auPrc) : message.auPrc; + if (message.baseAuPrc != null && message.hasOwnProperty("baseAuPrc")) + object.baseAuPrc = options.json && !isFinite(message.baseAuPrc) ? String(message.baseAuPrc) : message.baseAuPrc; + if (message.confidenceMetricsEntry && message.confidenceMetricsEntry.length) { + object.confidenceMetricsEntry = []; + for (var j = 0; j < message.confidenceMetricsEntry.length; ++j) + object.confidenceMetricsEntry[j] = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.toObject(message.confidenceMetricsEntry[j], options); + } + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) + object.confusionMatrix = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.toObject(message.confusionMatrix, options); + if (message.annotationSpecId && message.annotationSpecId.length) { + object.annotationSpecId = []; + for (var j = 0; j < message.annotationSpecId.length; ++j) + object.annotationSpecId[j] = message.annotationSpecId[j]; + } + if (message.auRoc != null && message.hasOwnProperty("auRoc")) + object.auRoc = options.json && !isFinite(message.auRoc) ? String(message.auRoc) : message.auRoc; + if (message.logLoss != null && message.hasOwnProperty("logLoss")) + object.logLoss = options.json && !isFinite(message.logLoss) ? String(message.logLoss) : message.logLoss; + return object; + }; + + /** + * Converts this ClassificationEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + ClassificationEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassificationEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassificationEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ClassificationEvaluationMetrics"; + }; + + ClassificationEvaluationMetrics.ConfidenceMetricsEntry = (function() { + + /** + * Properties of a ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @interface IConfidenceMetricsEntry + * @property {number|null} [confidenceThreshold] ConfidenceMetricsEntry confidenceThreshold + * @property {number|null} [positionThreshold] ConfidenceMetricsEntry positionThreshold + * @property {number|null} [recall] ConfidenceMetricsEntry recall + * @property {number|null} [precision] ConfidenceMetricsEntry precision + * @property {number|null} [falsePositiveRate] ConfidenceMetricsEntry falsePositiveRate + * @property {number|null} [f1Score] ConfidenceMetricsEntry f1Score + * @property {number|null} [recallAt1] ConfidenceMetricsEntry recallAt1 + * @property {number|null} [precisionAt1] ConfidenceMetricsEntry precisionAt1 + * @property {number|null} [falsePositiveRateAt1] ConfidenceMetricsEntry falsePositiveRateAt1 + * @property {number|null} [f1ScoreAt1] ConfidenceMetricsEntry f1ScoreAt1 + * @property {number|Long|null} [truePositiveCount] ConfidenceMetricsEntry truePositiveCount + * @property {number|Long|null} [falsePositiveCount] ConfidenceMetricsEntry falsePositiveCount + * @property {number|Long|null} [falseNegativeCount] ConfidenceMetricsEntry falseNegativeCount + * @property {number|Long|null} [trueNegativeCount] ConfidenceMetricsEntry trueNegativeCount + */ + + /** + * Constructs a new ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @classdesc Represents a ConfidenceMetricsEntry. + * @implements IConfidenceMetricsEntry + * @constructor + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.confidenceThreshold = 0; + + /** + * ConfidenceMetricsEntry positionThreshold. + * @member {number} positionThreshold + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.positionThreshold = 0; + + /** + * ConfidenceMetricsEntry recall. + * @member {number} recall + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recall = 0; + + /** + * ConfidenceMetricsEntry precision. + * @member {number} precision + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precision = 0; + + /** + * ConfidenceMetricsEntry falsePositiveRate. + * @member {number} falsePositiveRate + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.falsePositiveRate = 0; + + /** + * ConfidenceMetricsEntry f1Score. + * @member {number} f1Score + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1Score = 0; + + /** + * ConfidenceMetricsEntry recallAt1. + * @member {number} recallAt1 + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recallAt1 = 0; + + /** + * ConfidenceMetricsEntry precisionAt1. + * @member {number} precisionAt1 + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precisionAt1 = 0; + + /** + * ConfidenceMetricsEntry falsePositiveRateAt1. + * @member {number} falsePositiveRateAt1 + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.falsePositiveRateAt1 = 0; + + /** + * ConfidenceMetricsEntry f1ScoreAt1. + * @member {number} f1ScoreAt1 + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1ScoreAt1 = 0; + + /** + * ConfidenceMetricsEntry truePositiveCount. + * @member {number|Long} truePositiveCount + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.truePositiveCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ConfidenceMetricsEntry falsePositiveCount. + * @member {number|Long} falsePositiveCount + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.falsePositiveCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ConfidenceMetricsEntry falseNegativeCount. + * @member {number|Long} falseNegativeCount + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.falseNegativeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ConfidenceMetricsEntry trueNegativeCount. + * @member {number|Long} trueNegativeCount + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.trueNegativeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry instance + */ + ConfidenceMetricsEntry.create = function create(properties) { + return new ConfidenceMetricsEntry(properties); + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.falsePositiveRate != null && Object.hasOwnProperty.call(message, "falsePositiveRate")) + writer.uint32(/* id 8, wireType 5 =*/69).float(message.falsePositiveRate); + if (message.falsePositiveRateAt1 != null && Object.hasOwnProperty.call(message, "falsePositiveRateAt1")) + writer.uint32(/* id 9, wireType 5 =*/77).float(message.falsePositiveRateAt1); + if (message.truePositiveCount != null && Object.hasOwnProperty.call(message, "truePositiveCount")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.truePositiveCount); + if (message.falsePositiveCount != null && Object.hasOwnProperty.call(message, "falsePositiveCount")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.falsePositiveCount); + if (message.falseNegativeCount != null && Object.hasOwnProperty.call(message, "falseNegativeCount")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.falseNegativeCount); + if (message.trueNegativeCount != null && Object.hasOwnProperty.call(message, "trueNegativeCount")) + writer.uint32(/* id 13, wireType 0 =*/104).int64(message.trueNegativeCount); + if (message.positionThreshold != null && Object.hasOwnProperty.call(message, "positionThreshold")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.positionThreshold); + return writer; + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.confidenceThreshold = reader.float(); + break; + } + case 14: { + message.positionThreshold = reader.int32(); + break; + } + case 2: { + message.recall = reader.float(); + break; + } + case 3: { + message.precision = reader.float(); + break; + } + case 8: { + message.falsePositiveRate = 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 9: { + message.falsePositiveRateAt1 = reader.float(); + break; + } + case 7: { + message.f1ScoreAt1 = reader.float(); + break; + } + case 10: { + message.truePositiveCount = reader.int64(); + break; + } + case 11: { + message.falsePositiveCount = reader.int64(); + break; + } + case 12: { + message.falseNegativeCount = reader.int64(); + break; + } + case 13: { + message.trueNegativeCount = reader.int64(); + 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.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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.positionThreshold != null && message.hasOwnProperty("positionThreshold")) + if (!$util.isInteger(message.positionThreshold)) + return "positionThreshold: integer 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.falsePositiveRate != null && message.hasOwnProperty("falsePositiveRate")) + if (typeof message.falsePositiveRate !== "number") + return "falsePositiveRate: 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.falsePositiveRateAt1 != null && message.hasOwnProperty("falsePositiveRateAt1")) + if (typeof message.falsePositiveRateAt1 !== "number") + return "falsePositiveRateAt1: number expected"; + if (message.f1ScoreAt1 != null && message.hasOwnProperty("f1ScoreAt1")) + if (typeof message.f1ScoreAt1 !== "number") + return "f1ScoreAt1: number expected"; + if (message.truePositiveCount != null && message.hasOwnProperty("truePositiveCount")) + if (!$util.isInteger(message.truePositiveCount) && !(message.truePositiveCount && $util.isInteger(message.truePositiveCount.low) && $util.isInteger(message.truePositiveCount.high))) + return "truePositiveCount: integer|Long expected"; + if (message.falsePositiveCount != null && message.hasOwnProperty("falsePositiveCount")) + if (!$util.isInteger(message.falsePositiveCount) && !(message.falsePositiveCount && $util.isInteger(message.falsePositiveCount.low) && $util.isInteger(message.falsePositiveCount.high))) + return "falsePositiveCount: integer|Long expected"; + if (message.falseNegativeCount != null && message.hasOwnProperty("falseNegativeCount")) + if (!$util.isInteger(message.falseNegativeCount) && !(message.falseNegativeCount && $util.isInteger(message.falseNegativeCount.low) && $util.isInteger(message.falseNegativeCount.high))) + return "falseNegativeCount: integer|Long expected"; + if (message.trueNegativeCount != null && message.hasOwnProperty("trueNegativeCount")) + if (!$util.isInteger(message.trueNegativeCount) && !(message.trueNegativeCount && $util.isInteger(message.trueNegativeCount.low) && $util.isInteger(message.trueNegativeCount.high))) + return "trueNegativeCount: integer|Long expected"; + return null; + }; + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + */ + ConfidenceMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) + return object; + var message = new $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry(); + if (object.confidenceThreshold != null) + message.confidenceThreshold = Number(object.confidenceThreshold); + if (object.positionThreshold != null) + message.positionThreshold = object.positionThreshold | 0; + if (object.recall != null) + message.recall = Number(object.recall); + if (object.precision != null) + message.precision = Number(object.precision); + if (object.falsePositiveRate != null) + message.falsePositiveRate = Number(object.falsePositiveRate); + 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.falsePositiveRateAt1 != null) + message.falsePositiveRateAt1 = Number(object.falsePositiveRateAt1); + if (object.f1ScoreAt1 != null) + message.f1ScoreAt1 = Number(object.f1ScoreAt1); + if (object.truePositiveCount != null) + if ($util.Long) + (message.truePositiveCount = $util.Long.fromValue(object.truePositiveCount)).unsigned = false; + else if (typeof object.truePositiveCount === "string") + message.truePositiveCount = parseInt(object.truePositiveCount, 10); + else if (typeof object.truePositiveCount === "number") + message.truePositiveCount = object.truePositiveCount; + else if (typeof object.truePositiveCount === "object") + message.truePositiveCount = new $util.LongBits(object.truePositiveCount.low >>> 0, object.truePositiveCount.high >>> 0).toNumber(); + if (object.falsePositiveCount != null) + if ($util.Long) + (message.falsePositiveCount = $util.Long.fromValue(object.falsePositiveCount)).unsigned = false; + else if (typeof object.falsePositiveCount === "string") + message.falsePositiveCount = parseInt(object.falsePositiveCount, 10); + else if (typeof object.falsePositiveCount === "number") + message.falsePositiveCount = object.falsePositiveCount; + else if (typeof object.falsePositiveCount === "object") + message.falsePositiveCount = new $util.LongBits(object.falsePositiveCount.low >>> 0, object.falsePositiveCount.high >>> 0).toNumber(); + if (object.falseNegativeCount != null) + if ($util.Long) + (message.falseNegativeCount = $util.Long.fromValue(object.falseNegativeCount)).unsigned = false; + else if (typeof object.falseNegativeCount === "string") + message.falseNegativeCount = parseInt(object.falseNegativeCount, 10); + else if (typeof object.falseNegativeCount === "number") + message.falseNegativeCount = object.falseNegativeCount; + else if (typeof object.falseNegativeCount === "object") + message.falseNegativeCount = new $util.LongBits(object.falseNegativeCount.low >>> 0, object.falseNegativeCount.high >>> 0).toNumber(); + if (object.trueNegativeCount != null) + if ($util.Long) + (message.trueNegativeCount = $util.Long.fromValue(object.trueNegativeCount)).unsigned = false; + else if (typeof object.trueNegativeCount === "string") + message.trueNegativeCount = parseInt(object.trueNegativeCount, 10); + else if (typeof object.trueNegativeCount === "number") + message.trueNegativeCount = object.trueNegativeCount; + else if (typeof object.trueNegativeCount === "object") + message.trueNegativeCount = new $util.LongBits(object.trueNegativeCount.low >>> 0, object.trueNegativeCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.falsePositiveRate = 0; + object.falsePositiveRateAt1 = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.truePositiveCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.truePositiveCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.falsePositiveCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.falsePositiveCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.falseNegativeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.falseNegativeCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trueNegativeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trueNegativeCount = options.longs === String ? "0" : 0; + object.positionThreshold = 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.falsePositiveRate != null && message.hasOwnProperty("falsePositiveRate")) + object.falsePositiveRate = options.json && !isFinite(message.falsePositiveRate) ? String(message.falsePositiveRate) : message.falsePositiveRate; + if (message.falsePositiveRateAt1 != null && message.hasOwnProperty("falsePositiveRateAt1")) + object.falsePositiveRateAt1 = options.json && !isFinite(message.falsePositiveRateAt1) ? String(message.falsePositiveRateAt1) : message.falsePositiveRateAt1; + if (message.truePositiveCount != null && message.hasOwnProperty("truePositiveCount")) + if (typeof message.truePositiveCount === "number") + object.truePositiveCount = options.longs === String ? String(message.truePositiveCount) : message.truePositiveCount; + else + object.truePositiveCount = options.longs === String ? $util.Long.prototype.toString.call(message.truePositiveCount) : options.longs === Number ? new $util.LongBits(message.truePositiveCount.low >>> 0, message.truePositiveCount.high >>> 0).toNumber() : message.truePositiveCount; + if (message.falsePositiveCount != null && message.hasOwnProperty("falsePositiveCount")) + if (typeof message.falsePositiveCount === "number") + object.falsePositiveCount = options.longs === String ? String(message.falsePositiveCount) : message.falsePositiveCount; + else + object.falsePositiveCount = options.longs === String ? $util.Long.prototype.toString.call(message.falsePositiveCount) : options.longs === Number ? new $util.LongBits(message.falsePositiveCount.low >>> 0, message.falsePositiveCount.high >>> 0).toNumber() : message.falsePositiveCount; + if (message.falseNegativeCount != null && message.hasOwnProperty("falseNegativeCount")) + if (typeof message.falseNegativeCount === "number") + object.falseNegativeCount = options.longs === String ? String(message.falseNegativeCount) : message.falseNegativeCount; + else + object.falseNegativeCount = options.longs === String ? $util.Long.prototype.toString.call(message.falseNegativeCount) : options.longs === Number ? new $util.LongBits(message.falseNegativeCount.low >>> 0, message.falseNegativeCount.high >>> 0).toNumber() : message.falseNegativeCount; + if (message.trueNegativeCount != null && message.hasOwnProperty("trueNegativeCount")) + if (typeof message.trueNegativeCount === "number") + object.trueNegativeCount = options.longs === String ? String(message.trueNegativeCount) : message.trueNegativeCount; + else + object.trueNegativeCount = options.longs === String ? $util.Long.prototype.toString.call(message.trueNegativeCount) : options.longs === Number ? new $util.LongBits(message.trueNegativeCount.low >>> 0, message.trueNegativeCount.high >>> 0).toNumber() : message.trueNegativeCount; + if (message.positionThreshold != null && message.hasOwnProperty("positionThreshold")) + object.positionThreshold = message.positionThreshold; + return object; + }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry"; + }; + + return ConfidenceMetricsEntry; + })(); + + ClassificationEvaluationMetrics.ConfusionMatrix = (function() { + + /** + * Properties of a ConfusionMatrix. + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @interface IConfusionMatrix + * @property {Array.|null} [annotationSpecId] ConfusionMatrix annotationSpecId + * @property {Array.|null} [displayName] ConfusionMatrix displayName + * @property {Array.|null} [row] ConfusionMatrix row + */ + + /** + * Constructs a new ConfusionMatrix. + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @classdesc Represents a ConfusionMatrix. + * @implements IConfusionMatrix + * @constructor + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix=} [properties] Properties to set + */ + function ConfusionMatrix(properties) { + this.annotationSpecId = []; + this.displayName = []; + 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 annotationSpecId. + * @member {Array.} annotationSpecId + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @instance + */ + ConfusionMatrix.prototype.annotationSpecId = $util.emptyArray; + + /** + * ConfusionMatrix displayName. + * @member {Array.} displayName + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @instance + */ + ConfusionMatrix.prototype.displayName = $util.emptyArray; + + /** + * ConfusionMatrix row. + * @member {Array.} row + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @instance + */ + ConfusionMatrix.prototype.row = $util.emptyArray; + + /** + * Creates a new ConfusionMatrix instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix} ConfusionMatrix instance + */ + ConfusionMatrix.create = function create(properties) { + return new ConfusionMatrix(properties); + }; + + /** + * Encodes the specified ConfusionMatrix message. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.annotationSpecId != null && message.annotationSpecId.length) + for (var i = 0; i < message.annotationSpecId.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotationSpecId[i]); + if (message.row != null && message.row.length) + for (var i = 0; i < message.row.length; ++i) + $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.encode(message.row[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.displayName != null && message.displayName.length) + for (var i = 0; i < message.displayName.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName[i]); + return writer; + }; + + /** + * Encodes the specified ConfusionMatrix message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotationSpecId && message.annotationSpecId.length)) + message.annotationSpecId = []; + message.annotationSpecId.push(reader.string()); + break; + } + case 3: { + if (!(message.displayName && message.displayName.length)) + message.displayName = []; + message.displayName.push(reader.string()); + break; + } + case 2: { + if (!(message.row && message.row.length)) + message.row = []; + message.row.push($root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) { + if (!Array.isArray(message.annotationSpecId)) + return "annotationSpecId: array expected"; + for (var i = 0; i < message.annotationSpecId.length; ++i) + if (!$util.isString(message.annotationSpecId[i])) + return "annotationSpecId: string[] expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) { + if (!Array.isArray(message.displayName)) + return "displayName: array expected"; + for (var i = 0; i < message.displayName.length; ++i) + if (!$util.isString(message.displayName[i])) + return "displayName: string[] 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.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix} ConfusionMatrix + */ + ConfusionMatrix.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix) + return object; + var message = new $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix(); + if (object.annotationSpecId) { + if (!Array.isArray(object.annotationSpecId)) + throw TypeError(".google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.annotationSpecId: array expected"); + message.annotationSpecId = []; + for (var i = 0; i < object.annotationSpecId.length; ++i) + message.annotationSpecId[i] = String(object.annotationSpecId[i]); + } + if (object.displayName) { + if (!Array.isArray(object.displayName)) + throw TypeError(".google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.displayName: array expected"); + message.displayName = []; + for (var i = 0; i < object.displayName.length; ++i) + message.displayName[i] = String(object.displayName[i]); + } + if (object.row) { + if (!Array.isArray(object.row)) + throw TypeError(".google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.row: object expected"); + message.row[i] = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.annotationSpecId = []; + object.row = []; + object.displayName = []; + } + if (message.annotationSpecId && message.annotationSpecId.length) { + object.annotationSpecId = []; + for (var j = 0; j < message.annotationSpecId.length; ++j) + object.annotationSpecId[j] = message.annotationSpecId[j]; + } + if (message.row && message.row.length) { + object.row = []; + for (var j = 0; j < message.row.length; ++j) + object.row[j] = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.toObject(message.row[j], options); + } + if (message.displayName && message.displayName.length) { + object.displayName = []; + for (var j = 0; j < message.displayName.length; ++j) + object.displayName[j] = message.displayName[j]; + } + return object; + }; + + /** + * Converts this ConfusionMatrix to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix"; + }; + + ConfusionMatrix.Row = (function() { + + /** + * Properties of a Row. + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @interface IRow + * @property {Array.|null} [exampleCount] Row exampleCount + */ + + /** + * Constructs a new Row. + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @classdesc Represents a Row. + * @implements IRow + * @constructor + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow=} [properties] Properties to set + */ + function Row(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]]; + } + + /** + * Row exampleCount. + * @member {Array.} exampleCount + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @instance + */ + Row.prototype.exampleCount = $util.emptyArray; + + /** + * Creates a new Row instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} Row instance + */ + Row.create = function create(properties) { + return new Row(properties); + }; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.exampleCount != null && message.exampleCount.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.exampleCount.length; ++i) + writer.int32(message.exampleCount[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.exampleCount && message.exampleCount.length)) + message.exampleCount = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.exampleCount.push(reader.int32()); + } else + message.exampleCount.push(reader.int32()); + 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.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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.exampleCount != null && message.hasOwnProperty("exampleCount")) { + if (!Array.isArray(message.exampleCount)) + return "exampleCount: array expected"; + for (var i = 0; i < message.exampleCount.length; ++i) + if (!$util.isInteger(message.exampleCount[i])) + return "exampleCount: integer[] expected"; + } + return null; + }; + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} Row + */ + Row.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) + return object; + var message = new $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row(); + if (object.exampleCount) { + if (!Array.isArray(object.exampleCount)) + throw TypeError(".google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.exampleCount: array expected"); + message.exampleCount = []; + for (var i = 0; i < object.exampleCount.length; ++i) + message.exampleCount[i] = object.exampleCount[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.exampleCount = []; + if (message.exampleCount && message.exampleCount.length) { + object.exampleCount = []; + for (var j = 0; j < message.exampleCount.length; ++j) + object.exampleCount[j] = message.exampleCount[j]; + } + return object; + }; + + /** + * Converts this Row to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.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.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row"; + }; + + return Row; + })(); + + return ConfusionMatrix; + })(); + + return ClassificationEvaluationMetrics; + })(); + + v1beta1.TimeSegment = (function() { + + /** + * Properties of a TimeSegment. + * @memberof google.cloud.automl.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.automl.v1beta1 + * @classdesc Represents a TimeSegment. + * @implements ITimeSegment + * @constructor + * @param {google.cloud.automl.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.automl.v1beta1.TimeSegment + * @instance + */ + TimeSegment.prototype.startTimeOffset = null; + + /** + * TimeSegment endTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} endTimeOffset + * @memberof google.cloud.automl.v1beta1.TimeSegment + * @instance + */ + TimeSegment.prototype.endTimeOffset = null; + + /** + * Creates a new TimeSegment instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TimeSegment + * @static + * @param {google.cloud.automl.v1beta1.ITimeSegment=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TimeSegment} TimeSegment instance + */ + TimeSegment.create = function create(properties) { + return new TimeSegment(properties); + }; + + /** + * Encodes the specified TimeSegment message. Does not implicitly {@link google.cloud.automl.v1beta1.TimeSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TimeSegment + * @static + * @param {google.cloud.automl.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.automl.v1beta1.TimeSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TimeSegment + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.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.automl.v1beta1.TimeSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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.automl.v1beta1.TimeSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TimeSegment} TimeSegment + */ + TimeSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TimeSegment) + return object; + var message = new $root.google.cloud.automl.v1beta1.TimeSegment(); + if (object.startTimeOffset != null) { + if (typeof object.startTimeOffset !== "object") + throw TypeError(".google.cloud.automl.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.automl.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.automl.v1beta1.TimeSegment + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.TimeSegment"; + }; + + return TimeSegment; + })(); + + v1beta1.ImageObjectDetectionAnnotation = (function() { + + /** + * Properties of an ImageObjectDetectionAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @interface IImageObjectDetectionAnnotation + * @property {google.cloud.automl.v1beta1.IBoundingPoly|null} [boundingBox] ImageObjectDetectionAnnotation boundingBox + * @property {number|null} [score] ImageObjectDetectionAnnotation score + */ + + /** + * Constructs a new ImageObjectDetectionAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ImageObjectDetectionAnnotation. + * @implements IImageObjectDetectionAnnotation + * @constructor + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation=} [properties] Properties to set + */ + function ImageObjectDetectionAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionAnnotation boundingBox. + * @member {google.cloud.automl.v1beta1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @instance + */ + ImageObjectDetectionAnnotation.prototype.boundingBox = null; + + /** + * ImageObjectDetectionAnnotation score. + * @member {number} score + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @instance + */ + ImageObjectDetectionAnnotation.prototype.score = 0; + + /** + * Creates a new ImageObjectDetectionAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation} ImageObjectDetectionAnnotation instance + */ + ImageObjectDetectionAnnotation.create = function create(properties) { + return new ImageObjectDetectionAnnotation(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation} message ImageObjectDetectionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boundingBox != null && Object.hasOwnProperty.call(message, "boundingBox")) + $root.google.cloud.automl.v1beta1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation} message ImageObjectDetectionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation} ImageObjectDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.boundingBox = $root.google.cloud.automl.v1beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + } + case 2: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation} ImageObjectDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.automl.v1beta1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation} ImageObjectDetectionAnnotation + */ + ImageObjectDetectionAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation) + return object; + var message = new $root.google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation(); + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.automl.v1beta1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation} message ImageObjectDetectionAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.boundingBox = null; + object.score = 0; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.automl.v1beta1.BoundingPoly.toObject(message.boundingBox, options); + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this ImageObjectDetectionAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation"; + }; + + return ImageObjectDetectionAnnotation; + })(); + + v1beta1.VideoObjectTrackingAnnotation = (function() { + + /** + * Properties of a VideoObjectTrackingAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @interface IVideoObjectTrackingAnnotation + * @property {string|null} [instanceId] VideoObjectTrackingAnnotation instanceId + * @property {google.protobuf.IDuration|null} [timeOffset] VideoObjectTrackingAnnotation timeOffset + * @property {google.cloud.automl.v1beta1.IBoundingPoly|null} [boundingBox] VideoObjectTrackingAnnotation boundingBox + * @property {number|null} [score] VideoObjectTrackingAnnotation score + */ + + /** + * Constructs a new VideoObjectTrackingAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a VideoObjectTrackingAnnotation. + * @implements IVideoObjectTrackingAnnotation + * @constructor + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingAnnotation=} [properties] Properties to set + */ + function VideoObjectTrackingAnnotation(properties) { + if (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 instanceId. + * @member {string} instanceId + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @instance + */ + VideoObjectTrackingAnnotation.prototype.instanceId = ""; + + /** + * VideoObjectTrackingAnnotation timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @instance + */ + VideoObjectTrackingAnnotation.prototype.timeOffset = null; + + /** + * VideoObjectTrackingAnnotation boundingBox. + * @member {google.cloud.automl.v1beta1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @instance + */ + VideoObjectTrackingAnnotation.prototype.boundingBox = null; + + /** + * VideoObjectTrackingAnnotation score. + * @member {number} score + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @instance + */ + VideoObjectTrackingAnnotation.prototype.score = 0; + + /** + * Creates a new VideoObjectTrackingAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation} VideoObjectTrackingAnnotation instance + */ + VideoObjectTrackingAnnotation.create = function create(properties) { + return new VideoObjectTrackingAnnotation(properties); + }; + + /** + * Encodes the specified VideoObjectTrackingAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {google.cloud.automl.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.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.boundingBox != null && Object.hasOwnProperty.call(message, "boundingBox")) + $root.google.cloud.automl.v1beta1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.score); + return writer; + }; + + /** + * Encodes the specified VideoObjectTrackingAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.VideoObjectTrackingAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.instanceId = reader.string(); + break; + } + case 2: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.boundingBox = $root.google.cloud.automl.v1beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + } + case 4: { + message.score = reader.float(); + 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.automl.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.automl.v1beta1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a VideoObjectTrackingAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation} VideoObjectTrackingAnnotation + */ + VideoObjectTrackingAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation) + return object; + var message = new $root.google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation(); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.automl.v1beta1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a VideoObjectTrackingAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {google.cloud.automl.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.defaults) { + object.instanceId = ""; + object.timeOffset = null; + object.boundingBox = null; + object.score = 0; + } + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.automl.v1beta1.BoundingPoly.toObject(message.boundingBox, options); + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this VideoObjectTrackingAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.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.automl.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.automl.v1beta1.VideoObjectTrackingAnnotation"; + }; + + return VideoObjectTrackingAnnotation; + })(); + + v1beta1.BoundingBoxMetricsEntry = (function() { + + /** + * Properties of a BoundingBoxMetricsEntry. + * @memberof google.cloud.automl.v1beta1 + * @interface IBoundingBoxMetricsEntry + * @property {number|null} [iouThreshold] BoundingBoxMetricsEntry iouThreshold + * @property {number|null} [meanAveragePrecision] BoundingBoxMetricsEntry meanAveragePrecision + * @property {Array.|null} [confidenceMetricsEntries] BoundingBoxMetricsEntry confidenceMetricsEntries + */ + + /** + * Constructs a new BoundingBoxMetricsEntry. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a BoundingBoxMetricsEntry. + * @implements IBoundingBoxMetricsEntry + * @constructor + * @param {google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry=} [properties] Properties to set + */ + function BoundingBoxMetricsEntry(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]]; + } + + /** + * BoundingBoxMetricsEntry iouThreshold. + * @member {number} iouThreshold + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @instance + */ + BoundingBoxMetricsEntry.prototype.iouThreshold = 0; + + /** + * BoundingBoxMetricsEntry meanAveragePrecision. + * @member {number} meanAveragePrecision + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @instance + */ + BoundingBoxMetricsEntry.prototype.meanAveragePrecision = 0; + + /** + * BoundingBoxMetricsEntry confidenceMetricsEntries. + * @member {Array.} confidenceMetricsEntries + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @instance + */ + BoundingBoxMetricsEntry.prototype.confidenceMetricsEntries = $util.emptyArray; + + /** + * Creates a new BoundingBoxMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry} BoundingBoxMetricsEntry instance + */ + BoundingBoxMetricsEntry.create = function create(properties) { + return new BoundingBoxMetricsEntry(properties); + }; + + /** + * Encodes the specified BoundingBoxMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry} message BoundingBoxMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingBoxMetricsEntry.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); + if (message.meanAveragePrecision != null && Object.hasOwnProperty.call(message, "meanAveragePrecision")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.meanAveragePrecision); + if (message.confidenceMetricsEntries != null && message.confidenceMetricsEntries.length) + for (var i = 0; i < message.confidenceMetricsEntries.length; ++i) + $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.encode(message.confidenceMetricsEntries[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoundingBoxMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry} message BoundingBoxMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingBoxMetricsEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoundingBoxMetricsEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry} BoundingBoxMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingBoxMetricsEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.iouThreshold = reader.float(); + break; + } + case 2: { + message.meanAveragePrecision = reader.float(); + break; + } + case 3: { + if (!(message.confidenceMetricsEntries && message.confidenceMetricsEntries.length)) + message.confidenceMetricsEntries = []; + message.confidenceMetricsEntries.push($root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoundingBoxMetricsEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry} BoundingBoxMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingBoxMetricsEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoundingBoxMetricsEntry message. + * @function verify + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoundingBoxMetricsEntry.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"; + if (message.meanAveragePrecision != null && message.hasOwnProperty("meanAveragePrecision")) + if (typeof message.meanAveragePrecision !== "number") + return "meanAveragePrecision: 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.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify(message.confidenceMetricsEntries[i]); + if (error) + return "confidenceMetricsEntries." + error; + } + } + return null; + }; + + /** + * Creates a BoundingBoxMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry} BoundingBoxMetricsEntry + */ + BoundingBoxMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry) + return object; + var message = new $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry(); + if (object.iouThreshold != null) + message.iouThreshold = Number(object.iouThreshold); + if (object.meanAveragePrecision != null) + message.meanAveragePrecision = Number(object.meanAveragePrecision); + if (object.confidenceMetricsEntries) { + if (!Array.isArray(object.confidenceMetricsEntries)) + throw TypeError(".google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.confidenceMetricsEntries: array expected"); + message.confidenceMetricsEntries = []; + for (var i = 0; i < object.confidenceMetricsEntries.length; ++i) { + if (typeof object.confidenceMetricsEntries[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.confidenceMetricsEntries: object expected"); + message.confidenceMetricsEntries[i] = $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.fromObject(object.confidenceMetricsEntries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoundingBoxMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry} message BoundingBoxMetricsEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoundingBoxMetricsEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.confidenceMetricsEntries = []; + if (options.defaults) { + object.iouThreshold = 0; + object.meanAveragePrecision = 0; + } + if (message.iouThreshold != null && message.hasOwnProperty("iouThreshold")) + object.iouThreshold = options.json && !isFinite(message.iouThreshold) ? String(message.iouThreshold) : message.iouThreshold; + if (message.meanAveragePrecision != null && message.hasOwnProperty("meanAveragePrecision")) + object.meanAveragePrecision = options.json && !isFinite(message.meanAveragePrecision) ? String(message.meanAveragePrecision) : message.meanAveragePrecision; + if (message.confidenceMetricsEntries && message.confidenceMetricsEntries.length) { + object.confidenceMetricsEntries = []; + for (var j = 0; j < message.confidenceMetricsEntries.length; ++j) + object.confidenceMetricsEntries[j] = $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.toObject(message.confidenceMetricsEntries[j], options); + } + return object; + }; + + /** + * Converts this BoundingBoxMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @instance + * @returns {Object.} JSON object + */ + BoundingBoxMetricsEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoundingBoxMetricsEntry + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoundingBoxMetricsEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.BoundingBoxMetricsEntry"; + }; + + BoundingBoxMetricsEntry.ConfidenceMetricsEntry = (function() { + + /** + * Properties of a ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @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 + */ + + /** + * Constructs a new ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @classdesc Represents a ConfidenceMetricsEntry. + * @implements IConfidenceMetricsEntry + * @constructor + * @param {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.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.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.confidenceThreshold = 0; + + /** + * ConfidenceMetricsEntry recall. + * @member {number} recall + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recall = 0; + + /** + * ConfidenceMetricsEntry precision. + * @member {number} precision + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precision = 0; + + /** + * ConfidenceMetricsEntry f1Score. + * @member {number} f1Score + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1Score = 0; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} ConfidenceMetricsEntry instance + */ + ConfidenceMetricsEntry.create = function create(properties) { + return new ConfidenceMetricsEntry(properties); + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.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); + return writer; + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.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.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.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.automl.v1beta1.BoundingBoxMetricsEntry.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; + } + 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.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.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.automl.v1beta1.BoundingBoxMetricsEntry.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"; + return null; + }; + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} ConfidenceMetricsEntry + */ + ConfidenceMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry) + return object; + var message = new $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.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); + return message; + }; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.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; + } + 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; + return object; + }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.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.automl.v1beta1.BoundingBoxMetricsEntry.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.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry"; + }; + + return ConfidenceMetricsEntry; + })(); + + return BoundingBoxMetricsEntry; + })(); + + v1beta1.ImageObjectDetectionEvaluationMetrics = (function() { + + /** + * Properties of an ImageObjectDetectionEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @interface IImageObjectDetectionEvaluationMetrics + * @property {number|null} [evaluatedBoundingBoxCount] ImageObjectDetectionEvaluationMetrics evaluatedBoundingBoxCount + * @property {Array.|null} [boundingBoxMetricsEntries] ImageObjectDetectionEvaluationMetrics boundingBoxMetricsEntries + * @property {number|null} [boundingBoxMeanAveragePrecision] ImageObjectDetectionEvaluationMetrics boundingBoxMeanAveragePrecision + */ + + /** + * Constructs a new ImageObjectDetectionEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ImageObjectDetectionEvaluationMetrics. + * @implements IImageObjectDetectionEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics=} [properties] Properties to set + */ + function ImageObjectDetectionEvaluationMetrics(properties) { + this.boundingBoxMetricsEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionEvaluationMetrics evaluatedBoundingBoxCount. + * @member {number} evaluatedBoundingBoxCount + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @instance + */ + ImageObjectDetectionEvaluationMetrics.prototype.evaluatedBoundingBoxCount = 0; + + /** + * ImageObjectDetectionEvaluationMetrics boundingBoxMetricsEntries. + * @member {Array.} boundingBoxMetricsEntries + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @instance + */ + ImageObjectDetectionEvaluationMetrics.prototype.boundingBoxMetricsEntries = $util.emptyArray; + + /** + * ImageObjectDetectionEvaluationMetrics boundingBoxMeanAveragePrecision. + * @member {number} boundingBoxMeanAveragePrecision + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @instance + */ + ImageObjectDetectionEvaluationMetrics.prototype.boundingBoxMeanAveragePrecision = 0; + + /** + * Creates a new ImageObjectDetectionEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics} ImageObjectDetectionEvaluationMetrics instance + */ + ImageObjectDetectionEvaluationMetrics.create = function create(properties) { + return new ImageObjectDetectionEvaluationMetrics(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics} message ImageObjectDetectionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluatedBoundingBoxCount != null && Object.hasOwnProperty.call(message, "evaluatedBoundingBoxCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.evaluatedBoundingBoxCount); + if (message.boundingBoxMetricsEntries != null && message.boundingBoxMetricsEntries.length) + for (var i = 0; i < message.boundingBoxMetricsEntries.length; ++i) + $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.encode(message.boundingBoxMetricsEntries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.boundingBoxMeanAveragePrecision != null && Object.hasOwnProperty.call(message, "boundingBoxMeanAveragePrecision")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.boundingBoxMeanAveragePrecision); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics} message ImageObjectDetectionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics} ImageObjectDetectionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.evaluatedBoundingBoxCount = reader.int32(); + break; + } + case 2: { + if (!(message.boundingBoxMetricsEntries && message.boundingBoxMetricsEntries.length)) + message.boundingBoxMetricsEntries = []; + message.boundingBoxMetricsEntries.push($root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.decode(reader, reader.uint32())); + break; + } + case 3: { + message.boundingBoxMeanAveragePrecision = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics} ImageObjectDetectionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluatedBoundingBoxCount != null && message.hasOwnProperty("evaluatedBoundingBoxCount")) + if (!$util.isInteger(message.evaluatedBoundingBoxCount)) + return "evaluatedBoundingBoxCount: integer expected"; + if (message.boundingBoxMetricsEntries != null && message.hasOwnProperty("boundingBoxMetricsEntries")) { + if (!Array.isArray(message.boundingBoxMetricsEntries)) + return "boundingBoxMetricsEntries: array expected"; + for (var i = 0; i < message.boundingBoxMetricsEntries.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.verify(message.boundingBoxMetricsEntries[i]); + if (error) + return "boundingBoxMetricsEntries." + error; + } + } + if (message.boundingBoxMeanAveragePrecision != null && message.hasOwnProperty("boundingBoxMeanAveragePrecision")) + if (typeof message.boundingBoxMeanAveragePrecision !== "number") + return "boundingBoxMeanAveragePrecision: number expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics} ImageObjectDetectionEvaluationMetrics + */ + ImageObjectDetectionEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics(); + if (object.evaluatedBoundingBoxCount != null) + message.evaluatedBoundingBoxCount = object.evaluatedBoundingBoxCount | 0; + if (object.boundingBoxMetricsEntries) { + if (!Array.isArray(object.boundingBoxMetricsEntries)) + throw TypeError(".google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.boundingBoxMetricsEntries: array expected"); + message.boundingBoxMetricsEntries = []; + for (var i = 0; i < object.boundingBoxMetricsEntries.length; ++i) { + if (typeof object.boundingBoxMetricsEntries[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.boundingBoxMetricsEntries: object expected"); + message.boundingBoxMetricsEntries[i] = $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.fromObject(object.boundingBoxMetricsEntries[i]); + } + } + if (object.boundingBoxMeanAveragePrecision != null) + message.boundingBoxMeanAveragePrecision = Number(object.boundingBoxMeanAveragePrecision); + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics} message ImageObjectDetectionEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.boundingBoxMetricsEntries = []; + if (options.defaults) { + object.evaluatedBoundingBoxCount = 0; + object.boundingBoxMeanAveragePrecision = 0; + } + if (message.evaluatedBoundingBoxCount != null && message.hasOwnProperty("evaluatedBoundingBoxCount")) + object.evaluatedBoundingBoxCount = message.evaluatedBoundingBoxCount; + if (message.boundingBoxMetricsEntries && message.boundingBoxMetricsEntries.length) { + object.boundingBoxMetricsEntries = []; + for (var j = 0; j < message.boundingBoxMetricsEntries.length; ++j) + object.boundingBoxMetricsEntries[j] = $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.toObject(message.boundingBoxMetricsEntries[j], options); + } + if (message.boundingBoxMeanAveragePrecision != null && message.hasOwnProperty("boundingBoxMeanAveragePrecision")) + object.boundingBoxMeanAveragePrecision = options.json && !isFinite(message.boundingBoxMeanAveragePrecision) ? String(message.boundingBoxMeanAveragePrecision) : message.boundingBoxMeanAveragePrecision; + return object; + }; + + /** + * Converts this ImageObjectDetectionEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics"; + }; + + return ImageObjectDetectionEvaluationMetrics; + })(); + + v1beta1.VideoObjectTrackingEvaluationMetrics = (function() { + + /** + * Properties of a VideoObjectTrackingEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @interface IVideoObjectTrackingEvaluationMetrics + * @property {number|null} [evaluatedFrameCount] VideoObjectTrackingEvaluationMetrics evaluatedFrameCount + * @property {number|null} [evaluatedBoundingBoxCount] VideoObjectTrackingEvaluationMetrics evaluatedBoundingBoxCount + * @property {Array.|null} [boundingBoxMetricsEntries] VideoObjectTrackingEvaluationMetrics boundingBoxMetricsEntries + * @property {number|null} [boundingBoxMeanAveragePrecision] VideoObjectTrackingEvaluationMetrics boundingBoxMeanAveragePrecision + */ + + /** + * Constructs a new VideoObjectTrackingEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a VideoObjectTrackingEvaluationMetrics. + * @implements IVideoObjectTrackingEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics=} [properties] Properties to set + */ + function VideoObjectTrackingEvaluationMetrics(properties) { + this.boundingBoxMetricsEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoObjectTrackingEvaluationMetrics evaluatedFrameCount. + * @member {number} evaluatedFrameCount + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @instance + */ + VideoObjectTrackingEvaluationMetrics.prototype.evaluatedFrameCount = 0; + + /** + * VideoObjectTrackingEvaluationMetrics evaluatedBoundingBoxCount. + * @member {number} evaluatedBoundingBoxCount + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @instance + */ + VideoObjectTrackingEvaluationMetrics.prototype.evaluatedBoundingBoxCount = 0; + + /** + * VideoObjectTrackingEvaluationMetrics boundingBoxMetricsEntries. + * @member {Array.} boundingBoxMetricsEntries + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @instance + */ + VideoObjectTrackingEvaluationMetrics.prototype.boundingBoxMetricsEntries = $util.emptyArray; + + /** + * VideoObjectTrackingEvaluationMetrics boundingBoxMeanAveragePrecision. + * @member {number} boundingBoxMeanAveragePrecision + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @instance + */ + VideoObjectTrackingEvaluationMetrics.prototype.boundingBoxMeanAveragePrecision = 0; + + /** + * Creates a new VideoObjectTrackingEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics} VideoObjectTrackingEvaluationMetrics instance + */ + VideoObjectTrackingEvaluationMetrics.create = function create(properties) { + return new VideoObjectTrackingEvaluationMetrics(properties); + }; + + /** + * Encodes the specified VideoObjectTrackingEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics} message VideoObjectTrackingEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoObjectTrackingEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluatedFrameCount != null && Object.hasOwnProperty.call(message, "evaluatedFrameCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.evaluatedFrameCount); + if (message.evaluatedBoundingBoxCount != null && Object.hasOwnProperty.call(message, "evaluatedBoundingBoxCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.evaluatedBoundingBoxCount); + if (message.boundingBoxMetricsEntries != null && message.boundingBoxMetricsEntries.length) + for (var i = 0; i < message.boundingBoxMetricsEntries.length; ++i) + $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.encode(message.boundingBoxMetricsEntries[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.boundingBoxMeanAveragePrecision != null && Object.hasOwnProperty.call(message, "boundingBoxMeanAveragePrecision")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.boundingBoxMeanAveragePrecision); + return writer; + }; + + /** + * Encodes the specified VideoObjectTrackingEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics} message VideoObjectTrackingEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoObjectTrackingEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoObjectTrackingEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics} VideoObjectTrackingEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoObjectTrackingEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.evaluatedFrameCount = reader.int32(); + break; + } + case 2: { + message.evaluatedBoundingBoxCount = reader.int32(); + break; + } + case 4: { + if (!(message.boundingBoxMetricsEntries && message.boundingBoxMetricsEntries.length)) + message.boundingBoxMetricsEntries = []; + message.boundingBoxMetricsEntries.push($root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.decode(reader, reader.uint32())); + break; + } + case 6: { + message.boundingBoxMeanAveragePrecision = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoObjectTrackingEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics} VideoObjectTrackingEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoObjectTrackingEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoObjectTrackingEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoObjectTrackingEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluatedFrameCount != null && message.hasOwnProperty("evaluatedFrameCount")) + if (!$util.isInteger(message.evaluatedFrameCount)) + return "evaluatedFrameCount: integer expected"; + if (message.evaluatedBoundingBoxCount != null && message.hasOwnProperty("evaluatedBoundingBoxCount")) + if (!$util.isInteger(message.evaluatedBoundingBoxCount)) + return "evaluatedBoundingBoxCount: integer expected"; + if (message.boundingBoxMetricsEntries != null && message.hasOwnProperty("boundingBoxMetricsEntries")) { + if (!Array.isArray(message.boundingBoxMetricsEntries)) + return "boundingBoxMetricsEntries: array expected"; + for (var i = 0; i < message.boundingBoxMetricsEntries.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.verify(message.boundingBoxMetricsEntries[i]); + if (error) + return "boundingBoxMetricsEntries." + error; + } + } + if (message.boundingBoxMeanAveragePrecision != null && message.hasOwnProperty("boundingBoxMeanAveragePrecision")) + if (typeof message.boundingBoxMeanAveragePrecision !== "number") + return "boundingBoxMeanAveragePrecision: number expected"; + return null; + }; + + /** + * Creates a VideoObjectTrackingEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics} VideoObjectTrackingEvaluationMetrics + */ + VideoObjectTrackingEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics(); + if (object.evaluatedFrameCount != null) + message.evaluatedFrameCount = object.evaluatedFrameCount | 0; + if (object.evaluatedBoundingBoxCount != null) + message.evaluatedBoundingBoxCount = object.evaluatedBoundingBoxCount | 0; + if (object.boundingBoxMetricsEntries) { + if (!Array.isArray(object.boundingBoxMetricsEntries)) + throw TypeError(".google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.boundingBoxMetricsEntries: array expected"); + message.boundingBoxMetricsEntries = []; + for (var i = 0; i < object.boundingBoxMetricsEntries.length; ++i) { + if (typeof object.boundingBoxMetricsEntries[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.boundingBoxMetricsEntries: object expected"); + message.boundingBoxMetricsEntries[i] = $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.fromObject(object.boundingBoxMetricsEntries[i]); + } + } + if (object.boundingBoxMeanAveragePrecision != null) + message.boundingBoxMeanAveragePrecision = Number(object.boundingBoxMeanAveragePrecision); + return message; + }; + + /** + * Creates a plain object from a VideoObjectTrackingEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics} message VideoObjectTrackingEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoObjectTrackingEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.boundingBoxMetricsEntries = []; + if (options.defaults) { + object.evaluatedFrameCount = 0; + object.evaluatedBoundingBoxCount = 0; + object.boundingBoxMeanAveragePrecision = 0; + } + if (message.evaluatedFrameCount != null && message.hasOwnProperty("evaluatedFrameCount")) + object.evaluatedFrameCount = message.evaluatedFrameCount; + if (message.evaluatedBoundingBoxCount != null && message.hasOwnProperty("evaluatedBoundingBoxCount")) + object.evaluatedBoundingBoxCount = message.evaluatedBoundingBoxCount; + if (message.boundingBoxMetricsEntries && message.boundingBoxMetricsEntries.length) { + object.boundingBoxMetricsEntries = []; + for (var j = 0; j < message.boundingBoxMetricsEntries.length; ++j) + object.boundingBoxMetricsEntries[j] = $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.toObject(message.boundingBoxMetricsEntries[j], options); + } + if (message.boundingBoxMeanAveragePrecision != null && message.hasOwnProperty("boundingBoxMeanAveragePrecision")) + object.boundingBoxMeanAveragePrecision = options.json && !isFinite(message.boundingBoxMeanAveragePrecision) ? String(message.boundingBoxMeanAveragePrecision) : message.boundingBoxMeanAveragePrecision; + return object; + }; + + /** + * Converts this VideoObjectTrackingEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + VideoObjectTrackingEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoObjectTrackingEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoObjectTrackingEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics"; + }; + + return VideoObjectTrackingEvaluationMetrics; + })(); + + v1beta1.NormalizedVertex = (function() { + + /** + * Properties of a NormalizedVertex. + * @memberof google.cloud.automl.v1beta1 + * @interface INormalizedVertex + * @property {number|null} [x] NormalizedVertex x + * @property {number|null} [y] NormalizedVertex y + */ + + /** + * Constructs a new NormalizedVertex. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a NormalizedVertex. + * @implements INormalizedVertex + * @constructor + * @param {google.cloud.automl.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.automl.v1beta1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.x = 0; + + /** + * NormalizedVertex y. + * @member {number} y + * @memberof google.cloud.automl.v1beta1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.y = 0; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.NormalizedVertex + * @static + * @param {google.cloud.automl.v1beta1.INormalizedVertex=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.NormalizedVertex} NormalizedVertex instance + */ + NormalizedVertex.create = function create(properties) { + return new NormalizedVertex(properties); + }; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.automl.v1beta1.NormalizedVertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.NormalizedVertex + * @static + * @param {google.cloud.automl.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.automl.v1beta1.NormalizedVertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.NormalizedVertex + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.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.automl.v1beta1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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.automl.v1beta1.NormalizedVertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.NormalizedVertex} NormalizedVertex + */ + NormalizedVertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.NormalizedVertex) + return object; + var message = new $root.google.cloud.automl.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.automl.v1beta1.NormalizedVertex + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.NormalizedVertex"; + }; + + return NormalizedVertex; + })(); + + v1beta1.BoundingPoly = (function() { + + /** + * Properties of a BoundingPoly. + * @memberof google.cloud.automl.v1beta1 + * @interface IBoundingPoly + * @property {Array.|null} [normalizedVertices] BoundingPoly normalizedVertices + */ + + /** + * Constructs a new BoundingPoly. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a BoundingPoly. + * @implements IBoundingPoly + * @constructor + * @param {google.cloud.automl.v1beta1.IBoundingPoly=} [properties] Properties to set + */ + function BoundingPoly(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]]; + } + + /** + * BoundingPoly normalizedVertices. + * @member {Array.} normalizedVertices + * @memberof google.cloud.automl.v1beta1.BoundingPoly + * @instance + */ + BoundingPoly.prototype.normalizedVertices = $util.emptyArray; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BoundingPoly + * @static + * @param {google.cloud.automl.v1beta1.IBoundingPoly=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BoundingPoly} BoundingPoly instance + */ + BoundingPoly.create = function create(properties) { + return new BoundingPoly(properties); + }; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingPoly.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BoundingPoly + * @static + * @param {google.cloud.automl.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.normalizedVertices != null && message.normalizedVertices.length) + for (var i = 0; i < message.normalizedVertices.length; ++i) + $root.google.cloud.automl.v1beta1.NormalizedVertex.encode(message.normalizedVertices[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingPoly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BoundingPoly + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.BoundingPoly(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.normalizedVertices && message.normalizedVertices.length)) + message.normalizedVertices = []; + message.normalizedVertices.push($root.google.cloud.automl.v1beta1.NormalizedVertex.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.automl.v1beta1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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.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.automl.v1beta1.NormalizedVertex.verify(message.normalizedVertices[i]); + if (error) + return "normalizedVertices." + error; + } + } + return null; + }; + + /** + * Creates a BoundingPoly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BoundingPoly + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BoundingPoly} BoundingPoly + */ + BoundingPoly.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BoundingPoly) + return object; + var message = new $root.google.cloud.automl.v1beta1.BoundingPoly(); + if (object.normalizedVertices) { + if (!Array.isArray(object.normalizedVertices)) + throw TypeError(".google.cloud.automl.v1beta1.BoundingPoly.normalizedVertices: array expected"); + message.normalizedVertices = []; + for (var i = 0; i < object.normalizedVertices.length; ++i) { + if (typeof object.normalizedVertices[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BoundingPoly.normalizedVertices: object expected"); + message.normalizedVertices[i] = $root.google.cloud.automl.v1beta1.NormalizedVertex.fromObject(object.normalizedVertices[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoundingPoly message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BoundingPoly + * @static + * @param {google.cloud.automl.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.normalizedVertices = []; + if (message.normalizedVertices && message.normalizedVertices.length) { + object.normalizedVertices = []; + for (var j = 0; j < message.normalizedVertices.length; ++j) + object.normalizedVertices[j] = $root.google.cloud.automl.v1beta1.NormalizedVertex.toObject(message.normalizedVertices[j], options); + } + return object; + }; + + /** + * Converts this BoundingPoly to JSON. + * @function toJSON + * @memberof google.cloud.automl.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.automl.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.automl.v1beta1.BoundingPoly"; + }; + + return BoundingPoly; + })(); + + v1beta1.TablesDatasetMetadata = (function() { + + /** + * Properties of a TablesDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ITablesDatasetMetadata + * @property {string|null} [primaryTableSpecId] TablesDatasetMetadata primaryTableSpecId + * @property {string|null} [targetColumnSpecId] TablesDatasetMetadata targetColumnSpecId + * @property {string|null} [weightColumnSpecId] TablesDatasetMetadata weightColumnSpecId + * @property {string|null} [mlUseColumnSpecId] TablesDatasetMetadata mlUseColumnSpecId + * @property {Object.|null} [targetColumnCorrelations] TablesDatasetMetadata targetColumnCorrelations + * @property {google.protobuf.ITimestamp|null} [statsUpdateTime] TablesDatasetMetadata statsUpdateTime + */ + + /** + * Constructs a new TablesDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TablesDatasetMetadata. + * @implements ITablesDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ITablesDatasetMetadata=} [properties] Properties to set + */ + function TablesDatasetMetadata(properties) { + this.targetColumnCorrelations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TablesDatasetMetadata primaryTableSpecId. + * @member {string} primaryTableSpecId + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @instance + */ + TablesDatasetMetadata.prototype.primaryTableSpecId = ""; + + /** + * TablesDatasetMetadata targetColumnSpecId. + * @member {string} targetColumnSpecId + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @instance + */ + TablesDatasetMetadata.prototype.targetColumnSpecId = ""; + + /** + * TablesDatasetMetadata weightColumnSpecId. + * @member {string} weightColumnSpecId + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @instance + */ + TablesDatasetMetadata.prototype.weightColumnSpecId = ""; + + /** + * TablesDatasetMetadata mlUseColumnSpecId. + * @member {string} mlUseColumnSpecId + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @instance + */ + TablesDatasetMetadata.prototype.mlUseColumnSpecId = ""; + + /** + * TablesDatasetMetadata targetColumnCorrelations. + * @member {Object.} targetColumnCorrelations + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @instance + */ + TablesDatasetMetadata.prototype.targetColumnCorrelations = $util.emptyObject; + + /** + * TablesDatasetMetadata statsUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} statsUpdateTime + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @instance + */ + TablesDatasetMetadata.prototype.statsUpdateTime = null; + + /** + * Creates a new TablesDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITablesDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TablesDatasetMetadata} TablesDatasetMetadata instance + */ + TablesDatasetMetadata.create = function create(properties) { + return new TablesDatasetMetadata(properties); + }; + + /** + * Encodes the specified TablesDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TablesDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITablesDatasetMetadata} message TablesDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TablesDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.primaryTableSpecId != null && Object.hasOwnProperty.call(message, "primaryTableSpecId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.primaryTableSpecId); + if (message.targetColumnSpecId != null && Object.hasOwnProperty.call(message, "targetColumnSpecId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetColumnSpecId); + if (message.weightColumnSpecId != null && Object.hasOwnProperty.call(message, "weightColumnSpecId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.weightColumnSpecId); + if (message.mlUseColumnSpecId != null && Object.hasOwnProperty.call(message, "mlUseColumnSpecId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.mlUseColumnSpecId); + if (message.targetColumnCorrelations != null && Object.hasOwnProperty.call(message, "targetColumnCorrelations")) + for (var keys = Object.keys(message.targetColumnCorrelations), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.automl.v1beta1.CorrelationStats.encode(message.targetColumnCorrelations[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.statsUpdateTime != null && Object.hasOwnProperty.call(message, "statsUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.statsUpdateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TablesDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TablesDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITablesDatasetMetadata} message TablesDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TablesDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TablesDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TablesDatasetMetadata} TablesDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TablesDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TablesDatasetMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.primaryTableSpecId = reader.string(); + break; + } + case 2: { + message.targetColumnSpecId = reader.string(); + break; + } + case 3: { + message.weightColumnSpecId = reader.string(); + break; + } + case 4: { + message.mlUseColumnSpecId = reader.string(); + break; + } + case 6: { + if (message.targetColumnCorrelations === $util.emptyObject) + message.targetColumnCorrelations = {}; + 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.automl.v1beta1.CorrelationStats.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.targetColumnCorrelations[key] = value; + break; + } + case 7: { + message.statsUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TablesDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TablesDatasetMetadata} TablesDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TablesDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TablesDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TablesDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.primaryTableSpecId != null && message.hasOwnProperty("primaryTableSpecId")) + if (!$util.isString(message.primaryTableSpecId)) + return "primaryTableSpecId: string expected"; + if (message.targetColumnSpecId != null && message.hasOwnProperty("targetColumnSpecId")) + if (!$util.isString(message.targetColumnSpecId)) + return "targetColumnSpecId: string expected"; + if (message.weightColumnSpecId != null && message.hasOwnProperty("weightColumnSpecId")) + if (!$util.isString(message.weightColumnSpecId)) + return "weightColumnSpecId: string expected"; + if (message.mlUseColumnSpecId != null && message.hasOwnProperty("mlUseColumnSpecId")) + if (!$util.isString(message.mlUseColumnSpecId)) + return "mlUseColumnSpecId: string expected"; + if (message.targetColumnCorrelations != null && message.hasOwnProperty("targetColumnCorrelations")) { + if (!$util.isObject(message.targetColumnCorrelations)) + return "targetColumnCorrelations: object expected"; + var key = Object.keys(message.targetColumnCorrelations); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.CorrelationStats.verify(message.targetColumnCorrelations[key[i]]); + if (error) + return "targetColumnCorrelations." + error; + } + } + if (message.statsUpdateTime != null && message.hasOwnProperty("statsUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.statsUpdateTime); + if (error) + return "statsUpdateTime." + error; + } + return null; + }; + + /** + * Creates a TablesDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TablesDatasetMetadata} TablesDatasetMetadata + */ + TablesDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TablesDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.TablesDatasetMetadata(); + if (object.primaryTableSpecId != null) + message.primaryTableSpecId = String(object.primaryTableSpecId); + if (object.targetColumnSpecId != null) + message.targetColumnSpecId = String(object.targetColumnSpecId); + if (object.weightColumnSpecId != null) + message.weightColumnSpecId = String(object.weightColumnSpecId); + if (object.mlUseColumnSpecId != null) + message.mlUseColumnSpecId = String(object.mlUseColumnSpecId); + if (object.targetColumnCorrelations) { + if (typeof object.targetColumnCorrelations !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TablesDatasetMetadata.targetColumnCorrelations: object expected"); + message.targetColumnCorrelations = {}; + for (var keys = Object.keys(object.targetColumnCorrelations), i = 0; i < keys.length; ++i) { + if (typeof object.targetColumnCorrelations[keys[i]] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TablesDatasetMetadata.targetColumnCorrelations: object expected"); + message.targetColumnCorrelations[keys[i]] = $root.google.cloud.automl.v1beta1.CorrelationStats.fromObject(object.targetColumnCorrelations[keys[i]]); + } + } + if (object.statsUpdateTime != null) { + if (typeof object.statsUpdateTime !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TablesDatasetMetadata.statsUpdateTime: object expected"); + message.statsUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.statsUpdateTime); + } + return message; + }; + + /** + * Creates a plain object from a TablesDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.TablesDatasetMetadata} message TablesDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TablesDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.targetColumnCorrelations = {}; + if (options.defaults) { + object.primaryTableSpecId = ""; + object.targetColumnSpecId = ""; + object.weightColumnSpecId = ""; + object.mlUseColumnSpecId = ""; + object.statsUpdateTime = null; + } + if (message.primaryTableSpecId != null && message.hasOwnProperty("primaryTableSpecId")) + object.primaryTableSpecId = message.primaryTableSpecId; + if (message.targetColumnSpecId != null && message.hasOwnProperty("targetColumnSpecId")) + object.targetColumnSpecId = message.targetColumnSpecId; + if (message.weightColumnSpecId != null && message.hasOwnProperty("weightColumnSpecId")) + object.weightColumnSpecId = message.weightColumnSpecId; + if (message.mlUseColumnSpecId != null && message.hasOwnProperty("mlUseColumnSpecId")) + object.mlUseColumnSpecId = message.mlUseColumnSpecId; + var keys2; + if (message.targetColumnCorrelations && (keys2 = Object.keys(message.targetColumnCorrelations)).length) { + object.targetColumnCorrelations = {}; + for (var j = 0; j < keys2.length; ++j) + object.targetColumnCorrelations[keys2[j]] = $root.google.cloud.automl.v1beta1.CorrelationStats.toObject(message.targetColumnCorrelations[keys2[j]], options); + } + if (message.statsUpdateTime != null && message.hasOwnProperty("statsUpdateTime")) + object.statsUpdateTime = $root.google.protobuf.Timestamp.toObject(message.statsUpdateTime, options); + return object; + }; + + /** + * Converts this TablesDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TablesDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TablesDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TablesDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TablesDatasetMetadata"; + }; + + return TablesDatasetMetadata; + })(); + + v1beta1.TablesModelMetadata = (function() { + + /** + * Properties of a TablesModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ITablesModelMetadata + * @property {number|null} [optimizationObjectiveRecallValue] TablesModelMetadata optimizationObjectiveRecallValue + * @property {number|null} [optimizationObjectivePrecisionValue] TablesModelMetadata optimizationObjectivePrecisionValue + * @property {google.cloud.automl.v1beta1.IColumnSpec|null} [targetColumnSpec] TablesModelMetadata targetColumnSpec + * @property {Array.|null} [inputFeatureColumnSpecs] TablesModelMetadata inputFeatureColumnSpecs + * @property {string|null} [optimizationObjective] TablesModelMetadata optimizationObjective + * @property {Array.|null} [tablesModelColumnInfo] TablesModelMetadata tablesModelColumnInfo + * @property {number|Long|null} [trainBudgetMilliNodeHours] TablesModelMetadata trainBudgetMilliNodeHours + * @property {number|Long|null} [trainCostMilliNodeHours] TablesModelMetadata trainCostMilliNodeHours + * @property {boolean|null} [disableEarlyStopping] TablesModelMetadata disableEarlyStopping + */ + + /** + * Constructs a new TablesModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TablesModelMetadata. + * @implements ITablesModelMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ITablesModelMetadata=} [properties] Properties to set + */ + function TablesModelMetadata(properties) { + this.inputFeatureColumnSpecs = []; + this.tablesModelColumnInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TablesModelMetadata optimizationObjectiveRecallValue. + * @member {number|null|undefined} optimizationObjectiveRecallValue + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + TablesModelMetadata.prototype.optimizationObjectiveRecallValue = null; + + /** + * TablesModelMetadata optimizationObjectivePrecisionValue. + * @member {number|null|undefined} optimizationObjectivePrecisionValue + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + TablesModelMetadata.prototype.optimizationObjectivePrecisionValue = null; + + /** + * TablesModelMetadata targetColumnSpec. + * @member {google.cloud.automl.v1beta1.IColumnSpec|null|undefined} targetColumnSpec + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + TablesModelMetadata.prototype.targetColumnSpec = null; + + /** + * TablesModelMetadata inputFeatureColumnSpecs. + * @member {Array.} inputFeatureColumnSpecs + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + TablesModelMetadata.prototype.inputFeatureColumnSpecs = $util.emptyArray; + + /** + * TablesModelMetadata optimizationObjective. + * @member {string} optimizationObjective + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + TablesModelMetadata.prototype.optimizationObjective = ""; + + /** + * TablesModelMetadata tablesModelColumnInfo. + * @member {Array.} tablesModelColumnInfo + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + TablesModelMetadata.prototype.tablesModelColumnInfo = $util.emptyArray; + + /** + * TablesModelMetadata trainBudgetMilliNodeHours. + * @member {number|Long} trainBudgetMilliNodeHours + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + TablesModelMetadata.prototype.trainBudgetMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TablesModelMetadata trainCostMilliNodeHours. + * @member {number|Long} trainCostMilliNodeHours + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + TablesModelMetadata.prototype.trainCostMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TablesModelMetadata disableEarlyStopping. + * @member {boolean} disableEarlyStopping + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + TablesModelMetadata.prototype.disableEarlyStopping = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TablesModelMetadata additionalOptimizationObjectiveConfig. + * @member {"optimizationObjectiveRecallValue"|"optimizationObjectivePrecisionValue"|undefined} additionalOptimizationObjectiveConfig + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + Object.defineProperty(TablesModelMetadata.prototype, "additionalOptimizationObjectiveConfig", { + get: $util.oneOfGetter($oneOfFields = ["optimizationObjectiveRecallValue", "optimizationObjectivePrecisionValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TablesModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITablesModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TablesModelMetadata} TablesModelMetadata instance + */ + TablesModelMetadata.create = function create(properties) { + return new TablesModelMetadata(properties); + }; + + /** + * Encodes the specified TablesModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TablesModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITablesModelMetadata} message TablesModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TablesModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetColumnSpec != null && Object.hasOwnProperty.call(message, "targetColumnSpec")) + $root.google.cloud.automl.v1beta1.ColumnSpec.encode(message.targetColumnSpec, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inputFeatureColumnSpecs != null && message.inputFeatureColumnSpecs.length) + for (var i = 0; i < message.inputFeatureColumnSpecs.length; ++i) + $root.google.cloud.automl.v1beta1.ColumnSpec.encode(message.inputFeatureColumnSpecs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.optimizationObjective != null && Object.hasOwnProperty.call(message, "optimizationObjective")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.optimizationObjective); + if (message.tablesModelColumnInfo != null && message.tablesModelColumnInfo.length) + for (var i = 0; i < message.tablesModelColumnInfo.length; ++i) + $root.google.cloud.automl.v1beta1.TablesModelColumnInfo.encode(message.tablesModelColumnInfo[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.trainBudgetMilliNodeHours != null && Object.hasOwnProperty.call(message, "trainBudgetMilliNodeHours")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.trainBudgetMilliNodeHours); + if (message.trainCostMilliNodeHours != null && Object.hasOwnProperty.call(message, "trainCostMilliNodeHours")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.trainCostMilliNodeHours); + if (message.disableEarlyStopping != null && Object.hasOwnProperty.call(message, "disableEarlyStopping")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.disableEarlyStopping); + if (message.optimizationObjectiveRecallValue != null && Object.hasOwnProperty.call(message, "optimizationObjectiveRecallValue")) + writer.uint32(/* id 17, wireType 5 =*/141).float(message.optimizationObjectiveRecallValue); + if (message.optimizationObjectivePrecisionValue != null && Object.hasOwnProperty.call(message, "optimizationObjectivePrecisionValue")) + writer.uint32(/* id 18, wireType 5 =*/149).float(message.optimizationObjectivePrecisionValue); + return writer; + }; + + /** + * Encodes the specified TablesModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TablesModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITablesModelMetadata} message TablesModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TablesModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TablesModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TablesModelMetadata} TablesModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TablesModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TablesModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 17: { + message.optimizationObjectiveRecallValue = reader.float(); + break; + } + case 18: { + message.optimizationObjectivePrecisionValue = reader.float(); + break; + } + case 2: { + message.targetColumnSpec = $root.google.cloud.automl.v1beta1.ColumnSpec.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.inputFeatureColumnSpecs && message.inputFeatureColumnSpecs.length)) + message.inputFeatureColumnSpecs = []; + message.inputFeatureColumnSpecs.push($root.google.cloud.automl.v1beta1.ColumnSpec.decode(reader, reader.uint32())); + break; + } + case 4: { + message.optimizationObjective = reader.string(); + break; + } + case 5: { + if (!(message.tablesModelColumnInfo && message.tablesModelColumnInfo.length)) + message.tablesModelColumnInfo = []; + message.tablesModelColumnInfo.push($root.google.cloud.automl.v1beta1.TablesModelColumnInfo.decode(reader, reader.uint32())); + break; + } + case 6: { + message.trainBudgetMilliNodeHours = reader.int64(); + break; + } + case 7: { + message.trainCostMilliNodeHours = reader.int64(); + break; + } + case 12: { + message.disableEarlyStopping = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TablesModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TablesModelMetadata} TablesModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TablesModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TablesModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TablesModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.optimizationObjectiveRecallValue != null && message.hasOwnProperty("optimizationObjectiveRecallValue")) { + properties.additionalOptimizationObjectiveConfig = 1; + if (typeof message.optimizationObjectiveRecallValue !== "number") + return "optimizationObjectiveRecallValue: number expected"; + } + if (message.optimizationObjectivePrecisionValue != null && message.hasOwnProperty("optimizationObjectivePrecisionValue")) { + if (properties.additionalOptimizationObjectiveConfig === 1) + return "additionalOptimizationObjectiveConfig: multiple values"; + properties.additionalOptimizationObjectiveConfig = 1; + if (typeof message.optimizationObjectivePrecisionValue !== "number") + return "optimizationObjectivePrecisionValue: number expected"; + } + if (message.targetColumnSpec != null && message.hasOwnProperty("targetColumnSpec")) { + var error = $root.google.cloud.automl.v1beta1.ColumnSpec.verify(message.targetColumnSpec); + if (error) + return "targetColumnSpec." + error; + } + if (message.inputFeatureColumnSpecs != null && message.hasOwnProperty("inputFeatureColumnSpecs")) { + if (!Array.isArray(message.inputFeatureColumnSpecs)) + return "inputFeatureColumnSpecs: array expected"; + for (var i = 0; i < message.inputFeatureColumnSpecs.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.ColumnSpec.verify(message.inputFeatureColumnSpecs[i]); + if (error) + return "inputFeatureColumnSpecs." + error; + } + } + if (message.optimizationObjective != null && message.hasOwnProperty("optimizationObjective")) + if (!$util.isString(message.optimizationObjective)) + return "optimizationObjective: string expected"; + if (message.tablesModelColumnInfo != null && message.hasOwnProperty("tablesModelColumnInfo")) { + if (!Array.isArray(message.tablesModelColumnInfo)) + return "tablesModelColumnInfo: array expected"; + for (var i = 0; i < message.tablesModelColumnInfo.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.TablesModelColumnInfo.verify(message.tablesModelColumnInfo[i]); + if (error) + return "tablesModelColumnInfo." + error; + } + } + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + if (!$util.isInteger(message.trainBudgetMilliNodeHours) && !(message.trainBudgetMilliNodeHours && $util.isInteger(message.trainBudgetMilliNodeHours.low) && $util.isInteger(message.trainBudgetMilliNodeHours.high))) + return "trainBudgetMilliNodeHours: integer|Long expected"; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (!$util.isInteger(message.trainCostMilliNodeHours) && !(message.trainCostMilliNodeHours && $util.isInteger(message.trainCostMilliNodeHours.low) && $util.isInteger(message.trainCostMilliNodeHours.high))) + return "trainCostMilliNodeHours: integer|Long expected"; + if (message.disableEarlyStopping != null && message.hasOwnProperty("disableEarlyStopping")) + if (typeof message.disableEarlyStopping !== "boolean") + return "disableEarlyStopping: boolean expected"; + return null; + }; + + /** + * Creates a TablesModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TablesModelMetadata} TablesModelMetadata + */ + TablesModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TablesModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.TablesModelMetadata(); + if (object.optimizationObjectiveRecallValue != null) + message.optimizationObjectiveRecallValue = Number(object.optimizationObjectiveRecallValue); + if (object.optimizationObjectivePrecisionValue != null) + message.optimizationObjectivePrecisionValue = Number(object.optimizationObjectivePrecisionValue); + if (object.targetColumnSpec != null) { + if (typeof object.targetColumnSpec !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TablesModelMetadata.targetColumnSpec: object expected"); + message.targetColumnSpec = $root.google.cloud.automl.v1beta1.ColumnSpec.fromObject(object.targetColumnSpec); + } + if (object.inputFeatureColumnSpecs) { + if (!Array.isArray(object.inputFeatureColumnSpecs)) + throw TypeError(".google.cloud.automl.v1beta1.TablesModelMetadata.inputFeatureColumnSpecs: array expected"); + message.inputFeatureColumnSpecs = []; + for (var i = 0; i < object.inputFeatureColumnSpecs.length; ++i) { + if (typeof object.inputFeatureColumnSpecs[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TablesModelMetadata.inputFeatureColumnSpecs: object expected"); + message.inputFeatureColumnSpecs[i] = $root.google.cloud.automl.v1beta1.ColumnSpec.fromObject(object.inputFeatureColumnSpecs[i]); + } + } + if (object.optimizationObjective != null) + message.optimizationObjective = String(object.optimizationObjective); + if (object.tablesModelColumnInfo) { + if (!Array.isArray(object.tablesModelColumnInfo)) + throw TypeError(".google.cloud.automl.v1beta1.TablesModelMetadata.tablesModelColumnInfo: array expected"); + message.tablesModelColumnInfo = []; + for (var i = 0; i < object.tablesModelColumnInfo.length; ++i) { + if (typeof object.tablesModelColumnInfo[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TablesModelMetadata.tablesModelColumnInfo: object expected"); + message.tablesModelColumnInfo[i] = $root.google.cloud.automl.v1beta1.TablesModelColumnInfo.fromObject(object.tablesModelColumnInfo[i]); + } + } + if (object.trainBudgetMilliNodeHours != null) + if ($util.Long) + (message.trainBudgetMilliNodeHours = $util.Long.fromValue(object.trainBudgetMilliNodeHours)).unsigned = false; + else if (typeof object.trainBudgetMilliNodeHours === "string") + message.trainBudgetMilliNodeHours = parseInt(object.trainBudgetMilliNodeHours, 10); + else if (typeof object.trainBudgetMilliNodeHours === "number") + message.trainBudgetMilliNodeHours = object.trainBudgetMilliNodeHours; + else if (typeof object.trainBudgetMilliNodeHours === "object") + message.trainBudgetMilliNodeHours = new $util.LongBits(object.trainBudgetMilliNodeHours.low >>> 0, object.trainBudgetMilliNodeHours.high >>> 0).toNumber(); + if (object.trainCostMilliNodeHours != null) + if ($util.Long) + (message.trainCostMilliNodeHours = $util.Long.fromValue(object.trainCostMilliNodeHours)).unsigned = false; + else if (typeof object.trainCostMilliNodeHours === "string") + message.trainCostMilliNodeHours = parseInt(object.trainCostMilliNodeHours, 10); + else if (typeof object.trainCostMilliNodeHours === "number") + message.trainCostMilliNodeHours = object.trainCostMilliNodeHours; + else if (typeof object.trainCostMilliNodeHours === "object") + message.trainCostMilliNodeHours = new $util.LongBits(object.trainCostMilliNodeHours.low >>> 0, object.trainCostMilliNodeHours.high >>> 0).toNumber(); + if (object.disableEarlyStopping != null) + message.disableEarlyStopping = Boolean(object.disableEarlyStopping); + return message; + }; + + /** + * Creates a plain object from a TablesModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.TablesModelMetadata} message TablesModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TablesModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inputFeatureColumnSpecs = []; + object.tablesModelColumnInfo = []; + } + if (options.defaults) { + object.targetColumnSpec = null; + object.optimizationObjective = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainBudgetMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainBudgetMilliNodeHours = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainCostMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainCostMilliNodeHours = options.longs === String ? "0" : 0; + object.disableEarlyStopping = false; + } + if (message.targetColumnSpec != null && message.hasOwnProperty("targetColumnSpec")) + object.targetColumnSpec = $root.google.cloud.automl.v1beta1.ColumnSpec.toObject(message.targetColumnSpec, options); + if (message.inputFeatureColumnSpecs && message.inputFeatureColumnSpecs.length) { + object.inputFeatureColumnSpecs = []; + for (var j = 0; j < message.inputFeatureColumnSpecs.length; ++j) + object.inputFeatureColumnSpecs[j] = $root.google.cloud.automl.v1beta1.ColumnSpec.toObject(message.inputFeatureColumnSpecs[j], options); + } + if (message.optimizationObjective != null && message.hasOwnProperty("optimizationObjective")) + object.optimizationObjective = message.optimizationObjective; + if (message.tablesModelColumnInfo && message.tablesModelColumnInfo.length) { + object.tablesModelColumnInfo = []; + for (var j = 0; j < message.tablesModelColumnInfo.length; ++j) + object.tablesModelColumnInfo[j] = $root.google.cloud.automl.v1beta1.TablesModelColumnInfo.toObject(message.tablesModelColumnInfo[j], options); + } + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + if (typeof message.trainBudgetMilliNodeHours === "number") + object.trainBudgetMilliNodeHours = options.longs === String ? String(message.trainBudgetMilliNodeHours) : message.trainBudgetMilliNodeHours; + else + object.trainBudgetMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainBudgetMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainBudgetMilliNodeHours.low >>> 0, message.trainBudgetMilliNodeHours.high >>> 0).toNumber() : message.trainBudgetMilliNodeHours; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (typeof message.trainCostMilliNodeHours === "number") + object.trainCostMilliNodeHours = options.longs === String ? String(message.trainCostMilliNodeHours) : message.trainCostMilliNodeHours; + else + object.trainCostMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainCostMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainCostMilliNodeHours.low >>> 0, message.trainCostMilliNodeHours.high >>> 0).toNumber() : message.trainCostMilliNodeHours; + if (message.disableEarlyStopping != null && message.hasOwnProperty("disableEarlyStopping")) + object.disableEarlyStopping = message.disableEarlyStopping; + if (message.optimizationObjectiveRecallValue != null && message.hasOwnProperty("optimizationObjectiveRecallValue")) { + object.optimizationObjectiveRecallValue = options.json && !isFinite(message.optimizationObjectiveRecallValue) ? String(message.optimizationObjectiveRecallValue) : message.optimizationObjectiveRecallValue; + if (options.oneofs) + object.additionalOptimizationObjectiveConfig = "optimizationObjectiveRecallValue"; + } + if (message.optimizationObjectivePrecisionValue != null && message.hasOwnProperty("optimizationObjectivePrecisionValue")) { + object.optimizationObjectivePrecisionValue = options.json && !isFinite(message.optimizationObjectivePrecisionValue) ? String(message.optimizationObjectivePrecisionValue) : message.optimizationObjectivePrecisionValue; + if (options.oneofs) + object.additionalOptimizationObjectiveConfig = "optimizationObjectivePrecisionValue"; + } + return object; + }; + + /** + * Converts this TablesModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TablesModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TablesModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TablesModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TablesModelMetadata"; + }; + + return TablesModelMetadata; + })(); + + v1beta1.TablesAnnotation = (function() { + + /** + * Properties of a TablesAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @interface ITablesAnnotation + * @property {number|null} [score] TablesAnnotation score + * @property {google.cloud.automl.v1beta1.IDoubleRange|null} [predictionInterval] TablesAnnotation predictionInterval + * @property {google.protobuf.IValue|null} [value] TablesAnnotation value + * @property {Array.|null} [tablesModelColumnInfo] TablesAnnotation tablesModelColumnInfo + * @property {number|null} [baselineScore] TablesAnnotation baselineScore + */ + + /** + * Constructs a new TablesAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TablesAnnotation. + * @implements ITablesAnnotation + * @constructor + * @param {google.cloud.automl.v1beta1.ITablesAnnotation=} [properties] Properties to set + */ + function TablesAnnotation(properties) { + this.tablesModelColumnInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TablesAnnotation score. + * @member {number} score + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @instance + */ + TablesAnnotation.prototype.score = 0; + + /** + * TablesAnnotation predictionInterval. + * @member {google.cloud.automl.v1beta1.IDoubleRange|null|undefined} predictionInterval + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @instance + */ + TablesAnnotation.prototype.predictionInterval = null; + + /** + * TablesAnnotation value. + * @member {google.protobuf.IValue|null|undefined} value + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @instance + */ + TablesAnnotation.prototype.value = null; + + /** + * TablesAnnotation tablesModelColumnInfo. + * @member {Array.} tablesModelColumnInfo + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @instance + */ + TablesAnnotation.prototype.tablesModelColumnInfo = $util.emptyArray; + + /** + * TablesAnnotation baselineScore. + * @member {number} baselineScore + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @instance + */ + TablesAnnotation.prototype.baselineScore = 0; + + /** + * Creates a new TablesAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITablesAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TablesAnnotation} TablesAnnotation instance + */ + TablesAnnotation.create = function create(properties) { + return new TablesAnnotation(properties); + }; + + /** + * Encodes the specified TablesAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.TablesAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITablesAnnotation} message TablesAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TablesAnnotation.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.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.protobuf.Value.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tablesModelColumnInfo != null && message.tablesModelColumnInfo.length) + for (var i = 0; i < message.tablesModelColumnInfo.length; ++i) + $root.google.cloud.automl.v1beta1.TablesModelColumnInfo.encode(message.tablesModelColumnInfo[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.predictionInterval != null && Object.hasOwnProperty.call(message, "predictionInterval")) + $root.google.cloud.automl.v1beta1.DoubleRange.encode(message.predictionInterval, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.baselineScore != null && Object.hasOwnProperty.call(message, "baselineScore")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.baselineScore); + return writer; + }; + + /** + * Encodes the specified TablesAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TablesAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITablesAnnotation} message TablesAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TablesAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TablesAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TablesAnnotation} TablesAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TablesAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TablesAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.score = reader.float(); + break; + } + case 4: { + message.predictionInterval = $root.google.cloud.automl.v1beta1.DoubleRange.decode(reader, reader.uint32()); + break; + } + case 2: { + message.value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.tablesModelColumnInfo && message.tablesModelColumnInfo.length)) + message.tablesModelColumnInfo = []; + message.tablesModelColumnInfo.push($root.google.cloud.automl.v1beta1.TablesModelColumnInfo.decode(reader, reader.uint32())); + break; + } + case 5: { + message.baselineScore = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TablesAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TablesAnnotation} TablesAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TablesAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TablesAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TablesAnnotation.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.predictionInterval != null && message.hasOwnProperty("predictionInterval")) { + var error = $root.google.cloud.automl.v1beta1.DoubleRange.verify(message.predictionInterval); + if (error) + return "predictionInterval." + error; + } + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.google.protobuf.Value.verify(message.value); + if (error) + return "value." + error; + } + if (message.tablesModelColumnInfo != null && message.hasOwnProperty("tablesModelColumnInfo")) { + if (!Array.isArray(message.tablesModelColumnInfo)) + return "tablesModelColumnInfo: array expected"; + for (var i = 0; i < message.tablesModelColumnInfo.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.TablesModelColumnInfo.verify(message.tablesModelColumnInfo[i]); + if (error) + return "tablesModelColumnInfo." + error; + } + } + if (message.baselineScore != null && message.hasOwnProperty("baselineScore")) + if (typeof message.baselineScore !== "number") + return "baselineScore: number expected"; + return null; + }; + + /** + * Creates a TablesAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TablesAnnotation} TablesAnnotation + */ + TablesAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TablesAnnotation) + return object; + var message = new $root.google.cloud.automl.v1beta1.TablesAnnotation(); + if (object.score != null) + message.score = Number(object.score); + if (object.predictionInterval != null) { + if (typeof object.predictionInterval !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TablesAnnotation.predictionInterval: object expected"); + message.predictionInterval = $root.google.cloud.automl.v1beta1.DoubleRange.fromObject(object.predictionInterval); + } + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TablesAnnotation.value: object expected"); + message.value = $root.google.protobuf.Value.fromObject(object.value); + } + if (object.tablesModelColumnInfo) { + if (!Array.isArray(object.tablesModelColumnInfo)) + throw TypeError(".google.cloud.automl.v1beta1.TablesAnnotation.tablesModelColumnInfo: array expected"); + message.tablesModelColumnInfo = []; + for (var i = 0; i < object.tablesModelColumnInfo.length; ++i) { + if (typeof object.tablesModelColumnInfo[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TablesAnnotation.tablesModelColumnInfo: object expected"); + message.tablesModelColumnInfo[i] = $root.google.cloud.automl.v1beta1.TablesModelColumnInfo.fromObject(object.tablesModelColumnInfo[i]); + } + } + if (object.baselineScore != null) + message.baselineScore = Number(object.baselineScore); + return message; + }; + + /** + * Creates a plain object from a TablesAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @static + * @param {google.cloud.automl.v1beta1.TablesAnnotation} message TablesAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TablesAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tablesModelColumnInfo = []; + if (options.defaults) { + object.score = 0; + object.value = null; + object.predictionInterval = null; + object.baselineScore = 0; + } + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.protobuf.Value.toObject(message.value, options); + if (message.tablesModelColumnInfo && message.tablesModelColumnInfo.length) { + object.tablesModelColumnInfo = []; + for (var j = 0; j < message.tablesModelColumnInfo.length; ++j) + object.tablesModelColumnInfo[j] = $root.google.cloud.automl.v1beta1.TablesModelColumnInfo.toObject(message.tablesModelColumnInfo[j], options); + } + if (message.predictionInterval != null && message.hasOwnProperty("predictionInterval")) + object.predictionInterval = $root.google.cloud.automl.v1beta1.DoubleRange.toObject(message.predictionInterval, options); + if (message.baselineScore != null && message.hasOwnProperty("baselineScore")) + object.baselineScore = options.json && !isFinite(message.baselineScore) ? String(message.baselineScore) : message.baselineScore; + return object; + }; + + /** + * Converts this TablesAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @instance + * @returns {Object.} JSON object + */ + TablesAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TablesAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TablesAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TablesAnnotation"; + }; + + return TablesAnnotation; + })(); + + v1beta1.TablesModelColumnInfo = (function() { + + /** + * Properties of a TablesModelColumnInfo. + * @memberof google.cloud.automl.v1beta1 + * @interface ITablesModelColumnInfo + * @property {string|null} [columnSpecName] TablesModelColumnInfo columnSpecName + * @property {string|null} [columnDisplayName] TablesModelColumnInfo columnDisplayName + * @property {number|null} [featureImportance] TablesModelColumnInfo featureImportance + */ + + /** + * Constructs a new TablesModelColumnInfo. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TablesModelColumnInfo. + * @implements ITablesModelColumnInfo + * @constructor + * @param {google.cloud.automl.v1beta1.ITablesModelColumnInfo=} [properties] Properties to set + */ + function TablesModelColumnInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TablesModelColumnInfo columnSpecName. + * @member {string} columnSpecName + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @instance + */ + TablesModelColumnInfo.prototype.columnSpecName = ""; + + /** + * TablesModelColumnInfo columnDisplayName. + * @member {string} columnDisplayName + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @instance + */ + TablesModelColumnInfo.prototype.columnDisplayName = ""; + + /** + * TablesModelColumnInfo featureImportance. + * @member {number} featureImportance + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @instance + */ + TablesModelColumnInfo.prototype.featureImportance = 0; + + /** + * Creates a new TablesModelColumnInfo instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @static + * @param {google.cloud.automl.v1beta1.ITablesModelColumnInfo=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TablesModelColumnInfo} TablesModelColumnInfo instance + */ + TablesModelColumnInfo.create = function create(properties) { + return new TablesModelColumnInfo(properties); + }; + + /** + * Encodes the specified TablesModelColumnInfo message. Does not implicitly {@link google.cloud.automl.v1beta1.TablesModelColumnInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @static + * @param {google.cloud.automl.v1beta1.ITablesModelColumnInfo} message TablesModelColumnInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TablesModelColumnInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columnSpecName != null && Object.hasOwnProperty.call(message, "columnSpecName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.columnSpecName); + if (message.columnDisplayName != null && Object.hasOwnProperty.call(message, "columnDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.columnDisplayName); + if (message.featureImportance != null && Object.hasOwnProperty.call(message, "featureImportance")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.featureImportance); + return writer; + }; + + /** + * Encodes the specified TablesModelColumnInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TablesModelColumnInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @static + * @param {google.cloud.automl.v1beta1.ITablesModelColumnInfo} message TablesModelColumnInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TablesModelColumnInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TablesModelColumnInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TablesModelColumnInfo} TablesModelColumnInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TablesModelColumnInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TablesModelColumnInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.columnSpecName = reader.string(); + break; + } + case 2: { + message.columnDisplayName = reader.string(); + break; + } + case 3: { + message.featureImportance = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TablesModelColumnInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TablesModelColumnInfo} TablesModelColumnInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TablesModelColumnInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TablesModelColumnInfo message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TablesModelColumnInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columnSpecName != null && message.hasOwnProperty("columnSpecName")) + if (!$util.isString(message.columnSpecName)) + return "columnSpecName: string expected"; + if (message.columnDisplayName != null && message.hasOwnProperty("columnDisplayName")) + if (!$util.isString(message.columnDisplayName)) + return "columnDisplayName: string expected"; + if (message.featureImportance != null && message.hasOwnProperty("featureImportance")) + if (typeof message.featureImportance !== "number") + return "featureImportance: number expected"; + return null; + }; + + /** + * Creates a TablesModelColumnInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TablesModelColumnInfo} TablesModelColumnInfo + */ + TablesModelColumnInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TablesModelColumnInfo) + return object; + var message = new $root.google.cloud.automl.v1beta1.TablesModelColumnInfo(); + if (object.columnSpecName != null) + message.columnSpecName = String(object.columnSpecName); + if (object.columnDisplayName != null) + message.columnDisplayName = String(object.columnDisplayName); + if (object.featureImportance != null) + message.featureImportance = Number(object.featureImportance); + return message; + }; + + /** + * Creates a plain object from a TablesModelColumnInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @static + * @param {google.cloud.automl.v1beta1.TablesModelColumnInfo} message TablesModelColumnInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TablesModelColumnInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.columnSpecName = ""; + object.columnDisplayName = ""; + object.featureImportance = 0; + } + if (message.columnSpecName != null && message.hasOwnProperty("columnSpecName")) + object.columnSpecName = message.columnSpecName; + if (message.columnDisplayName != null && message.hasOwnProperty("columnDisplayName")) + object.columnDisplayName = message.columnDisplayName; + if (message.featureImportance != null && message.hasOwnProperty("featureImportance")) + object.featureImportance = options.json && !isFinite(message.featureImportance) ? String(message.featureImportance) : message.featureImportance; + return object; + }; + + /** + * Converts this TablesModelColumnInfo to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @instance + * @returns {Object.} JSON object + */ + TablesModelColumnInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TablesModelColumnInfo + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TablesModelColumnInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TablesModelColumnInfo"; + }; + + return TablesModelColumnInfo; + })(); + + v1beta1.ColumnSpec = (function() { + + /** + * Properties of a ColumnSpec. + * @memberof google.cloud.automl.v1beta1 + * @interface IColumnSpec + * @property {string|null} [name] ColumnSpec name + * @property {google.cloud.automl.v1beta1.IDataType|null} [dataType] ColumnSpec dataType + * @property {string|null} [displayName] ColumnSpec displayName + * @property {google.cloud.automl.v1beta1.IDataStats|null} [dataStats] ColumnSpec dataStats + * @property {Array.|null} [topCorrelatedColumns] ColumnSpec topCorrelatedColumns + * @property {string|null} [etag] ColumnSpec etag + */ + + /** + * Constructs a new ColumnSpec. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ColumnSpec. + * @implements IColumnSpec + * @constructor + * @param {google.cloud.automl.v1beta1.IColumnSpec=} [properties] Properties to set + */ + function ColumnSpec(properties) { + this.topCorrelatedColumns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ColumnSpec name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @instance + */ + ColumnSpec.prototype.name = ""; + + /** + * ColumnSpec dataType. + * @member {google.cloud.automl.v1beta1.IDataType|null|undefined} dataType + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @instance + */ + ColumnSpec.prototype.dataType = null; + + /** + * ColumnSpec displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @instance + */ + ColumnSpec.prototype.displayName = ""; + + /** + * ColumnSpec dataStats. + * @member {google.cloud.automl.v1beta1.IDataStats|null|undefined} dataStats + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @instance + */ + ColumnSpec.prototype.dataStats = null; + + /** + * ColumnSpec topCorrelatedColumns. + * @member {Array.} topCorrelatedColumns + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @instance + */ + ColumnSpec.prototype.topCorrelatedColumns = $util.emptyArray; + + /** + * ColumnSpec etag. + * @member {string} etag + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @instance + */ + ColumnSpec.prototype.etag = ""; + + /** + * Creates a new ColumnSpec instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @static + * @param {google.cloud.automl.v1beta1.IColumnSpec=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ColumnSpec} ColumnSpec instance + */ + ColumnSpec.create = function create(properties) { + return new ColumnSpec(properties); + }; + + /** + * Encodes the specified ColumnSpec message. Does not implicitly {@link google.cloud.automl.v1beta1.ColumnSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @static + * @param {google.cloud.automl.v1beta1.IColumnSpec} message ColumnSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnSpec.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.dataType != null && Object.hasOwnProperty.call(message, "dataType")) + $root.google.cloud.automl.v1beta1.DataType.encode(message.dataType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.dataStats != null && Object.hasOwnProperty.call(message, "dataStats")) + $root.google.cloud.automl.v1beta1.DataStats.encode(message.dataStats, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.topCorrelatedColumns != null && message.topCorrelatedColumns.length) + for (var i = 0; i < message.topCorrelatedColumns.length; ++i) + $root.google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.encode(message.topCorrelatedColumns[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + return writer; + }; + + /** + * Encodes the specified ColumnSpec message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ColumnSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @static + * @param {google.cloud.automl.v1beta1.IColumnSpec} message ColumnSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColumnSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ColumnSpec} ColumnSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ColumnSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.dataType = $root.google.cloud.automl.v1beta1.DataType.decode(reader, reader.uint32()); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.dataStats = $root.google.cloud.automl.v1beta1.DataStats.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.topCorrelatedColumns && message.topCorrelatedColumns.length)) + message.topCorrelatedColumns = []; + message.topCorrelatedColumns.push($root.google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.decode(reader, reader.uint32())); + break; + } + case 6: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColumnSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ColumnSpec} ColumnSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColumnSpec message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColumnSpec.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.dataType != null && message.hasOwnProperty("dataType")) { + var error = $root.google.cloud.automl.v1beta1.DataType.verify(message.dataType); + if (error) + return "dataType." + error; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.dataStats != null && message.hasOwnProperty("dataStats")) { + var error = $root.google.cloud.automl.v1beta1.DataStats.verify(message.dataStats); + if (error) + return "dataStats." + error; + } + if (message.topCorrelatedColumns != null && message.hasOwnProperty("topCorrelatedColumns")) { + if (!Array.isArray(message.topCorrelatedColumns)) + return "topCorrelatedColumns: array expected"; + for (var i = 0; i < message.topCorrelatedColumns.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.verify(message.topCorrelatedColumns[i]); + if (error) + return "topCorrelatedColumns." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a ColumnSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ColumnSpec} ColumnSpec + */ + ColumnSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ColumnSpec) + return object; + var message = new $root.google.cloud.automl.v1beta1.ColumnSpec(); + if (object.name != null) + message.name = String(object.name); + if (object.dataType != null) { + if (typeof object.dataType !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ColumnSpec.dataType: object expected"); + message.dataType = $root.google.cloud.automl.v1beta1.DataType.fromObject(object.dataType); + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.dataStats != null) { + if (typeof object.dataStats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ColumnSpec.dataStats: object expected"); + message.dataStats = $root.google.cloud.automl.v1beta1.DataStats.fromObject(object.dataStats); + } + if (object.topCorrelatedColumns) { + if (!Array.isArray(object.topCorrelatedColumns)) + throw TypeError(".google.cloud.automl.v1beta1.ColumnSpec.topCorrelatedColumns: array expected"); + message.topCorrelatedColumns = []; + for (var i = 0; i < object.topCorrelatedColumns.length; ++i) { + if (typeof object.topCorrelatedColumns[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ColumnSpec.topCorrelatedColumns: object expected"); + message.topCorrelatedColumns[i] = $root.google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.fromObject(object.topCorrelatedColumns[i]); + } + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a ColumnSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @static + * @param {google.cloud.automl.v1beta1.ColumnSpec} message ColumnSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColumnSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.topCorrelatedColumns = []; + if (options.defaults) { + object.name = ""; + object.dataType = null; + object.displayName = ""; + object.dataStats = null; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.dataType != null && message.hasOwnProperty("dataType")) + object.dataType = $root.google.cloud.automl.v1beta1.DataType.toObject(message.dataType, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.dataStats != null && message.hasOwnProperty("dataStats")) + object.dataStats = $root.google.cloud.automl.v1beta1.DataStats.toObject(message.dataStats, options); + if (message.topCorrelatedColumns && message.topCorrelatedColumns.length) { + object.topCorrelatedColumns = []; + for (var j = 0; j < message.topCorrelatedColumns.length; ++j) + object.topCorrelatedColumns[j] = $root.google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.toObject(message.topCorrelatedColumns[j], options); + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this ColumnSpec to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @instance + * @returns {Object.} JSON object + */ + ColumnSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ColumnSpec + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ColumnSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ColumnSpec"; + }; + + ColumnSpec.CorrelatedColumn = (function() { + + /** + * Properties of a CorrelatedColumn. + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @interface ICorrelatedColumn + * @property {string|null} [columnSpecId] CorrelatedColumn columnSpecId + * @property {google.cloud.automl.v1beta1.ICorrelationStats|null} [correlationStats] CorrelatedColumn correlationStats + */ + + /** + * Constructs a new CorrelatedColumn. + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @classdesc Represents a CorrelatedColumn. + * @implements ICorrelatedColumn + * @constructor + * @param {google.cloud.automl.v1beta1.ColumnSpec.ICorrelatedColumn=} [properties] Properties to set + */ + function CorrelatedColumn(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CorrelatedColumn columnSpecId. + * @member {string} columnSpecId + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @instance + */ + CorrelatedColumn.prototype.columnSpecId = ""; + + /** + * CorrelatedColumn correlationStats. + * @member {google.cloud.automl.v1beta1.ICorrelationStats|null|undefined} correlationStats + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @instance + */ + CorrelatedColumn.prototype.correlationStats = null; + + /** + * Creates a new CorrelatedColumn instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @static + * @param {google.cloud.automl.v1beta1.ColumnSpec.ICorrelatedColumn=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn} CorrelatedColumn instance + */ + CorrelatedColumn.create = function create(properties) { + return new CorrelatedColumn(properties); + }; + + /** + * Encodes the specified CorrelatedColumn message. Does not implicitly {@link google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @static + * @param {google.cloud.automl.v1beta1.ColumnSpec.ICorrelatedColumn} message CorrelatedColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CorrelatedColumn.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columnSpecId != null && Object.hasOwnProperty.call(message, "columnSpecId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.columnSpecId); + if (message.correlationStats != null && Object.hasOwnProperty.call(message, "correlationStats")) + $root.google.cloud.automl.v1beta1.CorrelationStats.encode(message.correlationStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CorrelatedColumn message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @static + * @param {google.cloud.automl.v1beta1.ColumnSpec.ICorrelatedColumn} message CorrelatedColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CorrelatedColumn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CorrelatedColumn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn} CorrelatedColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CorrelatedColumn.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.columnSpecId = reader.string(); + break; + } + case 2: { + message.correlationStats = $root.google.cloud.automl.v1beta1.CorrelationStats.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CorrelatedColumn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn} CorrelatedColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CorrelatedColumn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CorrelatedColumn message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CorrelatedColumn.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columnSpecId != null && message.hasOwnProperty("columnSpecId")) + if (!$util.isString(message.columnSpecId)) + return "columnSpecId: string expected"; + if (message.correlationStats != null && message.hasOwnProperty("correlationStats")) { + var error = $root.google.cloud.automl.v1beta1.CorrelationStats.verify(message.correlationStats); + if (error) + return "correlationStats." + error; + } + return null; + }; + + /** + * Creates a CorrelatedColumn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn} CorrelatedColumn + */ + CorrelatedColumn.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn) + return object; + var message = new $root.google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn(); + if (object.columnSpecId != null) + message.columnSpecId = String(object.columnSpecId); + if (object.correlationStats != null) { + if (typeof object.correlationStats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.correlationStats: object expected"); + message.correlationStats = $root.google.cloud.automl.v1beta1.CorrelationStats.fromObject(object.correlationStats); + } + return message; + }; + + /** + * Creates a plain object from a CorrelatedColumn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @static + * @param {google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn} message CorrelatedColumn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CorrelatedColumn.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.columnSpecId = ""; + object.correlationStats = null; + } + if (message.columnSpecId != null && message.hasOwnProperty("columnSpecId")) + object.columnSpecId = message.columnSpecId; + if (message.correlationStats != null && message.hasOwnProperty("correlationStats")) + object.correlationStats = $root.google.cloud.automl.v1beta1.CorrelationStats.toObject(message.correlationStats, options); + return object; + }; + + /** + * Converts this CorrelatedColumn to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @instance + * @returns {Object.} JSON object + */ + CorrelatedColumn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CorrelatedColumn + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CorrelatedColumn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn"; + }; + + return CorrelatedColumn; + })(); + + return ColumnSpec; + })(); + + v1beta1.DataStats = (function() { + + /** + * Properties of a DataStats. + * @memberof google.cloud.automl.v1beta1 + * @interface IDataStats + * @property {google.cloud.automl.v1beta1.IFloat64Stats|null} [float64Stats] DataStats float64Stats + * @property {google.cloud.automl.v1beta1.IStringStats|null} [stringStats] DataStats stringStats + * @property {google.cloud.automl.v1beta1.ITimestampStats|null} [timestampStats] DataStats timestampStats + * @property {google.cloud.automl.v1beta1.IArrayStats|null} [arrayStats] DataStats arrayStats + * @property {google.cloud.automl.v1beta1.IStructStats|null} [structStats] DataStats structStats + * @property {google.cloud.automl.v1beta1.ICategoryStats|null} [categoryStats] DataStats categoryStats + * @property {number|Long|null} [distinctValueCount] DataStats distinctValueCount + * @property {number|Long|null} [nullValueCount] DataStats nullValueCount + * @property {number|Long|null} [validValueCount] DataStats validValueCount + */ + + /** + * Constructs a new DataStats. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a DataStats. + * @implements IDataStats + * @constructor + * @param {google.cloud.automl.v1beta1.IDataStats=} [properties] Properties to set + */ + function DataStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStats float64Stats. + * @member {google.cloud.automl.v1beta1.IFloat64Stats|null|undefined} float64Stats + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + */ + DataStats.prototype.float64Stats = null; + + /** + * DataStats stringStats. + * @member {google.cloud.automl.v1beta1.IStringStats|null|undefined} stringStats + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + */ + DataStats.prototype.stringStats = null; + + /** + * DataStats timestampStats. + * @member {google.cloud.automl.v1beta1.ITimestampStats|null|undefined} timestampStats + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + */ + DataStats.prototype.timestampStats = null; + + /** + * DataStats arrayStats. + * @member {google.cloud.automl.v1beta1.IArrayStats|null|undefined} arrayStats + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + */ + DataStats.prototype.arrayStats = null; + + /** + * DataStats structStats. + * @member {google.cloud.automl.v1beta1.IStructStats|null|undefined} structStats + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + */ + DataStats.prototype.structStats = null; + + /** + * DataStats categoryStats. + * @member {google.cloud.automl.v1beta1.ICategoryStats|null|undefined} categoryStats + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + */ + DataStats.prototype.categoryStats = null; + + /** + * DataStats distinctValueCount. + * @member {number|Long} distinctValueCount + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + */ + DataStats.prototype.distinctValueCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DataStats nullValueCount. + * @member {number|Long} nullValueCount + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + */ + DataStats.prototype.nullValueCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DataStats validValueCount. + * @member {number|Long} validValueCount + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + */ + DataStats.prototype.validValueCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DataStats stats. + * @member {"float64Stats"|"stringStats"|"timestampStats"|"arrayStats"|"structStats"|"categoryStats"|undefined} stats + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + */ + Object.defineProperty(DataStats.prototype, "stats", { + get: $util.oneOfGetter($oneOfFields = ["float64Stats", "stringStats", "timestampStats", "arrayStats", "structStats", "categoryStats"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataStats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.DataStats + * @static + * @param {google.cloud.automl.v1beta1.IDataStats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.DataStats} DataStats instance + */ + DataStats.create = function create(properties) { + return new DataStats(properties); + }; + + /** + * Encodes the specified DataStats message. Does not implicitly {@link google.cloud.automl.v1beta1.DataStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.DataStats + * @static + * @param {google.cloud.automl.v1beta1.IDataStats} message DataStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.distinctValueCount != null && Object.hasOwnProperty.call(message, "distinctValueCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.distinctValueCount); + if (message.nullValueCount != null && Object.hasOwnProperty.call(message, "nullValueCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.nullValueCount); + if (message.float64Stats != null && Object.hasOwnProperty.call(message, "float64Stats")) + $root.google.cloud.automl.v1beta1.Float64Stats.encode(message.float64Stats, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.stringStats != null && Object.hasOwnProperty.call(message, "stringStats")) + $root.google.cloud.automl.v1beta1.StringStats.encode(message.stringStats, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.timestampStats != null && Object.hasOwnProperty.call(message, "timestampStats")) + $root.google.cloud.automl.v1beta1.TimestampStats.encode(message.timestampStats, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.arrayStats != null && Object.hasOwnProperty.call(message, "arrayStats")) + $root.google.cloud.automl.v1beta1.ArrayStats.encode(message.arrayStats, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.structStats != null && Object.hasOwnProperty.call(message, "structStats")) + $root.google.cloud.automl.v1beta1.StructStats.encode(message.structStats, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.categoryStats != null && Object.hasOwnProperty.call(message, "categoryStats")) + $root.google.cloud.automl.v1beta1.CategoryStats.encode(message.categoryStats, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.validValueCount != null && Object.hasOwnProperty.call(message, "validValueCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.validValueCount); + return writer; + }; + + /** + * Encodes the specified DataStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DataStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.DataStats + * @static + * @param {google.cloud.automl.v1beta1.IDataStats} message DataStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.DataStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.DataStats} DataStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.DataStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.float64Stats = $root.google.cloud.automl.v1beta1.Float64Stats.decode(reader, reader.uint32()); + break; + } + case 4: { + message.stringStats = $root.google.cloud.automl.v1beta1.StringStats.decode(reader, reader.uint32()); + break; + } + case 5: { + message.timestampStats = $root.google.cloud.automl.v1beta1.TimestampStats.decode(reader, reader.uint32()); + break; + } + case 6: { + message.arrayStats = $root.google.cloud.automl.v1beta1.ArrayStats.decode(reader, reader.uint32()); + break; + } + case 7: { + message.structStats = $root.google.cloud.automl.v1beta1.StructStats.decode(reader, reader.uint32()); + break; + } + case 8: { + message.categoryStats = $root.google.cloud.automl.v1beta1.CategoryStats.decode(reader, reader.uint32()); + break; + } + case 1: { + message.distinctValueCount = reader.int64(); + break; + } + case 2: { + message.nullValueCount = reader.int64(); + break; + } + case 9: { + message.validValueCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.DataStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.DataStats} DataStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.DataStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.float64Stats != null && message.hasOwnProperty("float64Stats")) { + properties.stats = 1; + { + var error = $root.google.cloud.automl.v1beta1.Float64Stats.verify(message.float64Stats); + if (error) + return "float64Stats." + error; + } + } + if (message.stringStats != null && message.hasOwnProperty("stringStats")) { + if (properties.stats === 1) + return "stats: multiple values"; + properties.stats = 1; + { + var error = $root.google.cloud.automl.v1beta1.StringStats.verify(message.stringStats); + if (error) + return "stringStats." + error; + } + } + if (message.timestampStats != null && message.hasOwnProperty("timestampStats")) { + if (properties.stats === 1) + return "stats: multiple values"; + properties.stats = 1; + { + var error = $root.google.cloud.automl.v1beta1.TimestampStats.verify(message.timestampStats); + if (error) + return "timestampStats." + error; + } + } + if (message.arrayStats != null && message.hasOwnProperty("arrayStats")) { + if (properties.stats === 1) + return "stats: multiple values"; + properties.stats = 1; + { + var error = $root.google.cloud.automl.v1beta1.ArrayStats.verify(message.arrayStats); + if (error) + return "arrayStats." + error; + } + } + if (message.structStats != null && message.hasOwnProperty("structStats")) { + if (properties.stats === 1) + return "stats: multiple values"; + properties.stats = 1; + { + var error = $root.google.cloud.automl.v1beta1.StructStats.verify(message.structStats); + if (error) + return "structStats." + error; + } + } + if (message.categoryStats != null && message.hasOwnProperty("categoryStats")) { + if (properties.stats === 1) + return "stats: multiple values"; + properties.stats = 1; + { + var error = $root.google.cloud.automl.v1beta1.CategoryStats.verify(message.categoryStats); + if (error) + return "categoryStats." + error; + } + } + if (message.distinctValueCount != null && message.hasOwnProperty("distinctValueCount")) + if (!$util.isInteger(message.distinctValueCount) && !(message.distinctValueCount && $util.isInteger(message.distinctValueCount.low) && $util.isInteger(message.distinctValueCount.high))) + return "distinctValueCount: integer|Long expected"; + if (message.nullValueCount != null && message.hasOwnProperty("nullValueCount")) + if (!$util.isInteger(message.nullValueCount) && !(message.nullValueCount && $util.isInteger(message.nullValueCount.low) && $util.isInteger(message.nullValueCount.high))) + return "nullValueCount: integer|Long expected"; + if (message.validValueCount != null && message.hasOwnProperty("validValueCount")) + if (!$util.isInteger(message.validValueCount) && !(message.validValueCount && $util.isInteger(message.validValueCount.low) && $util.isInteger(message.validValueCount.high))) + return "validValueCount: integer|Long expected"; + return null; + }; + + /** + * Creates a DataStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.DataStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.DataStats} DataStats + */ + DataStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.DataStats) + return object; + var message = new $root.google.cloud.automl.v1beta1.DataStats(); + if (object.float64Stats != null) { + if (typeof object.float64Stats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DataStats.float64Stats: object expected"); + message.float64Stats = $root.google.cloud.automl.v1beta1.Float64Stats.fromObject(object.float64Stats); + } + if (object.stringStats != null) { + if (typeof object.stringStats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DataStats.stringStats: object expected"); + message.stringStats = $root.google.cloud.automl.v1beta1.StringStats.fromObject(object.stringStats); + } + if (object.timestampStats != null) { + if (typeof object.timestampStats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DataStats.timestampStats: object expected"); + message.timestampStats = $root.google.cloud.automl.v1beta1.TimestampStats.fromObject(object.timestampStats); + } + if (object.arrayStats != null) { + if (typeof object.arrayStats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DataStats.arrayStats: object expected"); + message.arrayStats = $root.google.cloud.automl.v1beta1.ArrayStats.fromObject(object.arrayStats); + } + if (object.structStats != null) { + if (typeof object.structStats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DataStats.structStats: object expected"); + message.structStats = $root.google.cloud.automl.v1beta1.StructStats.fromObject(object.structStats); + } + if (object.categoryStats != null) { + if (typeof object.categoryStats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DataStats.categoryStats: object expected"); + message.categoryStats = $root.google.cloud.automl.v1beta1.CategoryStats.fromObject(object.categoryStats); + } + if (object.distinctValueCount != null) + if ($util.Long) + (message.distinctValueCount = $util.Long.fromValue(object.distinctValueCount)).unsigned = false; + else if (typeof object.distinctValueCount === "string") + message.distinctValueCount = parseInt(object.distinctValueCount, 10); + else if (typeof object.distinctValueCount === "number") + message.distinctValueCount = object.distinctValueCount; + else if (typeof object.distinctValueCount === "object") + message.distinctValueCount = new $util.LongBits(object.distinctValueCount.low >>> 0, object.distinctValueCount.high >>> 0).toNumber(); + if (object.nullValueCount != null) + if ($util.Long) + (message.nullValueCount = $util.Long.fromValue(object.nullValueCount)).unsigned = false; + else if (typeof object.nullValueCount === "string") + message.nullValueCount = parseInt(object.nullValueCount, 10); + else if (typeof object.nullValueCount === "number") + message.nullValueCount = object.nullValueCount; + else if (typeof object.nullValueCount === "object") + message.nullValueCount = new $util.LongBits(object.nullValueCount.low >>> 0, object.nullValueCount.high >>> 0).toNumber(); + if (object.validValueCount != null) + if ($util.Long) + (message.validValueCount = $util.Long.fromValue(object.validValueCount)).unsigned = false; + else if (typeof object.validValueCount === "string") + message.validValueCount = parseInt(object.validValueCount, 10); + else if (typeof object.validValueCount === "number") + message.validValueCount = object.validValueCount; + else if (typeof object.validValueCount === "object") + message.validValueCount = new $util.LongBits(object.validValueCount.low >>> 0, object.validValueCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a DataStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.DataStats + * @static + * @param {google.cloud.automl.v1beta1.DataStats} message DataStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStats.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.distinctValueCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.distinctValueCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.nullValueCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nullValueCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.validValueCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.validValueCount = options.longs === String ? "0" : 0; + } + if (message.distinctValueCount != null && message.hasOwnProperty("distinctValueCount")) + if (typeof message.distinctValueCount === "number") + object.distinctValueCount = options.longs === String ? String(message.distinctValueCount) : message.distinctValueCount; + else + object.distinctValueCount = options.longs === String ? $util.Long.prototype.toString.call(message.distinctValueCount) : options.longs === Number ? new $util.LongBits(message.distinctValueCount.low >>> 0, message.distinctValueCount.high >>> 0).toNumber() : message.distinctValueCount; + if (message.nullValueCount != null && message.hasOwnProperty("nullValueCount")) + if (typeof message.nullValueCount === "number") + object.nullValueCount = options.longs === String ? String(message.nullValueCount) : message.nullValueCount; + else + object.nullValueCount = options.longs === String ? $util.Long.prototype.toString.call(message.nullValueCount) : options.longs === Number ? new $util.LongBits(message.nullValueCount.low >>> 0, message.nullValueCount.high >>> 0).toNumber() : message.nullValueCount; + if (message.float64Stats != null && message.hasOwnProperty("float64Stats")) { + object.float64Stats = $root.google.cloud.automl.v1beta1.Float64Stats.toObject(message.float64Stats, options); + if (options.oneofs) + object.stats = "float64Stats"; + } + if (message.stringStats != null && message.hasOwnProperty("stringStats")) { + object.stringStats = $root.google.cloud.automl.v1beta1.StringStats.toObject(message.stringStats, options); + if (options.oneofs) + object.stats = "stringStats"; + } + if (message.timestampStats != null && message.hasOwnProperty("timestampStats")) { + object.timestampStats = $root.google.cloud.automl.v1beta1.TimestampStats.toObject(message.timestampStats, options); + if (options.oneofs) + object.stats = "timestampStats"; + } + if (message.arrayStats != null && message.hasOwnProperty("arrayStats")) { + object.arrayStats = $root.google.cloud.automl.v1beta1.ArrayStats.toObject(message.arrayStats, options); + if (options.oneofs) + object.stats = "arrayStats"; + } + if (message.structStats != null && message.hasOwnProperty("structStats")) { + object.structStats = $root.google.cloud.automl.v1beta1.StructStats.toObject(message.structStats, options); + if (options.oneofs) + object.stats = "structStats"; + } + if (message.categoryStats != null && message.hasOwnProperty("categoryStats")) { + object.categoryStats = $root.google.cloud.automl.v1beta1.CategoryStats.toObject(message.categoryStats, options); + if (options.oneofs) + object.stats = "categoryStats"; + } + if (message.validValueCount != null && message.hasOwnProperty("validValueCount")) + if (typeof message.validValueCount === "number") + object.validValueCount = options.longs === String ? String(message.validValueCount) : message.validValueCount; + else + object.validValueCount = options.longs === String ? $util.Long.prototype.toString.call(message.validValueCount) : options.longs === Number ? new $util.LongBits(message.validValueCount.low >>> 0, message.validValueCount.high >>> 0).toNumber() : message.validValueCount; + return object; + }; + + /** + * Converts this DataStats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + * @returns {Object.} JSON object + */ + DataStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.DataStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.DataStats"; + }; + + return DataStats; + })(); + + v1beta1.Float64Stats = (function() { + + /** + * Properties of a Float64Stats. + * @memberof google.cloud.automl.v1beta1 + * @interface IFloat64Stats + * @property {number|null} [mean] Float64Stats mean + * @property {number|null} [standardDeviation] Float64Stats standardDeviation + * @property {Array.|null} [quantiles] Float64Stats quantiles + * @property {Array.|null} [histogramBuckets] Float64Stats histogramBuckets + */ + + /** + * Constructs a new Float64Stats. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a Float64Stats. + * @implements IFloat64Stats + * @constructor + * @param {google.cloud.automl.v1beta1.IFloat64Stats=} [properties] Properties to set + */ + function Float64Stats(properties) { + this.quantiles = []; + this.histogramBuckets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Float64Stats mean. + * @member {number} mean + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @instance + */ + Float64Stats.prototype.mean = 0; + + /** + * Float64Stats standardDeviation. + * @member {number} standardDeviation + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @instance + */ + Float64Stats.prototype.standardDeviation = 0; + + /** + * Float64Stats quantiles. + * @member {Array.} quantiles + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @instance + */ + Float64Stats.prototype.quantiles = $util.emptyArray; + + /** + * Float64Stats histogramBuckets. + * @member {Array.} histogramBuckets + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @instance + */ + Float64Stats.prototype.histogramBuckets = $util.emptyArray; + + /** + * Creates a new Float64Stats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @static + * @param {google.cloud.automl.v1beta1.IFloat64Stats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.Float64Stats} Float64Stats instance + */ + Float64Stats.create = function create(properties) { + return new Float64Stats(properties); + }; + + /** + * Encodes the specified Float64Stats message. Does not implicitly {@link google.cloud.automl.v1beta1.Float64Stats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @static + * @param {google.cloud.automl.v1beta1.IFloat64Stats} message Float64Stats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float64Stats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mean != null && Object.hasOwnProperty.call(message, "mean")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.mean); + if (message.standardDeviation != null && Object.hasOwnProperty.call(message, "standardDeviation")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.standardDeviation); + if (message.quantiles != null && message.quantiles.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.quantiles.length; ++i) + writer.double(message.quantiles[i]); + writer.ldelim(); + } + if (message.histogramBuckets != null && message.histogramBuckets.length) + for (var i = 0; i < message.histogramBuckets.length; ++i) + $root.google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.encode(message.histogramBuckets[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Float64Stats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Float64Stats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @static + * @param {google.cloud.automl.v1beta1.IFloat64Stats} message Float64Stats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float64Stats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Float64Stats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.Float64Stats} Float64Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float64Stats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.Float64Stats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mean = reader.double(); + break; + } + case 2: { + message.standardDeviation = reader.double(); + break; + } + case 3: { + if (!(message.quantiles && message.quantiles.length)) + message.quantiles = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.quantiles.push(reader.double()); + } else + message.quantiles.push(reader.double()); + break; + } + case 4: { + if (!(message.histogramBuckets && message.histogramBuckets.length)) + message.histogramBuckets = []; + message.histogramBuckets.push($root.google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Float64Stats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.Float64Stats} Float64Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float64Stats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Float64Stats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Float64Stats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mean != null && message.hasOwnProperty("mean")) + if (typeof message.mean !== "number") + return "mean: number expected"; + if (message.standardDeviation != null && message.hasOwnProperty("standardDeviation")) + if (typeof message.standardDeviation !== "number") + return "standardDeviation: number expected"; + if (message.quantiles != null && message.hasOwnProperty("quantiles")) { + if (!Array.isArray(message.quantiles)) + return "quantiles: array expected"; + for (var i = 0; i < message.quantiles.length; ++i) + if (typeof message.quantiles[i] !== "number") + return "quantiles: number[] expected"; + } + if (message.histogramBuckets != null && message.hasOwnProperty("histogramBuckets")) { + if (!Array.isArray(message.histogramBuckets)) + return "histogramBuckets: array expected"; + for (var i = 0; i < message.histogramBuckets.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.verify(message.histogramBuckets[i]); + if (error) + return "histogramBuckets." + error; + } + } + return null; + }; + + /** + * Creates a Float64Stats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.Float64Stats} Float64Stats + */ + Float64Stats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.Float64Stats) + return object; + var message = new $root.google.cloud.automl.v1beta1.Float64Stats(); + if (object.mean != null) + message.mean = Number(object.mean); + if (object.standardDeviation != null) + message.standardDeviation = Number(object.standardDeviation); + if (object.quantiles) { + if (!Array.isArray(object.quantiles)) + throw TypeError(".google.cloud.automl.v1beta1.Float64Stats.quantiles: array expected"); + message.quantiles = []; + for (var i = 0; i < object.quantiles.length; ++i) + message.quantiles[i] = Number(object.quantiles[i]); + } + if (object.histogramBuckets) { + if (!Array.isArray(object.histogramBuckets)) + throw TypeError(".google.cloud.automl.v1beta1.Float64Stats.histogramBuckets: array expected"); + message.histogramBuckets = []; + for (var i = 0; i < object.histogramBuckets.length; ++i) { + if (typeof object.histogramBuckets[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Float64Stats.histogramBuckets: object expected"); + message.histogramBuckets[i] = $root.google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.fromObject(object.histogramBuckets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Float64Stats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @static + * @param {google.cloud.automl.v1beta1.Float64Stats} message Float64Stats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Float64Stats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.quantiles = []; + object.histogramBuckets = []; + } + if (options.defaults) { + object.mean = 0; + object.standardDeviation = 0; + } + if (message.mean != null && message.hasOwnProperty("mean")) + object.mean = options.json && !isFinite(message.mean) ? String(message.mean) : message.mean; + if (message.standardDeviation != null && message.hasOwnProperty("standardDeviation")) + object.standardDeviation = options.json && !isFinite(message.standardDeviation) ? String(message.standardDeviation) : message.standardDeviation; + if (message.quantiles && message.quantiles.length) { + object.quantiles = []; + for (var j = 0; j < message.quantiles.length; ++j) + object.quantiles[j] = options.json && !isFinite(message.quantiles[j]) ? String(message.quantiles[j]) : message.quantiles[j]; + } + if (message.histogramBuckets && message.histogramBuckets.length) { + object.histogramBuckets = []; + for (var j = 0; j < message.histogramBuckets.length; ++j) + object.histogramBuckets[j] = $root.google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.toObject(message.histogramBuckets[j], options); + } + return object; + }; + + /** + * Converts this Float64Stats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @instance + * @returns {Object.} JSON object + */ + Float64Stats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Float64Stats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Float64Stats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.Float64Stats"; + }; + + Float64Stats.HistogramBucket = (function() { + + /** + * Properties of a HistogramBucket. + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @interface IHistogramBucket + * @property {number|null} [min] HistogramBucket min + * @property {number|null} [max] HistogramBucket max + * @property {number|Long|null} [count] HistogramBucket count + */ + + /** + * Constructs a new HistogramBucket. + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @classdesc Represents a HistogramBucket. + * @implements IHistogramBucket + * @constructor + * @param {google.cloud.automl.v1beta1.Float64Stats.IHistogramBucket=} [properties] Properties to set + */ + function HistogramBucket(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HistogramBucket min. + * @member {number} min + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @instance + */ + HistogramBucket.prototype.min = 0; + + /** + * HistogramBucket max. + * @member {number} max + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @instance + */ + HistogramBucket.prototype.max = 0; + + /** + * HistogramBucket count. + * @member {number|Long} count + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @instance + */ + HistogramBucket.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new HistogramBucket instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @static + * @param {google.cloud.automl.v1beta1.Float64Stats.IHistogramBucket=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.Float64Stats.HistogramBucket} HistogramBucket instance + */ + HistogramBucket.create = function create(properties) { + return new HistogramBucket(properties); + }; + + /** + * Encodes the specified HistogramBucket message. Does not implicitly {@link google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @static + * @param {google.cloud.automl.v1beta1.Float64Stats.IHistogramBucket} message HistogramBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramBucket.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.min != null && Object.hasOwnProperty.call(message, "min")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.min); + if (message.max != null && Object.hasOwnProperty.call(message, "max")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.max); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.count); + return writer; + }; + + /** + * Encodes the specified HistogramBucket message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @static + * @param {google.cloud.automl.v1beta1.Float64Stats.IHistogramBucket} message HistogramBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramBucket.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HistogramBucket message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.Float64Stats.HistogramBucket} HistogramBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramBucket.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.Float64Stats.HistogramBucket(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.min = reader.double(); + break; + } + case 2: { + message.max = reader.double(); + break; + } + case 3: { + message.count = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HistogramBucket message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.Float64Stats.HistogramBucket} HistogramBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramBucket.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HistogramBucket message. + * @function verify + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HistogramBucket.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.min != null && message.hasOwnProperty("min")) + if (typeof message.min !== "number") + return "min: number expected"; + if (message.max != null && message.hasOwnProperty("max")) + if (typeof message.max !== "number") + return "max: number expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates a HistogramBucket message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.Float64Stats.HistogramBucket} HistogramBucket + */ + HistogramBucket.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.Float64Stats.HistogramBucket) + return object; + var message = new $root.google.cloud.automl.v1beta1.Float64Stats.HistogramBucket(); + if (object.min != null) + message.min = Number(object.min); + if (object.max != null) + message.max = Number(object.max); + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a HistogramBucket message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @static + * @param {google.cloud.automl.v1beta1.Float64Stats.HistogramBucket} message HistogramBucket + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HistogramBucket.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.min = 0; + object.max = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + } + if (message.min != null && message.hasOwnProperty("min")) + object.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; + if (message.max != null && message.hasOwnProperty("max")) + object.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; + + /** + * Converts this HistogramBucket to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @instance + * @returns {Object.} JSON object + */ + HistogramBucket.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HistogramBucket + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HistogramBucket.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.Float64Stats.HistogramBucket"; + }; + + return HistogramBucket; + })(); + + return Float64Stats; + })(); + + v1beta1.StringStats = (function() { + + /** + * Properties of a StringStats. + * @memberof google.cloud.automl.v1beta1 + * @interface IStringStats + * @property {Array.|null} [topUnigramStats] StringStats topUnigramStats + */ + + /** + * Constructs a new StringStats. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a StringStats. + * @implements IStringStats + * @constructor + * @param {google.cloud.automl.v1beta1.IStringStats=} [properties] Properties to set + */ + function StringStats(properties) { + this.topUnigramStats = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringStats topUnigramStats. + * @member {Array.} topUnigramStats + * @memberof google.cloud.automl.v1beta1.StringStats + * @instance + */ + StringStats.prototype.topUnigramStats = $util.emptyArray; + + /** + * Creates a new StringStats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.StringStats + * @static + * @param {google.cloud.automl.v1beta1.IStringStats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.StringStats} StringStats instance + */ + StringStats.create = function create(properties) { + return new StringStats(properties); + }; + + /** + * Encodes the specified StringStats message. Does not implicitly {@link google.cloud.automl.v1beta1.StringStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.StringStats + * @static + * @param {google.cloud.automl.v1beta1.IStringStats} message StringStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topUnigramStats != null && message.topUnigramStats.length) + for (var i = 0; i < message.topUnigramStats.length; ++i) + $root.google.cloud.automl.v1beta1.StringStats.UnigramStats.encode(message.topUnigramStats[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StringStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.StringStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.StringStats + * @static + * @param {google.cloud.automl.v1beta1.IStringStats} message StringStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.StringStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.StringStats} StringStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.StringStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.topUnigramStats && message.topUnigramStats.length)) + message.topUnigramStats = []; + message.topUnigramStats.push($root.google.cloud.automl.v1beta1.StringStats.UnigramStats.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.StringStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.StringStats} StringStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringStats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.StringStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topUnigramStats != null && message.hasOwnProperty("topUnigramStats")) { + if (!Array.isArray(message.topUnigramStats)) + return "topUnigramStats: array expected"; + for (var i = 0; i < message.topUnigramStats.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.StringStats.UnigramStats.verify(message.topUnigramStats[i]); + if (error) + return "topUnigramStats." + error; + } + } + return null; + }; + + /** + * Creates a StringStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.StringStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.StringStats} StringStats + */ + StringStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.StringStats) + return object; + var message = new $root.google.cloud.automl.v1beta1.StringStats(); + if (object.topUnigramStats) { + if (!Array.isArray(object.topUnigramStats)) + throw TypeError(".google.cloud.automl.v1beta1.StringStats.topUnigramStats: array expected"); + message.topUnigramStats = []; + for (var i = 0; i < object.topUnigramStats.length; ++i) { + if (typeof object.topUnigramStats[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.StringStats.topUnigramStats: object expected"); + message.topUnigramStats[i] = $root.google.cloud.automl.v1beta1.StringStats.UnigramStats.fromObject(object.topUnigramStats[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a StringStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.StringStats + * @static + * @param {google.cloud.automl.v1beta1.StringStats} message StringStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.topUnigramStats = []; + if (message.topUnigramStats && message.topUnigramStats.length) { + object.topUnigramStats = []; + for (var j = 0; j < message.topUnigramStats.length; ++j) + object.topUnigramStats[j] = $root.google.cloud.automl.v1beta1.StringStats.UnigramStats.toObject(message.topUnigramStats[j], options); + } + return object; + }; + + /** + * Converts this StringStats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.StringStats + * @instance + * @returns {Object.} JSON object + */ + StringStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringStats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.StringStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.StringStats"; + }; + + StringStats.UnigramStats = (function() { + + /** + * Properties of an UnigramStats. + * @memberof google.cloud.automl.v1beta1.StringStats + * @interface IUnigramStats + * @property {string|null} [value] UnigramStats value + * @property {number|Long|null} [count] UnigramStats count + */ + + /** + * Constructs a new UnigramStats. + * @memberof google.cloud.automl.v1beta1.StringStats + * @classdesc Represents an UnigramStats. + * @implements IUnigramStats + * @constructor + * @param {google.cloud.automl.v1beta1.StringStats.IUnigramStats=} [properties] Properties to set + */ + function UnigramStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UnigramStats value. + * @member {string} value + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @instance + */ + UnigramStats.prototype.value = ""; + + /** + * UnigramStats count. + * @member {number|Long} count + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @instance + */ + UnigramStats.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new UnigramStats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @static + * @param {google.cloud.automl.v1beta1.StringStats.IUnigramStats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.StringStats.UnigramStats} UnigramStats instance + */ + UnigramStats.create = function create(properties) { + return new UnigramStats(properties); + }; + + /** + * Encodes the specified UnigramStats message. Does not implicitly {@link google.cloud.automl.v1beta1.StringStats.UnigramStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @static + * @param {google.cloud.automl.v1beta1.StringStats.IUnigramStats} message UnigramStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnigramStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + return writer; + }; + + /** + * Encodes the specified UnigramStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.StringStats.UnigramStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @static + * @param {google.cloud.automl.v1beta1.StringStats.IUnigramStats} message UnigramStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnigramStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnigramStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.StringStats.UnigramStats} UnigramStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnigramStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.StringStats.UnigramStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + case 2: { + message.count = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UnigramStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.StringStats.UnigramStats} UnigramStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnigramStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnigramStats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnigramStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates an UnigramStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.StringStats.UnigramStats} UnigramStats + */ + UnigramStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.StringStats.UnigramStats) + return object; + var message = new $root.google.cloud.automl.v1beta1.StringStats.UnigramStats(); + if (object.value != null) + message.value = String(object.value); + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an UnigramStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @static + * @param {google.cloud.automl.v1beta1.StringStats.UnigramStats} message UnigramStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnigramStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; + + /** + * Converts this UnigramStats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @instance + * @returns {Object.} JSON object + */ + UnigramStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UnigramStats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UnigramStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.StringStats.UnigramStats"; + }; + + return UnigramStats; + })(); + + return StringStats; + })(); + + v1beta1.TimestampStats = (function() { + + /** + * Properties of a TimestampStats. + * @memberof google.cloud.automl.v1beta1 + * @interface ITimestampStats + * @property {Object.|null} [granularStats] TimestampStats granularStats + */ + + /** + * Constructs a new TimestampStats. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TimestampStats. + * @implements ITimestampStats + * @constructor + * @param {google.cloud.automl.v1beta1.ITimestampStats=} [properties] Properties to set + */ + function TimestampStats(properties) { + this.granularStats = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimestampStats granularStats. + * @member {Object.} granularStats + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @instance + */ + TimestampStats.prototype.granularStats = $util.emptyObject; + + /** + * Creates a new TimestampStats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @static + * @param {google.cloud.automl.v1beta1.ITimestampStats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TimestampStats} TimestampStats instance + */ + TimestampStats.create = function create(properties) { + return new TimestampStats(properties); + }; + + /** + * Encodes the specified TimestampStats message. Does not implicitly {@link google.cloud.automl.v1beta1.TimestampStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @static + * @param {google.cloud.automl.v1beta1.ITimestampStats} message TimestampStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.granularStats != null && Object.hasOwnProperty.call(message, "granularStats")) + for (var keys = Object.keys(message.granularStats), 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.automl.v1beta1.TimestampStats.GranularStats.encode(message.granularStats[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified TimestampStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TimestampStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @static + * @param {google.cloud.automl.v1beta1.ITimestampStats} message TimestampStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimestampStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TimestampStats} TimestampStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TimestampStats(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.granularStats === $util.emptyObject) + message.granularStats = {}; + 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.automl.v1beta1.TimestampStats.GranularStats.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.granularStats[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimestampStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TimestampStats} TimestampStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimestampStats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimestampStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.granularStats != null && message.hasOwnProperty("granularStats")) { + if (!$util.isObject(message.granularStats)) + return "granularStats: object expected"; + var key = Object.keys(message.granularStats); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.TimestampStats.GranularStats.verify(message.granularStats[key[i]]); + if (error) + return "granularStats." + error; + } + } + return null; + }; + + /** + * Creates a TimestampStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TimestampStats} TimestampStats + */ + TimestampStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TimestampStats) + return object; + var message = new $root.google.cloud.automl.v1beta1.TimestampStats(); + if (object.granularStats) { + if (typeof object.granularStats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TimestampStats.granularStats: object expected"); + message.granularStats = {}; + for (var keys = Object.keys(object.granularStats), i = 0; i < keys.length; ++i) { + if (typeof object.granularStats[keys[i]] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TimestampStats.granularStats: object expected"); + message.granularStats[keys[i]] = $root.google.cloud.automl.v1beta1.TimestampStats.GranularStats.fromObject(object.granularStats[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a TimestampStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @static + * @param {google.cloud.automl.v1beta1.TimestampStats} message TimestampStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimestampStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.granularStats = {}; + var keys2; + if (message.granularStats && (keys2 = Object.keys(message.granularStats)).length) { + object.granularStats = {}; + for (var j = 0; j < keys2.length; ++j) + object.granularStats[keys2[j]] = $root.google.cloud.automl.v1beta1.TimestampStats.GranularStats.toObject(message.granularStats[keys2[j]], options); + } + return object; + }; + + /** + * Converts this TimestampStats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @instance + * @returns {Object.} JSON object + */ + TimestampStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimestampStats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TimestampStats"; + }; + + TimestampStats.GranularStats = (function() { + + /** + * Properties of a GranularStats. + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @interface IGranularStats + * @property {Object.|null} [buckets] GranularStats buckets + */ + + /** + * Constructs a new GranularStats. + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @classdesc Represents a GranularStats. + * @implements IGranularStats + * @constructor + * @param {google.cloud.automl.v1beta1.TimestampStats.IGranularStats=} [properties] Properties to set + */ + function GranularStats(properties) { + this.buckets = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GranularStats buckets. + * @member {Object.} buckets + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @instance + */ + GranularStats.prototype.buckets = $util.emptyObject; + + /** + * Creates a new GranularStats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @static + * @param {google.cloud.automl.v1beta1.TimestampStats.IGranularStats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TimestampStats.GranularStats} GranularStats instance + */ + GranularStats.create = function create(properties) { + return new GranularStats(properties); + }; + + /** + * Encodes the specified GranularStats message. Does not implicitly {@link google.cloud.automl.v1beta1.TimestampStats.GranularStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @static + * @param {google.cloud.automl.v1beta1.TimestampStats.IGranularStats} message GranularStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GranularStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.buckets != null && Object.hasOwnProperty.call(message, "buckets")) + for (var keys = Object.keys(message.buckets), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.buckets[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified GranularStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TimestampStats.GranularStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @static + * @param {google.cloud.automl.v1beta1.TimestampStats.IGranularStats} message GranularStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GranularStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GranularStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TimestampStats.GranularStats} GranularStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GranularStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TimestampStats.GranularStats(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.buckets === $util.emptyObject) + message.buckets = {}; + var end2 = reader.uint32() + reader.pos; + key = 0; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.int32(); + break; + case 2: + value = reader.int64(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.buckets[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GranularStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TimestampStats.GranularStats} GranularStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GranularStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GranularStats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GranularStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.buckets != null && message.hasOwnProperty("buckets")) { + if (!$util.isObject(message.buckets)) + return "buckets: object expected"; + var key = Object.keys(message.buckets); + for (var i = 0; i < key.length; ++i) { + if (!$util.key32Re.test(key[i])) + return "buckets: integer key{k:int32} expected"; + if (!$util.isInteger(message.buckets[key[i]]) && !(message.buckets[key[i]] && $util.isInteger(message.buckets[key[i]].low) && $util.isInteger(message.buckets[key[i]].high))) + return "buckets: integer|Long{k:int32} expected"; + } + } + return null; + }; + + /** + * Creates a GranularStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TimestampStats.GranularStats} GranularStats + */ + GranularStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TimestampStats.GranularStats) + return object; + var message = new $root.google.cloud.automl.v1beta1.TimestampStats.GranularStats(); + if (object.buckets) { + if (typeof object.buckets !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TimestampStats.GranularStats.buckets: object expected"); + message.buckets = {}; + for (var keys = Object.keys(object.buckets), i = 0; i < keys.length; ++i) + if ($util.Long) + (message.buckets[keys[i]] = $util.Long.fromValue(object.buckets[keys[i]])).unsigned = false; + else if (typeof object.buckets[keys[i]] === "string") + message.buckets[keys[i]] = parseInt(object.buckets[keys[i]], 10); + else if (typeof object.buckets[keys[i]] === "number") + message.buckets[keys[i]] = object.buckets[keys[i]]; + else if (typeof object.buckets[keys[i]] === "object") + message.buckets[keys[i]] = new $util.LongBits(object.buckets[keys[i]].low >>> 0, object.buckets[keys[i]].high >>> 0).toNumber(); + } + return message; + }; + + /** + * Creates a plain object from a GranularStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @static + * @param {google.cloud.automl.v1beta1.TimestampStats.GranularStats} message GranularStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GranularStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.buckets = {}; + var keys2; + if (message.buckets && (keys2 = Object.keys(message.buckets)).length) { + object.buckets = {}; + for (var j = 0; j < keys2.length; ++j) + if (typeof message.buckets[keys2[j]] === "number") + object.buckets[keys2[j]] = options.longs === String ? String(message.buckets[keys2[j]]) : message.buckets[keys2[j]]; + else + object.buckets[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.buckets[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.buckets[keys2[j]].low >>> 0, message.buckets[keys2[j]].high >>> 0).toNumber() : message.buckets[keys2[j]]; + } + return object; + }; + + /** + * Converts this GranularStats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @instance + * @returns {Object.} JSON object + */ + GranularStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GranularStats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GranularStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TimestampStats.GranularStats"; + }; + + return GranularStats; + })(); + + return TimestampStats; + })(); + + v1beta1.ArrayStats = (function() { + + /** + * Properties of an ArrayStats. + * @memberof google.cloud.automl.v1beta1 + * @interface IArrayStats + * @property {google.cloud.automl.v1beta1.IDataStats|null} [memberStats] ArrayStats memberStats + */ + + /** + * Constructs a new ArrayStats. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ArrayStats. + * @implements IArrayStats + * @constructor + * @param {google.cloud.automl.v1beta1.IArrayStats=} [properties] Properties to set + */ + function ArrayStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArrayStats memberStats. + * @member {google.cloud.automl.v1beta1.IDataStats|null|undefined} memberStats + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @instance + */ + ArrayStats.prototype.memberStats = null; + + /** + * Creates a new ArrayStats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @static + * @param {google.cloud.automl.v1beta1.IArrayStats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ArrayStats} ArrayStats instance + */ + ArrayStats.create = function create(properties) { + return new ArrayStats(properties); + }; + + /** + * Encodes the specified ArrayStats message. Does not implicitly {@link google.cloud.automl.v1beta1.ArrayStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @static + * @param {google.cloud.automl.v1beta1.IArrayStats} message ArrayStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrayStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.memberStats != null && Object.hasOwnProperty.call(message, "memberStats")) + $root.google.cloud.automl.v1beta1.DataStats.encode(message.memberStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ArrayStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ArrayStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @static + * @param {google.cloud.automl.v1beta1.IArrayStats} message ArrayStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrayStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ArrayStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ArrayStats} ArrayStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrayStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ArrayStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.memberStats = $root.google.cloud.automl.v1beta1.DataStats.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ArrayStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ArrayStats} ArrayStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrayStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArrayStats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArrayStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.memberStats != null && message.hasOwnProperty("memberStats")) { + var error = $root.google.cloud.automl.v1beta1.DataStats.verify(message.memberStats); + if (error) + return "memberStats." + error; + } + return null; + }; + + /** + * Creates an ArrayStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ArrayStats} ArrayStats + */ + ArrayStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ArrayStats) + return object; + var message = new $root.google.cloud.automl.v1beta1.ArrayStats(); + if (object.memberStats != null) { + if (typeof object.memberStats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ArrayStats.memberStats: object expected"); + message.memberStats = $root.google.cloud.automl.v1beta1.DataStats.fromObject(object.memberStats); + } + return message; + }; + + /** + * Creates a plain object from an ArrayStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @static + * @param {google.cloud.automl.v1beta1.ArrayStats} message ArrayStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArrayStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.memberStats = null; + if (message.memberStats != null && message.hasOwnProperty("memberStats")) + object.memberStats = $root.google.cloud.automl.v1beta1.DataStats.toObject(message.memberStats, options); + return object; + }; + + /** + * Converts this ArrayStats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @instance + * @returns {Object.} JSON object + */ + ArrayStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ArrayStats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArrayStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ArrayStats"; + }; + + return ArrayStats; + })(); + + v1beta1.StructStats = (function() { + + /** + * Properties of a StructStats. + * @memberof google.cloud.automl.v1beta1 + * @interface IStructStats + * @property {Object.|null} [fieldStats] StructStats fieldStats + */ + + /** + * Constructs a new StructStats. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a StructStats. + * @implements IStructStats + * @constructor + * @param {google.cloud.automl.v1beta1.IStructStats=} [properties] Properties to set + */ + function StructStats(properties) { + this.fieldStats = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StructStats fieldStats. + * @member {Object.} fieldStats + * @memberof google.cloud.automl.v1beta1.StructStats + * @instance + */ + StructStats.prototype.fieldStats = $util.emptyObject; + + /** + * Creates a new StructStats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.StructStats + * @static + * @param {google.cloud.automl.v1beta1.IStructStats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.StructStats} StructStats instance + */ + StructStats.create = function create(properties) { + return new StructStats(properties); + }; + + /** + * Encodes the specified StructStats message. Does not implicitly {@link google.cloud.automl.v1beta1.StructStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.StructStats + * @static + * @param {google.cloud.automl.v1beta1.IStructStats} message StructStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldStats != null && Object.hasOwnProperty.call(message, "fieldStats")) + for (var keys = Object.keys(message.fieldStats), 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.automl.v1beta1.DataStats.encode(message.fieldStats[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified StructStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.StructStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.StructStats + * @static + * @param {google.cloud.automl.v1beta1.IStructStats} message StructStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StructStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.StructStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.StructStats} StructStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.StructStats(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fieldStats === $util.emptyObject) + message.fieldStats = {}; + 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.automl.v1beta1.DataStats.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fieldStats[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StructStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.StructStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.StructStats} StructStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StructStats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.StructStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StructStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldStats != null && message.hasOwnProperty("fieldStats")) { + if (!$util.isObject(message.fieldStats)) + return "fieldStats: object expected"; + var key = Object.keys(message.fieldStats); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.DataStats.verify(message.fieldStats[key[i]]); + if (error) + return "fieldStats." + error; + } + } + return null; + }; + + /** + * Creates a StructStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.StructStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.StructStats} StructStats + */ + StructStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.StructStats) + return object; + var message = new $root.google.cloud.automl.v1beta1.StructStats(); + if (object.fieldStats) { + if (typeof object.fieldStats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.StructStats.fieldStats: object expected"); + message.fieldStats = {}; + for (var keys = Object.keys(object.fieldStats), i = 0; i < keys.length; ++i) { + if (typeof object.fieldStats[keys[i]] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.StructStats.fieldStats: object expected"); + message.fieldStats[keys[i]] = $root.google.cloud.automl.v1beta1.DataStats.fromObject(object.fieldStats[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a StructStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.StructStats + * @static + * @param {google.cloud.automl.v1beta1.StructStats} message StructStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StructStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fieldStats = {}; + var keys2; + if (message.fieldStats && (keys2 = Object.keys(message.fieldStats)).length) { + object.fieldStats = {}; + for (var j = 0; j < keys2.length; ++j) + object.fieldStats[keys2[j]] = $root.google.cloud.automl.v1beta1.DataStats.toObject(message.fieldStats[keys2[j]], options); + } + return object; + }; + + /** + * Converts this StructStats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.StructStats + * @instance + * @returns {Object.} JSON object + */ + StructStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StructStats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.StructStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StructStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.StructStats"; + }; + + return StructStats; + })(); + + v1beta1.CategoryStats = (function() { + + /** + * Properties of a CategoryStats. + * @memberof google.cloud.automl.v1beta1 + * @interface ICategoryStats + * @property {Array.|null} [topCategoryStats] CategoryStats topCategoryStats + */ + + /** + * Constructs a new CategoryStats. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a CategoryStats. + * @implements ICategoryStats + * @constructor + * @param {google.cloud.automl.v1beta1.ICategoryStats=} [properties] Properties to set + */ + function CategoryStats(properties) { + this.topCategoryStats = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CategoryStats topCategoryStats. + * @member {Array.} topCategoryStats + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @instance + */ + CategoryStats.prototype.topCategoryStats = $util.emptyArray; + + /** + * Creates a new CategoryStats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @static + * @param {google.cloud.automl.v1beta1.ICategoryStats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.CategoryStats} CategoryStats instance + */ + CategoryStats.create = function create(properties) { + return new CategoryStats(properties); + }; + + /** + * Encodes the specified CategoryStats message. Does not implicitly {@link google.cloud.automl.v1beta1.CategoryStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @static + * @param {google.cloud.automl.v1beta1.ICategoryStats} message CategoryStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoryStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topCategoryStats != null && message.topCategoryStats.length) + for (var i = 0; i < message.topCategoryStats.length; ++i) + $root.google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.encode(message.topCategoryStats[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CategoryStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CategoryStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @static + * @param {google.cloud.automl.v1beta1.ICategoryStats} message CategoryStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoryStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CategoryStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.CategoryStats} CategoryStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoryStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.CategoryStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.topCategoryStats && message.topCategoryStats.length)) + message.topCategoryStats = []; + message.topCategoryStats.push($root.google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CategoryStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.CategoryStats} CategoryStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoryStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CategoryStats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CategoryStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topCategoryStats != null && message.hasOwnProperty("topCategoryStats")) { + if (!Array.isArray(message.topCategoryStats)) + return "topCategoryStats: array expected"; + for (var i = 0; i < message.topCategoryStats.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.verify(message.topCategoryStats[i]); + if (error) + return "topCategoryStats." + error; + } + } + return null; + }; + + /** + * Creates a CategoryStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.CategoryStats} CategoryStats + */ + CategoryStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.CategoryStats) + return object; + var message = new $root.google.cloud.automl.v1beta1.CategoryStats(); + if (object.topCategoryStats) { + if (!Array.isArray(object.topCategoryStats)) + throw TypeError(".google.cloud.automl.v1beta1.CategoryStats.topCategoryStats: array expected"); + message.topCategoryStats = []; + for (var i = 0; i < object.topCategoryStats.length; ++i) { + if (typeof object.topCategoryStats[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.CategoryStats.topCategoryStats: object expected"); + message.topCategoryStats[i] = $root.google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.fromObject(object.topCategoryStats[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CategoryStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @static + * @param {google.cloud.automl.v1beta1.CategoryStats} message CategoryStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CategoryStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.topCategoryStats = []; + if (message.topCategoryStats && message.topCategoryStats.length) { + object.topCategoryStats = []; + for (var j = 0; j < message.topCategoryStats.length; ++j) + object.topCategoryStats[j] = $root.google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.toObject(message.topCategoryStats[j], options); + } + return object; + }; + + /** + * Converts this CategoryStats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @instance + * @returns {Object.} JSON object + */ + CategoryStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CategoryStats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CategoryStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.CategoryStats"; + }; + + CategoryStats.SingleCategoryStats = (function() { + + /** + * Properties of a SingleCategoryStats. + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @interface ISingleCategoryStats + * @property {string|null} [value] SingleCategoryStats value + * @property {number|Long|null} [count] SingleCategoryStats count + */ + + /** + * Constructs a new SingleCategoryStats. + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @classdesc Represents a SingleCategoryStats. + * @implements ISingleCategoryStats + * @constructor + * @param {google.cloud.automl.v1beta1.CategoryStats.ISingleCategoryStats=} [properties] Properties to set + */ + function SingleCategoryStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SingleCategoryStats value. + * @member {string} value + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @instance + */ + SingleCategoryStats.prototype.value = ""; + + /** + * SingleCategoryStats count. + * @member {number|Long} count + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @instance + */ + SingleCategoryStats.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new SingleCategoryStats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @static + * @param {google.cloud.automl.v1beta1.CategoryStats.ISingleCategoryStats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats} SingleCategoryStats instance + */ + SingleCategoryStats.create = function create(properties) { + return new SingleCategoryStats(properties); + }; + + /** + * Encodes the specified SingleCategoryStats message. Does not implicitly {@link google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @static + * @param {google.cloud.automl.v1beta1.CategoryStats.ISingleCategoryStats} message SingleCategoryStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SingleCategoryStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + return writer; + }; + + /** + * Encodes the specified SingleCategoryStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @static + * @param {google.cloud.automl.v1beta1.CategoryStats.ISingleCategoryStats} message SingleCategoryStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SingleCategoryStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SingleCategoryStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats} SingleCategoryStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SingleCategoryStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + case 2: { + message.count = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SingleCategoryStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats} SingleCategoryStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SingleCategoryStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SingleCategoryStats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SingleCategoryStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates a SingleCategoryStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats} SingleCategoryStats + */ + SingleCategoryStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats) + return object; + var message = new $root.google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats(); + if (object.value != null) + message.value = String(object.value); + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SingleCategoryStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @static + * @param {google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats} message SingleCategoryStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SingleCategoryStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; + + /** + * Converts this SingleCategoryStats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @instance + * @returns {Object.} JSON object + */ + SingleCategoryStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SingleCategoryStats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SingleCategoryStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats"; + }; + + return SingleCategoryStats; + })(); + + return CategoryStats; + })(); + + v1beta1.CorrelationStats = (function() { + + /** + * Properties of a CorrelationStats. + * @memberof google.cloud.automl.v1beta1 + * @interface ICorrelationStats + * @property {number|null} [cramersV] CorrelationStats cramersV + */ + + /** + * Constructs a new CorrelationStats. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a CorrelationStats. + * @implements ICorrelationStats + * @constructor + * @param {google.cloud.automl.v1beta1.ICorrelationStats=} [properties] Properties to set + */ + function CorrelationStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CorrelationStats cramersV. + * @member {number} cramersV + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @instance + */ + CorrelationStats.prototype.cramersV = 0; + + /** + * Creates a new CorrelationStats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @static + * @param {google.cloud.automl.v1beta1.ICorrelationStats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.CorrelationStats} CorrelationStats instance + */ + CorrelationStats.create = function create(properties) { + return new CorrelationStats(properties); + }; + + /** + * Encodes the specified CorrelationStats message. Does not implicitly {@link google.cloud.automl.v1beta1.CorrelationStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @static + * @param {google.cloud.automl.v1beta1.ICorrelationStats} message CorrelationStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CorrelationStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cramersV != null && Object.hasOwnProperty.call(message, "cramersV")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.cramersV); + return writer; + }; + + /** + * Encodes the specified CorrelationStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CorrelationStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @static + * @param {google.cloud.automl.v1beta1.ICorrelationStats} message CorrelationStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CorrelationStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CorrelationStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.CorrelationStats} CorrelationStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CorrelationStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.CorrelationStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cramersV = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CorrelationStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.CorrelationStats} CorrelationStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CorrelationStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CorrelationStats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CorrelationStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cramersV != null && message.hasOwnProperty("cramersV")) + if (typeof message.cramersV !== "number") + return "cramersV: number expected"; + return null; + }; + + /** + * Creates a CorrelationStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.CorrelationStats} CorrelationStats + */ + CorrelationStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.CorrelationStats) + return object; + var message = new $root.google.cloud.automl.v1beta1.CorrelationStats(); + if (object.cramersV != null) + message.cramersV = Number(object.cramersV); + return message; + }; + + /** + * Creates a plain object from a CorrelationStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @static + * @param {google.cloud.automl.v1beta1.CorrelationStats} message CorrelationStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CorrelationStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cramersV = 0; + if (message.cramersV != null && message.hasOwnProperty("cramersV")) + object.cramersV = options.json && !isFinite(message.cramersV) ? String(message.cramersV) : message.cramersV; + return object; + }; + + /** + * Converts this CorrelationStats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @instance + * @returns {Object.} JSON object + */ + CorrelationStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CorrelationStats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CorrelationStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.CorrelationStats"; + }; + + return CorrelationStats; + })(); + + /** + * TypeCode enum. + * @name google.cloud.automl.v1beta1.TypeCode + * @enum {number} + * @property {number} TYPE_CODE_UNSPECIFIED=0 TYPE_CODE_UNSPECIFIED value + * @property {number} FLOAT64=3 FLOAT64 value + * @property {number} TIMESTAMP=4 TIMESTAMP value + * @property {number} STRING=6 STRING value + * @property {number} ARRAY=8 ARRAY value + * @property {number} STRUCT=9 STRUCT value + * @property {number} CATEGORY=10 CATEGORY value + */ + v1beta1.TypeCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_CODE_UNSPECIFIED"] = 0; + values[valuesById[3] = "FLOAT64"] = 3; + values[valuesById[4] = "TIMESTAMP"] = 4; + values[valuesById[6] = "STRING"] = 6; + values[valuesById[8] = "ARRAY"] = 8; + values[valuesById[9] = "STRUCT"] = 9; + values[valuesById[10] = "CATEGORY"] = 10; + return values; + })(); + + v1beta1.DataType = (function() { + + /** + * Properties of a DataType. + * @memberof google.cloud.automl.v1beta1 + * @interface IDataType + * @property {google.cloud.automl.v1beta1.IDataType|null} [listElementType] DataType listElementType + * @property {google.cloud.automl.v1beta1.IStructType|null} [structType] DataType structType + * @property {string|null} [timeFormat] DataType timeFormat + * @property {google.cloud.automl.v1beta1.TypeCode|null} [typeCode] DataType typeCode + * @property {boolean|null} [nullable] DataType nullable + */ + + /** + * Constructs a new DataType. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a DataType. + * @implements IDataType + * @constructor + * @param {google.cloud.automl.v1beta1.IDataType=} [properties] Properties to set + */ + function DataType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataType listElementType. + * @member {google.cloud.automl.v1beta1.IDataType|null|undefined} listElementType + * @memberof google.cloud.automl.v1beta1.DataType + * @instance + */ + DataType.prototype.listElementType = null; + + /** + * DataType structType. + * @member {google.cloud.automl.v1beta1.IStructType|null|undefined} structType + * @memberof google.cloud.automl.v1beta1.DataType + * @instance + */ + DataType.prototype.structType = null; + + /** + * DataType timeFormat. + * @member {string|null|undefined} timeFormat + * @memberof google.cloud.automl.v1beta1.DataType + * @instance + */ + DataType.prototype.timeFormat = null; + + /** + * DataType typeCode. + * @member {google.cloud.automl.v1beta1.TypeCode} typeCode + * @memberof google.cloud.automl.v1beta1.DataType + * @instance + */ + DataType.prototype.typeCode = 0; + + /** + * DataType nullable. + * @member {boolean} nullable + * @memberof google.cloud.automl.v1beta1.DataType + * @instance + */ + DataType.prototype.nullable = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DataType details. + * @member {"listElementType"|"structType"|"timeFormat"|undefined} details + * @memberof google.cloud.automl.v1beta1.DataType + * @instance + */ + Object.defineProperty(DataType.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["listElementType", "structType", "timeFormat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataType instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.DataType + * @static + * @param {google.cloud.automl.v1beta1.IDataType=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.DataType} DataType instance + */ + DataType.create = function create(properties) { + return new DataType(properties); + }; + + /** + * Encodes the specified DataType message. Does not implicitly {@link google.cloud.automl.v1beta1.DataType.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.DataType + * @static + * @param {google.cloud.automl.v1beta1.IDataType} message DataType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.typeCode != null && Object.hasOwnProperty.call(message, "typeCode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.typeCode); + if (message.listElementType != null && Object.hasOwnProperty.call(message, "listElementType")) + $root.google.cloud.automl.v1beta1.DataType.encode(message.listElementType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.structType != null && Object.hasOwnProperty.call(message, "structType")) + $root.google.cloud.automl.v1beta1.StructType.encode(message.structType, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.nullable != null && Object.hasOwnProperty.call(message, "nullable")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.nullable); + if (message.timeFormat != null && Object.hasOwnProperty.call(message, "timeFormat")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.timeFormat); + return writer; + }; + + /** + * Encodes the specified DataType message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DataType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.DataType + * @static + * @param {google.cloud.automl.v1beta1.IDataType} message DataType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.DataType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.DataType} DataType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataType.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.DataType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.listElementType = $root.google.cloud.automl.v1beta1.DataType.decode(reader, reader.uint32()); + break; + } + case 3: { + message.structType = $root.google.cloud.automl.v1beta1.StructType.decode(reader, reader.uint32()); + break; + } + case 5: { + message.timeFormat = reader.string(); + break; + } + case 1: { + message.typeCode = reader.int32(); + break; + } + case 4: { + message.nullable = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.DataType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.DataType} DataType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataType message. + * @function verify + * @memberof google.cloud.automl.v1beta1.DataType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.listElementType != null && message.hasOwnProperty("listElementType")) { + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.DataType.verify(message.listElementType); + if (error) + return "listElementType." + error; + } + } + if (message.structType != null && message.hasOwnProperty("structType")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.StructType.verify(message.structType); + if (error) + return "structType." + error; + } + } + if (message.timeFormat != null && message.hasOwnProperty("timeFormat")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + if (!$util.isString(message.timeFormat)) + return "timeFormat: string expected"; + } + if (message.typeCode != null && message.hasOwnProperty("typeCode")) + switch (message.typeCode) { + default: + return "typeCode: enum value expected"; + case 0: + case 3: + case 4: + case 6: + case 8: + case 9: + case 10: + break; + } + if (message.nullable != null && message.hasOwnProperty("nullable")) + if (typeof message.nullable !== "boolean") + return "nullable: boolean expected"; + return null; + }; + + /** + * Creates a DataType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.DataType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.DataType} DataType + */ + DataType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.DataType) + return object; + var message = new $root.google.cloud.automl.v1beta1.DataType(); + if (object.listElementType != null) { + if (typeof object.listElementType !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DataType.listElementType: object expected"); + message.listElementType = $root.google.cloud.automl.v1beta1.DataType.fromObject(object.listElementType); + } + if (object.structType != null) { + if (typeof object.structType !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DataType.structType: object expected"); + message.structType = $root.google.cloud.automl.v1beta1.StructType.fromObject(object.structType); + } + if (object.timeFormat != null) + message.timeFormat = String(object.timeFormat); + switch (object.typeCode) { + default: + if (typeof object.typeCode === "number") { + message.typeCode = object.typeCode; + break; + } + break; + case "TYPE_CODE_UNSPECIFIED": + case 0: + message.typeCode = 0; + break; + case "FLOAT64": + case 3: + message.typeCode = 3; + break; + case "TIMESTAMP": + case 4: + message.typeCode = 4; + break; + case "STRING": + case 6: + message.typeCode = 6; + break; + case "ARRAY": + case 8: + message.typeCode = 8; + break; + case "STRUCT": + case 9: + message.typeCode = 9; + break; + case "CATEGORY": + case 10: + message.typeCode = 10; + break; + } + if (object.nullable != null) + message.nullable = Boolean(object.nullable); + return message; + }; + + /** + * Creates a plain object from a DataType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.DataType + * @static + * @param {google.cloud.automl.v1beta1.DataType} message DataType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.typeCode = options.enums === String ? "TYPE_CODE_UNSPECIFIED" : 0; + object.nullable = false; + } + if (message.typeCode != null && message.hasOwnProperty("typeCode")) + object.typeCode = options.enums === String ? $root.google.cloud.automl.v1beta1.TypeCode[message.typeCode] === undefined ? message.typeCode : $root.google.cloud.automl.v1beta1.TypeCode[message.typeCode] : message.typeCode; + if (message.listElementType != null && message.hasOwnProperty("listElementType")) { + object.listElementType = $root.google.cloud.automl.v1beta1.DataType.toObject(message.listElementType, options); + if (options.oneofs) + object.details = "listElementType"; + } + if (message.structType != null && message.hasOwnProperty("structType")) { + object.structType = $root.google.cloud.automl.v1beta1.StructType.toObject(message.structType, options); + if (options.oneofs) + object.details = "structType"; + } + if (message.nullable != null && message.hasOwnProperty("nullable")) + object.nullable = message.nullable; + if (message.timeFormat != null && message.hasOwnProperty("timeFormat")) { + object.timeFormat = message.timeFormat; + if (options.oneofs) + object.details = "timeFormat"; + } + return object; + }; + + /** + * Converts this DataType to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.DataType + * @instance + * @returns {Object.} JSON object + */ + DataType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataType + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.DataType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.DataType"; + }; + + return DataType; + })(); + + v1beta1.StructType = (function() { + + /** + * Properties of a StructType. + * @memberof google.cloud.automl.v1beta1 + * @interface IStructType + * @property {Object.|null} [fields] StructType fields + */ + + /** + * Constructs a new StructType. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a StructType. + * @implements IStructType + * @constructor + * @param {google.cloud.automl.v1beta1.IStructType=} [properties] Properties to set + */ + function StructType(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StructType fields. + * @member {Object.} fields + * @memberof google.cloud.automl.v1beta1.StructType + * @instance + */ + StructType.prototype.fields = $util.emptyObject; + + /** + * Creates a new StructType instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.StructType + * @static + * @param {google.cloud.automl.v1beta1.IStructType=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.StructType} StructType instance + */ + StructType.create = function create(properties) { + return new StructType(properties); + }; + + /** + * Encodes the specified StructType message. Does not implicitly {@link google.cloud.automl.v1beta1.StructType.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.StructType + * @static + * @param {google.cloud.automl.v1beta1.IStructType} message StructType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.automl.v1beta1.DataType.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified StructType message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.StructType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.StructType + * @static + * @param {google.cloud.automl.v1beta1.IStructType} message StructType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StructType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.StructType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.StructType} StructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructType.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.StructType(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.automl.v1beta1.DataType.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StructType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.StructType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.StructType} StructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StructType message. + * @function verify + * @memberof google.cloud.automl.v1beta1.StructType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StructType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.DataType.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a StructType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.StructType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.StructType} StructType + */ + StructType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.StructType) + return object; + var message = new $root.google.cloud.automl.v1beta1.StructType(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.cloud.automl.v1beta1.StructType.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.StructType.fields: object expected"); + message.fields[keys[i]] = $root.google.cloud.automl.v1beta1.DataType.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a StructType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.StructType + * @static + * @param {google.cloud.automl.v1beta1.StructType} message StructType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StructType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.cloud.automl.v1beta1.DataType.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this StructType to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.StructType + * @instance + * @returns {Object.} JSON object + */ + StructType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StructType + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.StructType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StructType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.StructType"; + }; + + return StructType; + })(); + + v1beta1.Image = (function() { + + /** + * Properties of an Image. + * @memberof google.cloud.automl.v1beta1 + * @interface IImage + * @property {Uint8Array|null} [imageBytes] Image imageBytes + * @property {google.cloud.automl.v1beta1.IInputConfig|null} [inputConfig] Image inputConfig + * @property {string|null} [thumbnailUri] Image thumbnailUri + */ + + /** + * Constructs a new Image. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.cloud.automl.v1beta1.IImage=} [properties] Properties to set + */ + function Image(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Image imageBytes. + * @member {Uint8Array|null|undefined} imageBytes + * @memberof google.cloud.automl.v1beta1.Image + * @instance + */ + Image.prototype.imageBytes = null; + + /** + * Image inputConfig. + * @member {google.cloud.automl.v1beta1.IInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1beta1.Image + * @instance + */ + Image.prototype.inputConfig = null; + + /** + * Image thumbnailUri. + * @member {string} thumbnailUri + * @memberof google.cloud.automl.v1beta1.Image + * @instance + */ + Image.prototype.thumbnailUri = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Image data. + * @member {"imageBytes"|"inputConfig"|undefined} data + * @memberof google.cloud.automl.v1beta1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["imageBytes", "inputConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.Image + * @static + * @param {google.cloud.automl.v1beta1.IImage=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.automl.v1beta1.Image.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.Image + * @static + * @param {google.cloud.automl.v1beta1.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageBytes != null && Object.hasOwnProperty.call(message, "imageBytes")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.imageBytes); + if (message.thumbnailUri != null && Object.hasOwnProperty.call(message, "thumbnailUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.thumbnailUri); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.automl.v1beta1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.Image + * @static + * @param {google.cloud.automl.v1beta1.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Image message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.imageBytes = reader.bytes(); + break; + } + case 6: { + message.inputConfig = $root.google.cloud.automl.v1beta1.InputConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.thumbnailUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Image message. + * @function verify + * @memberof google.cloud.automl.v1beta1.Image + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Image.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.imageBytes != null && message.hasOwnProperty("imageBytes")) { + properties.data = 1; + if (!(message.imageBytes && typeof message.imageBytes.length === "number" || $util.isString(message.imageBytes))) + return "imageBytes: buffer expected"; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.cloud.automl.v1beta1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + } + if (message.thumbnailUri != null && message.hasOwnProperty("thumbnailUri")) + if (!$util.isString(message.thumbnailUri)) + return "thumbnailUri: string expected"; + return null; + }; + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.Image + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.Image) + return object; + var message = new $root.google.cloud.automl.v1beta1.Image(); + 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; + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Image.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1beta1.InputConfig.fromObject(object.inputConfig); + } + if (object.thumbnailUri != null) + message.thumbnailUri = String(object.thumbnailUri); + return message; + }; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.Image + * @static + * @param {google.cloud.automl.v1beta1.Image} message Image + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Image.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.thumbnailUri = ""; + 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; + if (options.oneofs) + object.data = "imageBytes"; + } + if (message.thumbnailUri != null && message.hasOwnProperty("thumbnailUri")) + object.thumbnailUri = message.thumbnailUri; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + object.inputConfig = $root.google.cloud.automl.v1beta1.InputConfig.toObject(message.inputConfig, options); + if (options.oneofs) + object.data = "inputConfig"; + } + return object; + }; + + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Image + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.Image + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Image.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.Image"; + }; + + return Image; + })(); + + v1beta1.TextSnippet = (function() { + + /** + * Properties of a TextSnippet. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextSnippet + * @property {string|null} [content] TextSnippet content + * @property {string|null} [mimeType] TextSnippet mimeType + * @property {string|null} [contentUri] TextSnippet contentUri + */ + + /** + * Constructs a new TextSnippet. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextSnippet. + * @implements ITextSnippet + * @constructor + * @param {google.cloud.automl.v1beta1.ITextSnippet=} [properties] Properties to set + */ + function TextSnippet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSnippet content. + * @member {string} content + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @instance + */ + TextSnippet.prototype.content = ""; + + /** + * TextSnippet mimeType. + * @member {string} mimeType + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @instance + */ + TextSnippet.prototype.mimeType = ""; + + /** + * TextSnippet contentUri. + * @member {string} contentUri + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @instance + */ + TextSnippet.prototype.contentUri = ""; + + /** + * Creates a new TextSnippet instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @static + * @param {google.cloud.automl.v1beta1.ITextSnippet=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextSnippet} TextSnippet instance + */ + TextSnippet.create = function create(properties) { + return new TextSnippet(properties); + }; + + /** + * Encodes the specified TextSnippet message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSnippet.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @static + * @param {google.cloud.automl.v1beta1.ITextSnippet} message TextSnippet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSnippet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + if (message.contentUri != null && Object.hasOwnProperty.call(message, "contentUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.contentUri); + return writer; + }; + + /** + * Encodes the specified TextSnippet message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSnippet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @static + * @param {google.cloud.automl.v1beta1.ITextSnippet} message TextSnippet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSnippet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSnippet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextSnippet} TextSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSnippet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextSnippet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + case 4: { + message.contentUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSnippet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextSnippet} TextSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSnippet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSnippet message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSnippet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.contentUri != null && message.hasOwnProperty("contentUri")) + if (!$util.isString(message.contentUri)) + return "contentUri: string expected"; + return null; + }; + + /** + * Creates a TextSnippet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextSnippet} TextSnippet + */ + TextSnippet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextSnippet) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextSnippet(); + if (object.content != null) + message.content = String(object.content); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.contentUri != null) + message.contentUri = String(object.contentUri); + return message; + }; + + /** + * Creates a plain object from a TextSnippet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @static + * @param {google.cloud.automl.v1beta1.TextSnippet} message TextSnippet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSnippet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.mimeType = ""; + object.contentUri = ""; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.contentUri != null && message.hasOwnProperty("contentUri")) + object.contentUri = message.contentUri; + return object; + }; + + /** + * Converts this TextSnippet to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @instance + * @returns {Object.} JSON object + */ + TextSnippet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSnippet + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSnippet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextSnippet"; + }; + + return TextSnippet; + })(); + + v1beta1.DocumentDimensions = (function() { + + /** + * Properties of a DocumentDimensions. + * @memberof google.cloud.automl.v1beta1 + * @interface IDocumentDimensions + * @property {google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit|null} [unit] DocumentDimensions unit + * @property {number|null} [width] DocumentDimensions width + * @property {number|null} [height] DocumentDimensions height + */ + + /** + * Constructs a new DocumentDimensions. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a DocumentDimensions. + * @implements IDocumentDimensions + * @constructor + * @param {google.cloud.automl.v1beta1.IDocumentDimensions=} [properties] Properties to set + */ + function DocumentDimensions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentDimensions unit. + * @member {google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit} unit + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @instance + */ + DocumentDimensions.prototype.unit = 0; + + /** + * DocumentDimensions width. + * @member {number} width + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @instance + */ + DocumentDimensions.prototype.width = 0; + + /** + * DocumentDimensions height. + * @member {number} height + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @instance + */ + DocumentDimensions.prototype.height = 0; + + /** + * Creates a new DocumentDimensions instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @static + * @param {google.cloud.automl.v1beta1.IDocumentDimensions=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.DocumentDimensions} DocumentDimensions instance + */ + DocumentDimensions.create = function create(properties) { + return new DocumentDimensions(properties); + }; + + /** + * Encodes the specified DocumentDimensions message. Does not implicitly {@link google.cloud.automl.v1beta1.DocumentDimensions.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @static + * @param {google.cloud.automl.v1beta1.IDocumentDimensions} message DocumentDimensions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentDimensions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.unit); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.width); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.height); + return writer; + }; + + /** + * Encodes the specified DocumentDimensions message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DocumentDimensions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @static + * @param {google.cloud.automl.v1beta1.IDocumentDimensions} message DocumentDimensions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentDimensions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentDimensions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.DocumentDimensions} DocumentDimensions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentDimensions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.DocumentDimensions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.unit = reader.int32(); + break; + } + case 2: { + message.width = reader.float(); + break; + } + case 3: { + message.height = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentDimensions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.DocumentDimensions} DocumentDimensions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentDimensions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentDimensions message. + * @function verify + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentDimensions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.unit != null && message.hasOwnProperty("unit")) + switch (message.unit) { + default: + return "unit: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.width != null && message.hasOwnProperty("width")) + if (typeof message.width !== "number") + return "width: number expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height !== "number") + return "height: number expected"; + return null; + }; + + /** + * Creates a DocumentDimensions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.DocumentDimensions} DocumentDimensions + */ + DocumentDimensions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.DocumentDimensions) + return object; + var message = new $root.google.cloud.automl.v1beta1.DocumentDimensions(); + switch (object.unit) { + default: + if (typeof object.unit === "number") { + message.unit = object.unit; + break; + } + break; + case "DOCUMENT_DIMENSION_UNIT_UNSPECIFIED": + case 0: + message.unit = 0; + break; + case "INCH": + case 1: + message.unit = 1; + break; + case "CENTIMETER": + case 2: + message.unit = 2; + break; + case "POINT": + case 3: + message.unit = 3; + break; + } + if (object.width != null) + message.width = Number(object.width); + if (object.height != null) + message.height = Number(object.height); + return message; + }; + + /** + * Creates a plain object from a DocumentDimensions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @static + * @param {google.cloud.automl.v1beta1.DocumentDimensions} message DocumentDimensions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentDimensions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.unit = options.enums === String ? "DOCUMENT_DIMENSION_UNIT_UNSPECIFIED" : 0; + object.width = 0; + object.height = 0; + } + if (message.unit != null && message.hasOwnProperty("unit")) + object.unit = options.enums === String ? $root.google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit[message.unit] === undefined ? message.unit : $root.google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit[message.unit] : message.unit; + if (message.width != null && message.hasOwnProperty("width")) + object.width = options.json && !isFinite(message.width) ? String(message.width) : message.width; + if (message.height != null && message.hasOwnProperty("height")) + object.height = options.json && !isFinite(message.height) ? String(message.height) : message.height; + return object; + }; + + /** + * Converts this DocumentDimensions to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @instance + * @returns {Object.} JSON object + */ + DocumentDimensions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentDimensions + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentDimensions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.DocumentDimensions"; + }; + + /** + * DocumentDimensionUnit enum. + * @name google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit + * @enum {number} + * @property {number} DOCUMENT_DIMENSION_UNIT_UNSPECIFIED=0 DOCUMENT_DIMENSION_UNIT_UNSPECIFIED value + * @property {number} INCH=1 INCH value + * @property {number} CENTIMETER=2 CENTIMETER value + * @property {number} POINT=3 POINT value + */ + DocumentDimensions.DocumentDimensionUnit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENT_DIMENSION_UNIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCH"] = 1; + values[valuesById[2] = "CENTIMETER"] = 2; + values[valuesById[3] = "POINT"] = 3; + return values; + })(); + + return DocumentDimensions; + })(); + + v1beta1.Document = (function() { + + /** + * Properties of a Document. + * @memberof google.cloud.automl.v1beta1 + * @interface IDocument + * @property {google.cloud.automl.v1beta1.IDocumentInputConfig|null} [inputConfig] Document inputConfig + * @property {google.cloud.automl.v1beta1.ITextSnippet|null} [documentText] Document documentText + * @property {Array.|null} [layout] Document layout + * @property {google.cloud.automl.v1beta1.IDocumentDimensions|null} [documentDimensions] Document documentDimensions + * @property {number|null} [pageCount] Document pageCount + */ + + /** + * Constructs a new Document. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a Document. + * @implements IDocument + * @constructor + * @param {google.cloud.automl.v1beta1.IDocument=} [properties] Properties to set + */ + function Document(properties) { + this.layout = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Document inputConfig. + * @member {google.cloud.automl.v1beta1.IDocumentInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1beta1.Document + * @instance + */ + Document.prototype.inputConfig = null; + + /** + * Document documentText. + * @member {google.cloud.automl.v1beta1.ITextSnippet|null|undefined} documentText + * @memberof google.cloud.automl.v1beta1.Document + * @instance + */ + Document.prototype.documentText = null; + + /** + * Document layout. + * @member {Array.} layout + * @memberof google.cloud.automl.v1beta1.Document + * @instance + */ + Document.prototype.layout = $util.emptyArray; + + /** + * Document documentDimensions. + * @member {google.cloud.automl.v1beta1.IDocumentDimensions|null|undefined} documentDimensions + * @memberof google.cloud.automl.v1beta1.Document + * @instance + */ + Document.prototype.documentDimensions = null; + + /** + * Document pageCount. + * @member {number} pageCount + * @memberof google.cloud.automl.v1beta1.Document + * @instance + */ + Document.prototype.pageCount = 0; + + /** + * Creates a new Document instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.Document + * @static + * @param {google.cloud.automl.v1beta1.IDocument=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.Document} Document instance + */ + Document.create = function create(properties) { + return new Document(properties); + }; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.automl.v1beta1.Document.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.Document + * @static + * @param {google.cloud.automl.v1beta1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.automl.v1beta1.DocumentInputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.documentText != null && Object.hasOwnProperty.call(message, "documentText")) + $root.google.cloud.automl.v1beta1.TextSnippet.encode(message.documentText, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.layout != null && message.layout.length) + for (var i = 0; i < message.layout.length; ++i) + $root.google.cloud.automl.v1beta1.Document.Layout.encode(message.layout[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.documentDimensions != null && Object.hasOwnProperty.call(message, "documentDimensions")) + $root.google.cloud.automl.v1beta1.DocumentDimensions.encode(message.documentDimensions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.pageCount != null && Object.hasOwnProperty.call(message, "pageCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.pageCount); + return writer; + }; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Document.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.Document + * @static + * @param {google.cloud.automl.v1beta1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Document message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.Document(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputConfig = $root.google.cloud.automl.v1beta1.DocumentInputConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.documentText = $root.google.cloud.automl.v1beta1.TextSnippet.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.layout && message.layout.length)) + message.layout = []; + message.layout.push($root.google.cloud.automl.v1beta1.Document.Layout.decode(reader, reader.uint32())); + break; + } + case 4: { + message.documentDimensions = $root.google.cloud.automl.v1beta1.DocumentDimensions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.pageCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Document message. + * @function verify + * @memberof google.cloud.automl.v1beta1.Document + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Document.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.automl.v1beta1.DocumentInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.documentText != null && message.hasOwnProperty("documentText")) { + var error = $root.google.cloud.automl.v1beta1.TextSnippet.verify(message.documentText); + if (error) + return "documentText." + error; + } + if (message.layout != null && message.hasOwnProperty("layout")) { + if (!Array.isArray(message.layout)) + return "layout: array expected"; + for (var i = 0; i < message.layout.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.Document.Layout.verify(message.layout[i]); + if (error) + return "layout." + error; + } + } + if (message.documentDimensions != null && message.hasOwnProperty("documentDimensions")) { + var error = $root.google.cloud.automl.v1beta1.DocumentDimensions.verify(message.documentDimensions); + if (error) + return "documentDimensions." + error; + } + if (message.pageCount != null && message.hasOwnProperty("pageCount")) + if (!$util.isInteger(message.pageCount)) + return "pageCount: integer expected"; + return null; + }; + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.Document + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.Document} Document + */ + Document.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.Document) + return object; + var message = new $root.google.cloud.automl.v1beta1.Document(); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Document.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1beta1.DocumentInputConfig.fromObject(object.inputConfig); + } + if (object.documentText != null) { + if (typeof object.documentText !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Document.documentText: object expected"); + message.documentText = $root.google.cloud.automl.v1beta1.TextSnippet.fromObject(object.documentText); + } + if (object.layout) { + if (!Array.isArray(object.layout)) + throw TypeError(".google.cloud.automl.v1beta1.Document.layout: array expected"); + message.layout = []; + for (var i = 0; i < object.layout.length; ++i) { + if (typeof object.layout[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Document.layout: object expected"); + message.layout[i] = $root.google.cloud.automl.v1beta1.Document.Layout.fromObject(object.layout[i]); + } + } + if (object.documentDimensions != null) { + if (typeof object.documentDimensions !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Document.documentDimensions: object expected"); + message.documentDimensions = $root.google.cloud.automl.v1beta1.DocumentDimensions.fromObject(object.documentDimensions); + } + if (object.pageCount != null) + message.pageCount = object.pageCount | 0; + return message; + }; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.Document + * @static + * @param {google.cloud.automl.v1beta1.Document} message Document + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Document.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.layout = []; + if (options.defaults) { + object.inputConfig = null; + object.documentText = null; + object.documentDimensions = null; + object.pageCount = 0; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.automl.v1beta1.DocumentInputConfig.toObject(message.inputConfig, options); + if (message.documentText != null && message.hasOwnProperty("documentText")) + object.documentText = $root.google.cloud.automl.v1beta1.TextSnippet.toObject(message.documentText, options); + if (message.layout && message.layout.length) { + object.layout = []; + for (var j = 0; j < message.layout.length; ++j) + object.layout[j] = $root.google.cloud.automl.v1beta1.Document.Layout.toObject(message.layout[j], options); + } + if (message.documentDimensions != null && message.hasOwnProperty("documentDimensions")) + object.documentDimensions = $root.google.cloud.automl.v1beta1.DocumentDimensions.toObject(message.documentDimensions, options); + if (message.pageCount != null && message.hasOwnProperty("pageCount")) + object.pageCount = message.pageCount; + return object; + }; + + /** + * Converts this Document to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.Document + * @instance + * @returns {Object.} JSON object + */ + Document.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Document + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.Document + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.Document"; + }; + + Document.Layout = (function() { + + /** + * Properties of a Layout. + * @memberof google.cloud.automl.v1beta1.Document + * @interface ILayout + * @property {google.cloud.automl.v1beta1.ITextSegment|null} [textSegment] Layout textSegment + * @property {number|null} [pageNumber] Layout pageNumber + * @property {google.cloud.automl.v1beta1.IBoundingPoly|null} [boundingPoly] Layout boundingPoly + * @property {google.cloud.automl.v1beta1.Document.Layout.TextSegmentType|null} [textSegmentType] Layout textSegmentType + */ + + /** + * Constructs a new Layout. + * @memberof google.cloud.automl.v1beta1.Document + * @classdesc Represents a Layout. + * @implements ILayout + * @constructor + * @param {google.cloud.automl.v1beta1.Document.ILayout=} [properties] Properties to set + */ + function Layout(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Layout textSegment. + * @member {google.cloud.automl.v1beta1.ITextSegment|null|undefined} textSegment + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @instance + */ + Layout.prototype.textSegment = null; + + /** + * Layout pageNumber. + * @member {number} pageNumber + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @instance + */ + Layout.prototype.pageNumber = 0; + + /** + * Layout boundingPoly. + * @member {google.cloud.automl.v1beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @instance + */ + Layout.prototype.boundingPoly = null; + + /** + * Layout textSegmentType. + * @member {google.cloud.automl.v1beta1.Document.Layout.TextSegmentType} textSegmentType + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @instance + */ + Layout.prototype.textSegmentType = 0; + + /** + * Creates a new Layout instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @static + * @param {google.cloud.automl.v1beta1.Document.ILayout=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.Document.Layout} Layout instance + */ + Layout.create = function create(properties) { + return new Layout(properties); + }; + + /** + * Encodes the specified Layout message. Does not implicitly {@link google.cloud.automl.v1beta1.Document.Layout.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @static + * @param {google.cloud.automl.v1beta1.Document.ILayout} message Layout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Layout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textSegment != null && Object.hasOwnProperty.call(message, "textSegment")) + $root.google.cloud.automl.v1beta1.TextSegment.encode(message.textSegment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pageNumber != null && Object.hasOwnProperty.call(message, "pageNumber")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageNumber); + if (message.boundingPoly != null && Object.hasOwnProperty.call(message, "boundingPoly")) + $root.google.cloud.automl.v1beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.textSegmentType != null && Object.hasOwnProperty.call(message, "textSegmentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.textSegmentType); + return writer; + }; + + /** + * Encodes the specified Layout message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Document.Layout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @static + * @param {google.cloud.automl.v1beta1.Document.ILayout} message Layout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Layout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Layout message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.Document.Layout} Layout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Layout.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.Document.Layout(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.textSegment = $root.google.cloud.automl.v1beta1.TextSegment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pageNumber = reader.int32(); + break; + } + case 3: { + message.boundingPoly = $root.google.cloud.automl.v1beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + } + case 4: { + message.textSegmentType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Layout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.Document.Layout} Layout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Layout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Layout message. + * @function verify + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Layout.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.textSegment != null && message.hasOwnProperty("textSegment")) { + var error = $root.google.cloud.automl.v1beta1.TextSegment.verify(message.textSegment); + if (error) + return "textSegment." + error; + } + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + if (!$util.isInteger(message.pageNumber)) + return "pageNumber: integer expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.automl.v1beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.textSegmentType != null && message.hasOwnProperty("textSegmentType")) + switch (message.textSegmentType) { + default: + return "textSegmentType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + return null; + }; + + /** + * Creates a Layout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.Document.Layout} Layout + */ + Layout.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.Document.Layout) + return object; + var message = new $root.google.cloud.automl.v1beta1.Document.Layout(); + if (object.textSegment != null) { + if (typeof object.textSegment !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Document.Layout.textSegment: object expected"); + message.textSegment = $root.google.cloud.automl.v1beta1.TextSegment.fromObject(object.textSegment); + } + if (object.pageNumber != null) + message.pageNumber = object.pageNumber | 0; + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Document.Layout.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.automl.v1beta1.BoundingPoly.fromObject(object.boundingPoly); + } + switch (object.textSegmentType) { + default: + if (typeof object.textSegmentType === "number") { + message.textSegmentType = object.textSegmentType; + break; + } + break; + case "TEXT_SEGMENT_TYPE_UNSPECIFIED": + case 0: + message.textSegmentType = 0; + break; + case "TOKEN": + case 1: + message.textSegmentType = 1; + break; + case "PARAGRAPH": + case 2: + message.textSegmentType = 2; + break; + case "FORM_FIELD": + case 3: + message.textSegmentType = 3; + break; + case "FORM_FIELD_NAME": + case 4: + message.textSegmentType = 4; + break; + case "FORM_FIELD_CONTENTS": + case 5: + message.textSegmentType = 5; + break; + case "TABLE": + case 6: + message.textSegmentType = 6; + break; + case "TABLE_HEADER": + case 7: + message.textSegmentType = 7; + break; + case "TABLE_ROW": + case 8: + message.textSegmentType = 8; + break; + case "TABLE_CELL": + case 9: + message.textSegmentType = 9; + break; + } + return message; + }; + + /** + * Creates a plain object from a Layout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @static + * @param {google.cloud.automl.v1beta1.Document.Layout} message Layout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Layout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.textSegment = null; + object.pageNumber = 0; + object.boundingPoly = null; + object.textSegmentType = options.enums === String ? "TEXT_SEGMENT_TYPE_UNSPECIFIED" : 0; + } + if (message.textSegment != null && message.hasOwnProperty("textSegment")) + object.textSegment = $root.google.cloud.automl.v1beta1.TextSegment.toObject(message.textSegment, options); + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + object.pageNumber = message.pageNumber; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.automl.v1beta1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.textSegmentType != null && message.hasOwnProperty("textSegmentType")) + object.textSegmentType = options.enums === String ? $root.google.cloud.automl.v1beta1.Document.Layout.TextSegmentType[message.textSegmentType] === undefined ? message.textSegmentType : $root.google.cloud.automl.v1beta1.Document.Layout.TextSegmentType[message.textSegmentType] : message.textSegmentType; + return object; + }; + + /** + * Converts this Layout to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @instance + * @returns {Object.} JSON object + */ + Layout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Layout + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Layout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.Document.Layout"; + }; + + /** + * TextSegmentType enum. + * @name google.cloud.automl.v1beta1.Document.Layout.TextSegmentType + * @enum {number} + * @property {number} TEXT_SEGMENT_TYPE_UNSPECIFIED=0 TEXT_SEGMENT_TYPE_UNSPECIFIED value + * @property {number} TOKEN=1 TOKEN value + * @property {number} PARAGRAPH=2 PARAGRAPH value + * @property {number} FORM_FIELD=3 FORM_FIELD value + * @property {number} FORM_FIELD_NAME=4 FORM_FIELD_NAME value + * @property {number} FORM_FIELD_CONTENTS=5 FORM_FIELD_CONTENTS value + * @property {number} TABLE=6 TABLE value + * @property {number} TABLE_HEADER=7 TABLE_HEADER value + * @property {number} TABLE_ROW=8 TABLE_ROW value + * @property {number} TABLE_CELL=9 TABLE_CELL value + */ + Layout.TextSegmentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TEXT_SEGMENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TOKEN"] = 1; + values[valuesById[2] = "PARAGRAPH"] = 2; + values[valuesById[3] = "FORM_FIELD"] = 3; + values[valuesById[4] = "FORM_FIELD_NAME"] = 4; + values[valuesById[5] = "FORM_FIELD_CONTENTS"] = 5; + values[valuesById[6] = "TABLE"] = 6; + values[valuesById[7] = "TABLE_HEADER"] = 7; + values[valuesById[8] = "TABLE_ROW"] = 8; + values[valuesById[9] = "TABLE_CELL"] = 9; + return values; + })(); + + return Layout; + })(); + + return Document; + })(); + + v1beta1.Row = (function() { + + /** + * Properties of a Row. + * @memberof google.cloud.automl.v1beta1 + * @interface IRow + * @property {Array.|null} [columnSpecIds] Row columnSpecIds + * @property {Array.|null} [values] Row values + */ + + /** + * Constructs a new Row. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a Row. + * @implements IRow + * @constructor + * @param {google.cloud.automl.v1beta1.IRow=} [properties] Properties to set + */ + function Row(properties) { + this.columnSpecIds = []; + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Row columnSpecIds. + * @member {Array.} columnSpecIds + * @memberof google.cloud.automl.v1beta1.Row + * @instance + */ + Row.prototype.columnSpecIds = $util.emptyArray; + + /** + * Row values. + * @member {Array.} values + * @memberof google.cloud.automl.v1beta1.Row + * @instance + */ + Row.prototype.values = $util.emptyArray; + + /** + * Creates a new Row instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.Row + * @static + * @param {google.cloud.automl.v1beta1.IRow=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.Row} Row instance + */ + Row.create = function create(properties) { + return new Row(properties); + }; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.cloud.automl.v1beta1.Row.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.Row + * @static + * @param {google.cloud.automl.v1beta1.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.columnSpecIds != null && message.columnSpecIds.length) + for (var i = 0; i < message.columnSpecIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.columnSpecIds[i]); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Row.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.Row + * @static + * @param {google.cloud.automl.v1beta1.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.automl.v1beta1.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.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.automl.v1beta1.Row(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.columnSpecIds && message.columnSpecIds.length)) + message.columnSpecIds = []; + message.columnSpecIds.push(reader.string()); + break; + } + case 3: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.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.automl.v1beta1.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.columnSpecIds != null && message.hasOwnProperty("columnSpecIds")) { + if (!Array.isArray(message.columnSpecIds)) + return "columnSpecIds: array expected"; + for (var i = 0; i < message.columnSpecIds.length; ++i) + if (!$util.isString(message.columnSpecIds[i])) + return "columnSpecIds: string[] expected"; + } + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.Row + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.Row} Row + */ + Row.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.Row) + return object; + var message = new $root.google.cloud.automl.v1beta1.Row(); + if (object.columnSpecIds) { + if (!Array.isArray(object.columnSpecIds)) + throw TypeError(".google.cloud.automl.v1beta1.Row.columnSpecIds: array expected"); + message.columnSpecIds = []; + for (var i = 0; i < object.columnSpecIds.length; ++i) + message.columnSpecIds[i] = String(object.columnSpecIds[i]); + } + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.automl.v1beta1.Row.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Row.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.Row + * @static + * @param {google.cloud.automl.v1beta1.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.columnSpecIds = []; + object.values = []; + } + if (message.columnSpecIds && message.columnSpecIds.length) { + object.columnSpecIds = []; + for (var j = 0; j < message.columnSpecIds.length; ++j) + object.columnSpecIds[j] = message.columnSpecIds[j]; + } + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this Row to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.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.automl.v1beta1.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.automl.v1beta1.Row"; + }; + + return Row; + })(); + + v1beta1.ExamplePayload = (function() { + + /** + * Properties of an ExamplePayload. + * @memberof google.cloud.automl.v1beta1 + * @interface IExamplePayload + * @property {google.cloud.automl.v1beta1.IImage|null} [image] ExamplePayload image + * @property {google.cloud.automl.v1beta1.ITextSnippet|null} [textSnippet] ExamplePayload textSnippet + * @property {google.cloud.automl.v1beta1.IDocument|null} [document] ExamplePayload document + * @property {google.cloud.automl.v1beta1.IRow|null} [row] ExamplePayload row + */ + + /** + * Constructs a new ExamplePayload. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ExamplePayload. + * @implements IExamplePayload + * @constructor + * @param {google.cloud.automl.v1beta1.IExamplePayload=} [properties] Properties to set + */ + function ExamplePayload(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExamplePayload image. + * @member {google.cloud.automl.v1beta1.IImage|null|undefined} image + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @instance + */ + ExamplePayload.prototype.image = null; + + /** + * ExamplePayload textSnippet. + * @member {google.cloud.automl.v1beta1.ITextSnippet|null|undefined} textSnippet + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @instance + */ + ExamplePayload.prototype.textSnippet = null; + + /** + * ExamplePayload document. + * @member {google.cloud.automl.v1beta1.IDocument|null|undefined} document + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @instance + */ + ExamplePayload.prototype.document = null; + + /** + * ExamplePayload row. + * @member {google.cloud.automl.v1beta1.IRow|null|undefined} row + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @instance + */ + ExamplePayload.prototype.row = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExamplePayload payload. + * @member {"image"|"textSnippet"|"document"|"row"|undefined} payload + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @instance + */ + Object.defineProperty(ExamplePayload.prototype, "payload", { + get: $util.oneOfGetter($oneOfFields = ["image", "textSnippet", "document", "row"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExamplePayload instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @static + * @param {google.cloud.automl.v1beta1.IExamplePayload=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExamplePayload} ExamplePayload instance + */ + ExamplePayload.create = function create(properties) { + return new ExamplePayload(properties); + }; + + /** + * Encodes the specified ExamplePayload message. Does not implicitly {@link google.cloud.automl.v1beta1.ExamplePayload.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @static + * @param {google.cloud.automl.v1beta1.IExamplePayload} message ExamplePayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExamplePayload.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.automl.v1beta1.Image.encode(message.image, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.textSnippet != null && Object.hasOwnProperty.call(message, "textSnippet")) + $root.google.cloud.automl.v1beta1.TextSnippet.encode(message.textSnippet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.row != null && Object.hasOwnProperty.call(message, "row")) + $root.google.cloud.automl.v1beta1.Row.encode(message.row, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.automl.v1beta1.Document.encode(message.document, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExamplePayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExamplePayload.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @static + * @param {google.cloud.automl.v1beta1.IExamplePayload} message ExamplePayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExamplePayload.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExamplePayload message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ExamplePayload} ExamplePayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExamplePayload.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ExamplePayload(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.image = $root.google.cloud.automl.v1beta1.Image.decode(reader, reader.uint32()); + break; + } + case 2: { + message.textSnippet = $root.google.cloud.automl.v1beta1.TextSnippet.decode(reader, reader.uint32()); + break; + } + case 4: { + message.document = $root.google.cloud.automl.v1beta1.Document.decode(reader, reader.uint32()); + break; + } + case 3: { + message.row = $root.google.cloud.automl.v1beta1.Row.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExamplePayload message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ExamplePayload} ExamplePayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExamplePayload.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExamplePayload message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExamplePayload.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.image != null && message.hasOwnProperty("image")) { + properties.payload = 1; + { + var error = $root.google.cloud.automl.v1beta1.Image.verify(message.image); + if (error) + return "image." + error; + } + } + if (message.textSnippet != null && message.hasOwnProperty("textSnippet")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextSnippet.verify(message.textSnippet); + if (error) + return "textSnippet." + error; + } + } + if (message.document != null && message.hasOwnProperty("document")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.cloud.automl.v1beta1.Document.verify(message.document); + if (error) + return "document." + error; + } + } + if (message.row != null && message.hasOwnProperty("row")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.cloud.automl.v1beta1.Row.verify(message.row); + if (error) + return "row." + error; + } + } + return null; + }; + + /** + * Creates an ExamplePayload message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExamplePayload} ExamplePayload + */ + ExamplePayload.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExamplePayload) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExamplePayload(); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExamplePayload.image: object expected"); + message.image = $root.google.cloud.automl.v1beta1.Image.fromObject(object.image); + } + if (object.textSnippet != null) { + if (typeof object.textSnippet !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExamplePayload.textSnippet: object expected"); + message.textSnippet = $root.google.cloud.automl.v1beta1.TextSnippet.fromObject(object.textSnippet); + } + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExamplePayload.document: object expected"); + message.document = $root.google.cloud.automl.v1beta1.Document.fromObject(object.document); + } + if (object.row != null) { + if (typeof object.row !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExamplePayload.row: object expected"); + message.row = $root.google.cloud.automl.v1beta1.Row.fromObject(object.row); + } + return message; + }; + + /** + * Creates a plain object from an ExamplePayload message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @static + * @param {google.cloud.automl.v1beta1.ExamplePayload} message ExamplePayload + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExamplePayload.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.image != null && message.hasOwnProperty("image")) { + object.image = $root.google.cloud.automl.v1beta1.Image.toObject(message.image, options); + if (options.oneofs) + object.payload = "image"; + } + if (message.textSnippet != null && message.hasOwnProperty("textSnippet")) { + object.textSnippet = $root.google.cloud.automl.v1beta1.TextSnippet.toObject(message.textSnippet, options); + if (options.oneofs) + object.payload = "textSnippet"; + } + if (message.row != null && message.hasOwnProperty("row")) { + object.row = $root.google.cloud.automl.v1beta1.Row.toObject(message.row, options); + if (options.oneofs) + object.payload = "row"; + } + if (message.document != null && message.hasOwnProperty("document")) { + object.document = $root.google.cloud.automl.v1beta1.Document.toObject(message.document, options); + if (options.oneofs) + object.payload = "document"; + } + return object; + }; + + /** + * Converts this ExamplePayload to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @instance + * @returns {Object.} JSON object + */ + ExamplePayload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExamplePayload + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExamplePayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ExamplePayload"; + }; + + return ExamplePayload; + })(); + + v1beta1.InputConfig = (function() { + + /** + * Properties of an InputConfig. + * @memberof google.cloud.automl.v1beta1 + * @interface IInputConfig + * @property {google.cloud.automl.v1beta1.IGcsSource|null} [gcsSource] InputConfig gcsSource + * @property {google.cloud.automl.v1beta1.IBigQuerySource|null} [bigquerySource] InputConfig bigquerySource + * @property {Object.|null} [params] InputConfig params + */ + + /** + * Constructs a new InputConfig. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an InputConfig. + * @implements IInputConfig + * @constructor + * @param {google.cloud.automl.v1beta1.IInputConfig=} [properties] Properties to set + */ + function InputConfig(properties) { + this.params = {}; + if (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 gcsSource. + * @member {google.cloud.automl.v1beta1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.automl.v1beta1.InputConfig + * @instance + */ + InputConfig.prototype.gcsSource = null; + + /** + * InputConfig bigquerySource. + * @member {google.cloud.automl.v1beta1.IBigQuerySource|null|undefined} bigquerySource + * @memberof google.cloud.automl.v1beta1.InputConfig + * @instance + */ + InputConfig.prototype.bigquerySource = null; + + /** + * InputConfig params. + * @member {Object.} params + * @memberof google.cloud.automl.v1beta1.InputConfig + * @instance + */ + InputConfig.prototype.params = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InputConfig source. + * @member {"gcsSource"|"bigquerySource"|undefined} source + * @memberof google.cloud.automl.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.automl.v1beta1.InputConfig + * @static + * @param {google.cloud.automl.v1beta1.IInputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.InputConfig} InputConfig instance + */ + InputConfig.create = function create(properties) { + return new InputConfig(properties); + }; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.InputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.InputConfig + * @static + * @param {google.cloud.automl.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.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.automl.v1beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.params[keys[i]]).ldelim(); + if (message.bigquerySource != null && Object.hasOwnProperty.call(message, "bigquerySource")) + $root.google.cloud.automl.v1beta1.BigQuerySource.encode(message.bigquerySource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.InputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.InputConfig + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.InputConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsSource = $root.google.cloud.automl.v1beta1.GcsSource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.bigquerySource = $root.google.cloud.automl.v1beta1.BigQuerySource.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + 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.automl.v1beta1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.automl.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.automl.v1beta1.BigQuerySource.verify(message.bigquerySource); + if (error) + return "bigquerySource." + error; + } + } + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an InputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.InputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.InputConfig} InputConfig + */ + InputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.InputConfig) + return object; + var message = new $root.google.cloud.automl.v1beta1.InputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.automl.v1beta1.InputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.automl.v1beta1.GcsSource.fromObject(object.gcsSource); + } + if (object.bigquerySource != null) { + if (typeof object.bigquerySource !== "object") + throw TypeError(".google.cloud.automl.v1beta1.InputConfig.bigquerySource: object expected"); + message.bigquerySource = $root.google.cloud.automl.v1beta1.BigQuerySource.fromObject(object.bigquerySource); + } + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.automl.v1beta1.InputConfig.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.InputConfig + * @static + * @param {google.cloud.automl.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.objects || options.defaults) + object.params = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.automl.v1beta1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { + object.bigquerySource = $root.google.cloud.automl.v1beta1.BigQuerySource.toObject(message.bigquerySource, options); + if (options.oneofs) + object.source = "bigquerySource"; + } + return object; + }; + + /** + * Converts this InputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.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.automl.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.automl.v1beta1.InputConfig"; + }; + + return InputConfig; + })(); + + v1beta1.BatchPredictInputConfig = (function() { + + /** + * Properties of a BatchPredictInputConfig. + * @memberof google.cloud.automl.v1beta1 + * @interface IBatchPredictInputConfig + * @property {google.cloud.automl.v1beta1.IGcsSource|null} [gcsSource] BatchPredictInputConfig gcsSource + * @property {google.cloud.automl.v1beta1.IBigQuerySource|null} [bigquerySource] BatchPredictInputConfig bigquerySource + */ + + /** + * Constructs a new BatchPredictInputConfig. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a BatchPredictInputConfig. + * @implements IBatchPredictInputConfig + * @constructor + * @param {google.cloud.automl.v1beta1.IBatchPredictInputConfig=} [properties] Properties to set + */ + function BatchPredictInputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictInputConfig gcsSource. + * @member {google.cloud.automl.v1beta1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @instance + */ + BatchPredictInputConfig.prototype.gcsSource = null; + + /** + * BatchPredictInputConfig bigquerySource. + * @member {google.cloud.automl.v1beta1.IBigQuerySource|null|undefined} bigquerySource + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @instance + */ + BatchPredictInputConfig.prototype.bigquerySource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchPredictInputConfig source. + * @member {"gcsSource"|"bigquerySource"|undefined} source + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @instance + */ + Object.defineProperty(BatchPredictInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource", "bigquerySource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchPredictInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictInputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BatchPredictInputConfig} BatchPredictInputConfig instance + */ + BatchPredictInputConfig.create = function create(properties) { + return new BatchPredictInputConfig(properties); + }; + + /** + * Encodes the specified BatchPredictInputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictInputConfig} message BatchPredictInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.automl.v1beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bigquerySource != null && Object.hasOwnProperty.call(message, "bigquerySource")) + $root.google.cloud.automl.v1beta1.BigQuerySource.encode(message.bigquerySource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictInputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictInputConfig} message BatchPredictInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.BatchPredictInputConfig} BatchPredictInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictInputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.BatchPredictInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsSource = $root.google.cloud.automl.v1beta1.GcsSource.decode(reader, reader.uint32()); + break; + } + case 2: { + message.bigquerySource = $root.google.cloud.automl.v1beta1.BigQuerySource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.BatchPredictInputConfig} BatchPredictInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictInputConfig message. + * @function verify + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.automl.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.automl.v1beta1.BigQuerySource.verify(message.bigquerySource); + if (error) + return "bigquerySource." + error; + } + } + return null; + }; + + /** + * Creates a BatchPredictInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BatchPredictInputConfig} BatchPredictInputConfig + */ + BatchPredictInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BatchPredictInputConfig) + return object; + var message = new $root.google.cloud.automl.v1beta1.BatchPredictInputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BatchPredictInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.automl.v1beta1.GcsSource.fromObject(object.gcsSource); + } + if (object.bigquerySource != null) { + if (typeof object.bigquerySource !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BatchPredictInputConfig.bigquerySource: object expected"); + message.bigquerySource = $root.google.cloud.automl.v1beta1.BigQuerySource.fromObject(object.bigquerySource); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @static + * @param {google.cloud.automl.v1beta1.BatchPredictInputConfig} message BatchPredictInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.automl.v1beta1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { + object.bigquerySource = $root.google.cloud.automl.v1beta1.BigQuerySource.toObject(message.bigquerySource, options); + if (options.oneofs) + object.source = "bigquerySource"; + } + return object; + }; + + /** + * Converts this BatchPredictInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @instance + * @returns {Object.} JSON object + */ + BatchPredictInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictInputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.BatchPredictInputConfig"; + }; + + return BatchPredictInputConfig; + })(); + + v1beta1.DocumentInputConfig = (function() { + + /** + * Properties of a DocumentInputConfig. + * @memberof google.cloud.automl.v1beta1 + * @interface IDocumentInputConfig + * @property {google.cloud.automl.v1beta1.IGcsSource|null} [gcsSource] DocumentInputConfig gcsSource + */ + + /** + * Constructs a new DocumentInputConfig. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a DocumentInputConfig. + * @implements IDocumentInputConfig + * @constructor + * @param {google.cloud.automl.v1beta1.IDocumentInputConfig=} [properties] Properties to set + */ + function DocumentInputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentInputConfig gcsSource. + * @member {google.cloud.automl.v1beta1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @instance + */ + DocumentInputConfig.prototype.gcsSource = null; + + /** + * Creates a new DocumentInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @static + * @param {google.cloud.automl.v1beta1.IDocumentInputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.DocumentInputConfig} DocumentInputConfig instance + */ + DocumentInputConfig.create = function create(properties) { + return new DocumentInputConfig(properties); + }; + + /** + * Encodes the specified DocumentInputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.DocumentInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @static + * @param {google.cloud.automl.v1beta1.IDocumentInputConfig} message DocumentInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.automl.v1beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DocumentInputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DocumentInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @static + * @param {google.cloud.automl.v1beta1.IDocumentInputConfig} message DocumentInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.DocumentInputConfig} DocumentInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentInputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.DocumentInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsSource = $root.google.cloud.automl.v1beta1.GcsSource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.DocumentInputConfig} DocumentInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentInputConfig message. + * @function verify + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + var error = $root.google.cloud.automl.v1beta1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + return null; + }; + + /** + * Creates a DocumentInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.DocumentInputConfig} DocumentInputConfig + */ + DocumentInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.DocumentInputConfig) + return object; + var message = new $root.google.cloud.automl.v1beta1.DocumentInputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DocumentInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.automl.v1beta1.GcsSource.fromObject(object.gcsSource); + } + return message; + }; + + /** + * Creates a plain object from a DocumentInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @static + * @param {google.cloud.automl.v1beta1.DocumentInputConfig} message DocumentInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.gcsSource = null; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + object.gcsSource = $root.google.cloud.automl.v1beta1.GcsSource.toObject(message.gcsSource, options); + return object; + }; + + /** + * Converts this DocumentInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @instance + * @returns {Object.} JSON object + */ + DocumentInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentInputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.DocumentInputConfig"; + }; + + return DocumentInputConfig; + })(); + + v1beta1.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.cloud.automl.v1beta1 + * @interface IOutputConfig + * @property {google.cloud.automl.v1beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + * @property {google.cloud.automl.v1beta1.IBigQueryDestination|null} [bigqueryDestination] OutputConfig bigqueryDestination + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.cloud.automl.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.automl.v1beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + /** + * OutputConfig bigqueryDestination. + * @member {google.cloud.automl.v1beta1.IBigQueryDestination|null|undefined} bigqueryDestination + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @instance + */ + OutputConfig.prototype.bigqueryDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputConfig destination. + * @member {"gcsDestination"|"bigqueryDestination"|undefined} destination + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @instance + */ + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "bigqueryDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @static + * @param {google.cloud.automl.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.automl.v1beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bigqueryDestination != null && Object.hasOwnProperty.call(message, "bigqueryDestination")) + $root.google.cloud.automl.v1beta1.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsDestination = $root.google.cloud.automl.v1beta1.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 2: { + message.bigqueryDestination = $root.google.cloud.automl.v1beta1.BigQueryDestination.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.automl.v1beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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.automl.v1beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + { + var error = $root.google.cloud.automl.v1beta1.BigQueryDestination.verify(message.bigqueryDestination); + if (error) + return "bigqueryDestination." + error; + } + } + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.OutputConfig) + return object; + var message = new $root.google.cloud.automl.v1beta1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.automl.v1beta1.GcsDestination.fromObject(object.gcsDestination); + } + if (object.bigqueryDestination != null) { + if (typeof object.bigqueryDestination !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OutputConfig.bigqueryDestination: object expected"); + message.bigqueryDestination = $root.google.cloud.automl.v1beta1.BigQueryDestination.fromObject(object.bigqueryDestination); + } + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @static + * @param {google.cloud.automl.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.automl.v1beta1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + object.bigqueryDestination = $root.google.cloud.automl.v1beta1.BigQueryDestination.toObject(message.bigqueryDestination, options); + if (options.oneofs) + object.destination = "bigqueryDestination"; + } + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.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.automl.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.automl.v1beta1.OutputConfig"; + }; + + return OutputConfig; + })(); + + v1beta1.BatchPredictOutputConfig = (function() { + + /** + * Properties of a BatchPredictOutputConfig. + * @memberof google.cloud.automl.v1beta1 + * @interface IBatchPredictOutputConfig + * @property {google.cloud.automl.v1beta1.IGcsDestination|null} [gcsDestination] BatchPredictOutputConfig gcsDestination + * @property {google.cloud.automl.v1beta1.IBigQueryDestination|null} [bigqueryDestination] BatchPredictOutputConfig bigqueryDestination + */ + + /** + * Constructs a new BatchPredictOutputConfig. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a BatchPredictOutputConfig. + * @implements IBatchPredictOutputConfig + * @constructor + * @param {google.cloud.automl.v1beta1.IBatchPredictOutputConfig=} [properties] Properties to set + */ + function BatchPredictOutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictOutputConfig gcsDestination. + * @member {google.cloud.automl.v1beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @instance + */ + BatchPredictOutputConfig.prototype.gcsDestination = null; + + /** + * BatchPredictOutputConfig bigqueryDestination. + * @member {google.cloud.automl.v1beta1.IBigQueryDestination|null|undefined} bigqueryDestination + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @instance + */ + BatchPredictOutputConfig.prototype.bigqueryDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchPredictOutputConfig destination. + * @member {"gcsDestination"|"bigqueryDestination"|undefined} destination + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @instance + */ + Object.defineProperty(BatchPredictOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "bigqueryDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchPredictOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictOutputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BatchPredictOutputConfig} BatchPredictOutputConfig instance + */ + BatchPredictOutputConfig.create = function create(properties) { + return new BatchPredictOutputConfig(properties); + }; + + /** + * Encodes the specified BatchPredictOutputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictOutputConfig} message BatchPredictOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.automl.v1beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bigqueryDestination != null && Object.hasOwnProperty.call(message, "bigqueryDestination")) + $root.google.cloud.automl.v1beta1.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictOutputConfig} message BatchPredictOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.BatchPredictOutputConfig} BatchPredictOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.BatchPredictOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsDestination = $root.google.cloud.automl.v1beta1.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 2: { + message.bigqueryDestination = $root.google.cloud.automl.v1beta1.BigQueryDestination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.BatchPredictOutputConfig} BatchPredictOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictOutputConfig message. + * @function verify + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictOutputConfig.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.automl.v1beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + { + var error = $root.google.cloud.automl.v1beta1.BigQueryDestination.verify(message.bigqueryDestination); + if (error) + return "bigqueryDestination." + error; + } + } + return null; + }; + + /** + * Creates a BatchPredictOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BatchPredictOutputConfig} BatchPredictOutputConfig + */ + BatchPredictOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BatchPredictOutputConfig) + return object; + var message = new $root.google.cloud.automl.v1beta1.BatchPredictOutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BatchPredictOutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.automl.v1beta1.GcsDestination.fromObject(object.gcsDestination); + } + if (object.bigqueryDestination != null) { + if (typeof object.bigqueryDestination !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BatchPredictOutputConfig.bigqueryDestination: object expected"); + message.bigqueryDestination = $root.google.cloud.automl.v1beta1.BigQueryDestination.fromObject(object.bigqueryDestination); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.BatchPredictOutputConfig} message BatchPredictOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.automl.v1beta1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + object.bigqueryDestination = $root.google.cloud.automl.v1beta1.BigQueryDestination.toObject(message.bigqueryDestination, options); + if (options.oneofs) + object.destination = "bigqueryDestination"; + } + return object; + }; + + /** + * Converts this BatchPredictOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @instance + * @returns {Object.} JSON object + */ + BatchPredictOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictOutputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.BatchPredictOutputConfig"; + }; + + return BatchPredictOutputConfig; + })(); + + v1beta1.ModelExportOutputConfig = (function() { + + /** + * Properties of a ModelExportOutputConfig. + * @memberof google.cloud.automl.v1beta1 + * @interface IModelExportOutputConfig + * @property {google.cloud.automl.v1beta1.IGcsDestination|null} [gcsDestination] ModelExportOutputConfig gcsDestination + * @property {google.cloud.automl.v1beta1.IGcrDestination|null} [gcrDestination] ModelExportOutputConfig gcrDestination + * @property {string|null} [modelFormat] ModelExportOutputConfig modelFormat + * @property {Object.|null} [params] ModelExportOutputConfig params + */ + + /** + * Constructs a new ModelExportOutputConfig. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ModelExportOutputConfig. + * @implements IModelExportOutputConfig + * @constructor + * @param {google.cloud.automl.v1beta1.IModelExportOutputConfig=} [properties] Properties to set + */ + function ModelExportOutputConfig(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelExportOutputConfig gcsDestination. + * @member {google.cloud.automl.v1beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @instance + */ + ModelExportOutputConfig.prototype.gcsDestination = null; + + /** + * ModelExportOutputConfig gcrDestination. + * @member {google.cloud.automl.v1beta1.IGcrDestination|null|undefined} gcrDestination + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @instance + */ + ModelExportOutputConfig.prototype.gcrDestination = null; + + /** + * ModelExportOutputConfig modelFormat. + * @member {string} modelFormat + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @instance + */ + ModelExportOutputConfig.prototype.modelFormat = ""; + + /** + * ModelExportOutputConfig params. + * @member {Object.} params + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @instance + */ + ModelExportOutputConfig.prototype.params = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ModelExportOutputConfig destination. + * @member {"gcsDestination"|"gcrDestination"|undefined} destination + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @instance + */ + Object.defineProperty(ModelExportOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "gcrDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ModelExportOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IModelExportOutputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ModelExportOutputConfig} ModelExportOutputConfig instance + */ + ModelExportOutputConfig.create = function create(properties) { + return new ModelExportOutputConfig(properties); + }; + + /** + * Encodes the specified ModelExportOutputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.ModelExportOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IModelExportOutputConfig} message ModelExportOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelExportOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.automl.v1beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.params[keys[i]]).ldelim(); + if (message.gcrDestination != null && Object.hasOwnProperty.call(message, "gcrDestination")) + $root.google.cloud.automl.v1beta1.GcrDestination.encode(message.gcrDestination, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.modelFormat != null && Object.hasOwnProperty.call(message, "modelFormat")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.modelFormat); + return writer; + }; + + /** + * Encodes the specified ModelExportOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ModelExportOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IModelExportOutputConfig} message ModelExportOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelExportOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelExportOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ModelExportOutputConfig} ModelExportOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelExportOutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ModelExportOutputConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsDestination = $root.google.cloud.automl.v1beta1.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 3: { + message.gcrDestination = $root.google.cloud.automl.v1beta1.GcrDestination.decode(reader, reader.uint32()); + break; + } + case 4: { + message.modelFormat = reader.string(); + break; + } + case 2: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelExportOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ModelExportOutputConfig} ModelExportOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelExportOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelExportOutputConfig message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelExportOutputConfig.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.automl.v1beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.gcrDestination != null && message.hasOwnProperty("gcrDestination")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + { + var error = $root.google.cloud.automl.v1beta1.GcrDestination.verify(message.gcrDestination); + if (error) + return "gcrDestination." + error; + } + } + if (message.modelFormat != null && message.hasOwnProperty("modelFormat")) + if (!$util.isString(message.modelFormat)) + return "modelFormat: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a ModelExportOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ModelExportOutputConfig} ModelExportOutputConfig + */ + ModelExportOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ModelExportOutputConfig) + return object; + var message = new $root.google.cloud.automl.v1beta1.ModelExportOutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelExportOutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.automl.v1beta1.GcsDestination.fromObject(object.gcsDestination); + } + if (object.gcrDestination != null) { + if (typeof object.gcrDestination !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelExportOutputConfig.gcrDestination: object expected"); + message.gcrDestination = $root.google.cloud.automl.v1beta1.GcrDestination.fromObject(object.gcrDestination); + } + if (object.modelFormat != null) + message.modelFormat = String(object.modelFormat); + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelExportOutputConfig.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a ModelExportOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.ModelExportOutputConfig} message ModelExportOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelExportOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) + object.modelFormat = ""; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.automl.v1beta1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + if (message.gcrDestination != null && message.hasOwnProperty("gcrDestination")) { + object.gcrDestination = $root.google.cloud.automl.v1beta1.GcrDestination.toObject(message.gcrDestination, options); + if (options.oneofs) + object.destination = "gcrDestination"; + } + if (message.modelFormat != null && message.hasOwnProperty("modelFormat")) + object.modelFormat = message.modelFormat; + return object; + }; + + /** + * Converts this ModelExportOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @instance + * @returns {Object.} JSON object + */ + ModelExportOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelExportOutputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelExportOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ModelExportOutputConfig"; + }; + + return ModelExportOutputConfig; + })(); + + v1beta1.ExportEvaluatedExamplesOutputConfig = (function() { + + /** + * Properties of an ExportEvaluatedExamplesOutputConfig. + * @memberof google.cloud.automl.v1beta1 + * @interface IExportEvaluatedExamplesOutputConfig + * @property {google.cloud.automl.v1beta1.IBigQueryDestination|null} [bigqueryDestination] ExportEvaluatedExamplesOutputConfig bigqueryDestination + */ + + /** + * Constructs a new ExportEvaluatedExamplesOutputConfig. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ExportEvaluatedExamplesOutputConfig. + * @implements IExportEvaluatedExamplesOutputConfig + * @constructor + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig=} [properties] Properties to set + */ + function ExportEvaluatedExamplesOutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportEvaluatedExamplesOutputConfig bigqueryDestination. + * @member {google.cloud.automl.v1beta1.IBigQueryDestination|null|undefined} bigqueryDestination + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @instance + */ + ExportEvaluatedExamplesOutputConfig.prototype.bigqueryDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportEvaluatedExamplesOutputConfig destination. + * @member {"bigqueryDestination"|undefined} destination + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @instance + */ + Object.defineProperty(ExportEvaluatedExamplesOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["bigqueryDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportEvaluatedExamplesOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig} ExportEvaluatedExamplesOutputConfig instance + */ + ExportEvaluatedExamplesOutputConfig.create = function create(properties) { + return new ExportEvaluatedExamplesOutputConfig(properties); + }; + + /** + * Encodes the specified ExportEvaluatedExamplesOutputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig} message ExportEvaluatedExamplesOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEvaluatedExamplesOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bigqueryDestination != null && Object.hasOwnProperty.call(message, "bigqueryDestination")) + $root.google.cloud.automl.v1beta1.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportEvaluatedExamplesOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig} message ExportEvaluatedExamplesOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEvaluatedExamplesOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportEvaluatedExamplesOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig} ExportEvaluatedExamplesOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEvaluatedExamplesOutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.bigqueryDestination = $root.google.cloud.automl.v1beta1.BigQueryDestination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportEvaluatedExamplesOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig} ExportEvaluatedExamplesOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEvaluatedExamplesOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportEvaluatedExamplesOutputConfig message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEvaluatedExamplesOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.automl.v1beta1.BigQueryDestination.verify(message.bigqueryDestination); + if (error) + return "bigqueryDestination." + error; + } + } + return null; + }; + + /** + * Creates an ExportEvaluatedExamplesOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig} ExportEvaluatedExamplesOutputConfig + */ + ExportEvaluatedExamplesOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig(); + if (object.bigqueryDestination != null) { + if (typeof object.bigqueryDestination !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.bigqueryDestination: object expected"); + message.bigqueryDestination = $root.google.cloud.automl.v1beta1.BigQueryDestination.fromObject(object.bigqueryDestination); + } + return message; + }; + + /** + * Creates a plain object from an ExportEvaluatedExamplesOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig} message ExportEvaluatedExamplesOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEvaluatedExamplesOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + object.bigqueryDestination = $root.google.cloud.automl.v1beta1.BigQueryDestination.toObject(message.bigqueryDestination, options); + if (options.oneofs) + object.destination = "bigqueryDestination"; + } + return object; + }; + + /** + * Converts this ExportEvaluatedExamplesOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @instance + * @returns {Object.} JSON object + */ + ExportEvaluatedExamplesOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportEvaluatedExamplesOutputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportEvaluatedExamplesOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig"; + }; + + return ExportEvaluatedExamplesOutputConfig; + })(); + + v1beta1.GcsSource = (function() { + + /** + * Properties of a GcsSource. + * @memberof google.cloud.automl.v1beta1 + * @interface IGcsSource + * @property {Array.|null} [inputUris] GcsSource inputUris + */ + + /** + * Constructs a new GcsSource. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a GcsSource. + * @implements IGcsSource + * @constructor + * @param {google.cloud.automl.v1beta1.IGcsSource=} [properties] Properties to set + */ + function GcsSource(properties) { + this.inputUris = []; + if (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 inputUris. + * @member {Array.} inputUris + * @memberof google.cloud.automl.v1beta1.GcsSource + * @instance + */ + GcsSource.prototype.inputUris = $util.emptyArray; + + /** + * Creates a new GcsSource instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.GcsSource + * @static + * @param {google.cloud.automl.v1beta1.IGcsSource=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.GcsSource} GcsSource instance + */ + GcsSource.create = function create(properties) { + return new GcsSource(properties); + }; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.automl.v1beta1.GcsSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.GcsSource + * @static + * @param {google.cloud.automl.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.inputUris != null && message.inputUris.length) + for (var i = 0; i < message.inputUris.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUris[i]); + return writer; + }; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.GcsSource + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.GcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.inputUris && message.inputUris.length)) + message.inputUris = []; + message.inputUris.push(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.automl.v1beta1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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.inputUris != null && message.hasOwnProperty("inputUris")) { + if (!Array.isArray(message.inputUris)) + return "inputUris: array expected"; + for (var i = 0; i < message.inputUris.length; ++i) + if (!$util.isString(message.inputUris[i])) + return "inputUris: 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.automl.v1beta1.GcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.GcsSource} GcsSource + */ + GcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.GcsSource) + return object; + var message = new $root.google.cloud.automl.v1beta1.GcsSource(); + if (object.inputUris) { + if (!Array.isArray(object.inputUris)) + throw TypeError(".google.cloud.automl.v1beta1.GcsSource.inputUris: array expected"); + message.inputUris = []; + for (var i = 0; i < object.inputUris.length; ++i) + message.inputUris[i] = String(object.inputUris[i]); + } + return message; + }; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.GcsSource + * @static + * @param {google.cloud.automl.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.arrays || options.defaults) + object.inputUris = []; + if (message.inputUris && message.inputUris.length) { + object.inputUris = []; + for (var j = 0; j < message.inputUris.length; ++j) + object.inputUris[j] = message.inputUris[j]; + } + return object; + }; + + /** + * Converts this GcsSource to JSON. + * @function toJSON + * @memberof google.cloud.automl.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.automl.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.automl.v1beta1.GcsSource"; + }; + + return GcsSource; + })(); + + v1beta1.BigQuerySource = (function() { + + /** + * Properties of a BigQuerySource. + * @memberof google.cloud.automl.v1beta1 + * @interface IBigQuerySource + * @property {string|null} [inputUri] BigQuerySource inputUri + */ + + /** + * Constructs a new BigQuerySource. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a BigQuerySource. + * @implements IBigQuerySource + * @constructor + * @param {google.cloud.automl.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.automl.v1beta1.BigQuerySource + * @instance + */ + BigQuerySource.prototype.inputUri = ""; + + /** + * Creates a new BigQuerySource instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BigQuerySource + * @static + * @param {google.cloud.automl.v1beta1.IBigQuerySource=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BigQuerySource} BigQuerySource instance + */ + BigQuerySource.create = function create(properties) { + return new BigQuerySource(properties); + }; + + /** + * Encodes the specified BigQuerySource message. Does not implicitly {@link google.cloud.automl.v1beta1.BigQuerySource.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BigQuerySource + * @static + * @param {google.cloud.automl.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.automl.v1beta1.BigQuerySource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BigQuerySource + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.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.automl.v1beta1.BigQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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.automl.v1beta1.BigQuerySource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BigQuerySource} BigQuerySource + */ + BigQuerySource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BigQuerySource) + return object; + var message = new $root.google.cloud.automl.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.automl.v1beta1.BigQuerySource + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.BigQuerySource"; + }; + + return BigQuerySource; + })(); + + v1beta1.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.automl.v1beta1 + * @interface IGcsDestination + * @property {string|null} [outputUriPrefix] GcsDestination outputUriPrefix + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.automl.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 outputUriPrefix. + * @member {string} outputUriPrefix + * @memberof google.cloud.automl.v1beta1.GcsDestination + * @instance + */ + GcsDestination.prototype.outputUriPrefix = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.GcsDestination + * @static + * @param {google.cloud.automl.v1beta1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.automl.v1beta1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.GcsDestination + * @static + * @param {google.cloud.automl.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.outputUriPrefix != null && Object.hasOwnProperty.call(message, "outputUriPrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUriPrefix); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.GcsDestination + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.outputUriPrefix = 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.automl.v1beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + if (!$util.isString(message.outputUriPrefix)) + return "outputUriPrefix: 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.automl.v1beta1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.GcsDestination) + return object; + var message = new $root.google.cloud.automl.v1beta1.GcsDestination(); + if (object.outputUriPrefix != null) + message.outputUriPrefix = String(object.outputUriPrefix); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.GcsDestination + * @static + * @param {google.cloud.automl.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.outputUriPrefix = ""; + if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + object.outputUriPrefix = message.outputUriPrefix; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.automl.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.automl.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.automl.v1beta1.GcsDestination"; + }; + + return GcsDestination; + })(); + + v1beta1.BigQueryDestination = (function() { + + /** + * Properties of a BigQueryDestination. + * @memberof google.cloud.automl.v1beta1 + * @interface IBigQueryDestination + * @property {string|null} [outputUri] BigQueryDestination outputUri + */ + + /** + * Constructs a new BigQueryDestination. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a BigQueryDestination. + * @implements IBigQueryDestination + * @constructor + * @param {google.cloud.automl.v1beta1.IBigQueryDestination=} [properties] Properties to set + */ + function BigQueryDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQueryDestination outputUri. + * @member {string} outputUri + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.outputUri = ""; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @static + * @param {google.cloud.automl.v1beta1.IBigQueryDestination=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BigQueryDestination} BigQueryDestination instance + */ + BigQueryDestination.create = function create(properties) { + return new BigQueryDestination(properties); + }; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.automl.v1beta1.BigQueryDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @static + * @param {google.cloud.automl.v1beta1.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.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); + return writer; + }; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BigQueryDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @static + * @param {google.cloud.automl.v1beta1.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.BigQueryDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.outputUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryDestination message. + * @function verify + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryDestination.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"; + return null; + }; + + /** + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BigQueryDestination} BigQueryDestination + */ + BigQueryDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BigQueryDestination) + return object; + var message = new $root.google.cloud.automl.v1beta1.BigQueryDestination(); + if (object.outputUri != null) + message.outputUri = String(object.outputUri); + return message; + }; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @static + * @param {google.cloud.automl.v1beta1.BigQueryDestination} message BigQueryDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputUri = ""; + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + object.outputUri = message.outputUri; + return object; + }; + + /** + * Converts this BigQueryDestination to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @instance + * @returns {Object.} JSON object + */ + BigQueryDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQueryDestination + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.BigQueryDestination"; + }; + + return BigQueryDestination; + })(); + + v1beta1.GcrDestination = (function() { + + /** + * Properties of a GcrDestination. + * @memberof google.cloud.automl.v1beta1 + * @interface IGcrDestination + * @property {string|null} [outputUri] GcrDestination outputUri + */ + + /** + * Constructs a new GcrDestination. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a GcrDestination. + * @implements IGcrDestination + * @constructor + * @param {google.cloud.automl.v1beta1.IGcrDestination=} [properties] Properties to set + */ + function GcrDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcrDestination outputUri. + * @member {string} outputUri + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @instance + */ + GcrDestination.prototype.outputUri = ""; + + /** + * Creates a new GcrDestination instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @static + * @param {google.cloud.automl.v1beta1.IGcrDestination=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.GcrDestination} GcrDestination instance + */ + GcrDestination.create = function create(properties) { + return new GcrDestination(properties); + }; + + /** + * Encodes the specified GcrDestination message. Does not implicitly {@link google.cloud.automl.v1beta1.GcrDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @static + * @param {google.cloud.automl.v1beta1.IGcrDestination} message GcrDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcrDestination.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); + return writer; + }; + + /** + * Encodes the specified GcrDestination message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GcrDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @static + * @param {google.cloud.automl.v1beta1.IGcrDestination} message GcrDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcrDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcrDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.GcrDestination} GcrDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcrDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.GcrDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.outputUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcrDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.GcrDestination} GcrDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcrDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcrDestination message. + * @function verify + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcrDestination.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"; + return null; + }; + + /** + * Creates a GcrDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.GcrDestination} GcrDestination + */ + GcrDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.GcrDestination) + return object; + var message = new $root.google.cloud.automl.v1beta1.GcrDestination(); + if (object.outputUri != null) + message.outputUri = String(object.outputUri); + return message; + }; + + /** + * Creates a plain object from a GcrDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @static + * @param {google.cloud.automl.v1beta1.GcrDestination} message GcrDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcrDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputUri = ""; + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + object.outputUri = message.outputUri; + return object; + }; + + /** + * Converts this GcrDestination to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @instance + * @returns {Object.} JSON object + */ + GcrDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcrDestination + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcrDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.GcrDestination"; + }; + + return GcrDestination; + })(); + + v1beta1.TextSegment = (function() { + + /** + * Properties of a TextSegment. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextSegment + * @property {string|null} [content] TextSegment content + * @property {number|Long|null} [startOffset] TextSegment startOffset + * @property {number|Long|null} [endOffset] TextSegment endOffset + */ + + /** + * Constructs a new TextSegment. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextSegment. + * @implements ITextSegment + * @constructor + * @param {google.cloud.automl.v1beta1.ITextSegment=} [properties] Properties to set + */ + function TextSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSegment content. + * @member {string} content + * @memberof google.cloud.automl.v1beta1.TextSegment + * @instance + */ + TextSegment.prototype.content = ""; + + /** + * TextSegment startOffset. + * @member {number|Long} startOffset + * @memberof google.cloud.automl.v1beta1.TextSegment + * @instance + */ + TextSegment.prototype.startOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TextSegment endOffset. + * @member {number|Long} endOffset + * @memberof google.cloud.automl.v1beta1.TextSegment + * @instance + */ + TextSegment.prototype.endOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TextSegment instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextSegment + * @static + * @param {google.cloud.automl.v1beta1.ITextSegment=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextSegment} TextSegment instance + */ + TextSegment.create = function create(properties) { + return new TextSegment(properties); + }; + + /** + * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextSegment + * @static + * @param {google.cloud.automl.v1beta1.ITextSegment} message TextSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startOffset != null && Object.hasOwnProperty.call(message, "startOffset")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.startOffset); + if (message.endOffset != null && Object.hasOwnProperty.call(message, "endOffset")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.endOffset); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.content); + return writer; + }; + + /** + * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSegment + * @static + * @param {google.cloud.automl.v1beta1.ITextSegment} message TextSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextSegment} TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSegment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.content = reader.string(); + break; + } + case 1: { + message.startOffset = reader.int64(); + break; + } + case 2: { + message.endOffset = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextSegment} TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSegment message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + if (!$util.isInteger(message.startOffset) && !(message.startOffset && $util.isInteger(message.startOffset.low) && $util.isInteger(message.startOffset.high))) + return "startOffset: integer|Long expected"; + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + if (!$util.isInteger(message.endOffset) && !(message.endOffset && $util.isInteger(message.endOffset.low) && $util.isInteger(message.endOffset.high))) + return "endOffset: integer|Long expected"; + return null; + }; + + /** + * Creates a TextSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextSegment} TextSegment + */ + TextSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextSegment) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextSegment(); + if (object.content != null) + message.content = String(object.content); + if (object.startOffset != null) + if ($util.Long) + (message.startOffset = $util.Long.fromValue(object.startOffset)).unsigned = false; + else if (typeof object.startOffset === "string") + message.startOffset = parseInt(object.startOffset, 10); + else if (typeof object.startOffset === "number") + message.startOffset = object.startOffset; + else if (typeof object.startOffset === "object") + message.startOffset = new $util.LongBits(object.startOffset.low >>> 0, object.startOffset.high >>> 0).toNumber(); + if (object.endOffset != null) + if ($util.Long) + (message.endOffset = $util.Long.fromValue(object.endOffset)).unsigned = false; + else if (typeof object.endOffset === "string") + message.endOffset = parseInt(object.endOffset, 10); + else if (typeof object.endOffset === "number") + message.endOffset = object.endOffset; + else if (typeof object.endOffset === "object") + message.endOffset = new $util.LongBits(object.endOffset.low >>> 0, object.endOffset.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a TextSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextSegment + * @static + * @param {google.cloud.automl.v1beta1.TextSegment} message TextSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.startOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startOffset = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.endOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.endOffset = options.longs === String ? "0" : 0; + object.content = ""; + } + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + if (typeof message.startOffset === "number") + object.startOffset = options.longs === String ? String(message.startOffset) : message.startOffset; + else + object.startOffset = options.longs === String ? $util.Long.prototype.toString.call(message.startOffset) : options.longs === Number ? new $util.LongBits(message.startOffset.low >>> 0, message.startOffset.high >>> 0).toNumber() : message.startOffset; + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + if (typeof message.endOffset === "number") + object.endOffset = options.longs === String ? String(message.endOffset) : message.endOffset; + else + object.endOffset = options.longs === String ? $util.Long.prototype.toString.call(message.endOffset) : options.longs === Number ? new $util.LongBits(message.endOffset.low >>> 0, message.endOffset.high >>> 0).toNumber() : message.endOffset; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + return object; + }; + + /** + * Converts this TextSegment to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextSegment + * @instance + * @returns {Object.} JSON object + */ + TextSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSegment + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextSegment"; + }; + + return TextSegment; + })(); + + v1beta1.DoubleRange = (function() { + + /** + * Properties of a DoubleRange. + * @memberof google.cloud.automl.v1beta1 + * @interface IDoubleRange + * @property {number|null} [start] DoubleRange start + * @property {number|null} [end] DoubleRange end + */ + + /** + * Constructs a new DoubleRange. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a DoubleRange. + * @implements IDoubleRange + * @constructor + * @param {google.cloud.automl.v1beta1.IDoubleRange=} [properties] Properties to set + */ + function DoubleRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleRange start. + * @member {number} start + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @instance + */ + DoubleRange.prototype.start = 0; + + /** + * DoubleRange end. + * @member {number} end + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @instance + */ + DoubleRange.prototype.end = 0; + + /** + * Creates a new DoubleRange instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @static + * @param {google.cloud.automl.v1beta1.IDoubleRange=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.DoubleRange} DoubleRange instance + */ + DoubleRange.create = function create(properties) { + return new DoubleRange(properties); + }; + + /** + * Encodes the specified DoubleRange message. Does not implicitly {@link google.cloud.automl.v1beta1.DoubleRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @static + * @param {google.cloud.automl.v1beta1.IDoubleRange} message DoubleRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.end); + return writer; + }; + + /** + * Encodes the specified DoubleRange message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DoubleRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @static + * @param {google.cloud.automl.v1beta1.IDoubleRange} message DoubleRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.DoubleRange} DoubleRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.DoubleRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.double(); + break; + } + case 2: { + message.end = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.DoubleRange} DoubleRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleRange message. + * @function verify + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (typeof message.start !== "number") + return "start: number expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (typeof message.end !== "number") + return "end: number expected"; + return null; + }; + + /** + * Creates a DoubleRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.DoubleRange} DoubleRange + */ + DoubleRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.DoubleRange) + return object; + var message = new $root.google.cloud.automl.v1beta1.DoubleRange(); + if (object.start != null) + message.start = Number(object.start); + if (object.end != null) + message.end = Number(object.end); + return message; + }; + + /** + * Creates a plain object from a DoubleRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @static + * @param {google.cloud.automl.v1beta1.DoubleRange} message DoubleRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleRange.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 = options.json && !isFinite(message.start) ? String(message.start) : message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = options.json && !isFinite(message.end) ? String(message.end) : message.end; + return object; + }; + + /** + * Converts this DoubleRange to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @instance + * @returns {Object.} JSON object + */ + DoubleRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleRange + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.DoubleRange"; + }; + + return DoubleRange; + })(); + + v1beta1.RegressionEvaluationMetrics = (function() { + + /** + * Properties of a RegressionEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @interface IRegressionEvaluationMetrics + * @property {number|null} [rootMeanSquaredError] RegressionEvaluationMetrics rootMeanSquaredError + * @property {number|null} [meanAbsoluteError] RegressionEvaluationMetrics meanAbsoluteError + * @property {number|null} [meanAbsolutePercentageError] RegressionEvaluationMetrics meanAbsolutePercentageError + * @property {number|null} [rSquared] RegressionEvaluationMetrics rSquared + * @property {number|null} [rootMeanSquaredLogError] RegressionEvaluationMetrics rootMeanSquaredLogError + */ + + /** + * Constructs a new RegressionEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a RegressionEvaluationMetrics. + * @implements IRegressionEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1beta1.IRegressionEvaluationMetrics=} [properties] Properties to set + */ + function RegressionEvaluationMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegressionEvaluationMetrics rootMeanSquaredError. + * @member {number} rootMeanSquaredError + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @instance + */ + RegressionEvaluationMetrics.prototype.rootMeanSquaredError = 0; + + /** + * RegressionEvaluationMetrics meanAbsoluteError. + * @member {number} meanAbsoluteError + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @instance + */ + RegressionEvaluationMetrics.prototype.meanAbsoluteError = 0; + + /** + * RegressionEvaluationMetrics meanAbsolutePercentageError. + * @member {number} meanAbsolutePercentageError + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @instance + */ + RegressionEvaluationMetrics.prototype.meanAbsolutePercentageError = 0; + + /** + * RegressionEvaluationMetrics rSquared. + * @member {number} rSquared + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @instance + */ + RegressionEvaluationMetrics.prototype.rSquared = 0; + + /** + * RegressionEvaluationMetrics rootMeanSquaredLogError. + * @member {number} rootMeanSquaredLogError + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @instance + */ + RegressionEvaluationMetrics.prototype.rootMeanSquaredLogError = 0; + + /** + * Creates a new RegressionEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IRegressionEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.RegressionEvaluationMetrics} RegressionEvaluationMetrics instance + */ + RegressionEvaluationMetrics.create = function create(properties) { + return new RegressionEvaluationMetrics(properties); + }; + + /** + * Encodes the specified RegressionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.RegressionEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IRegressionEvaluationMetrics} message RegressionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegressionEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rootMeanSquaredError != null && Object.hasOwnProperty.call(message, "rootMeanSquaredError")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.rootMeanSquaredError); + if (message.meanAbsoluteError != null && Object.hasOwnProperty.call(message, "meanAbsoluteError")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.meanAbsoluteError); + if (message.meanAbsolutePercentageError != null && Object.hasOwnProperty.call(message, "meanAbsolutePercentageError")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.meanAbsolutePercentageError); + if (message.rSquared != null && Object.hasOwnProperty.call(message, "rSquared")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.rSquared); + if (message.rootMeanSquaredLogError != null && Object.hasOwnProperty.call(message, "rootMeanSquaredLogError")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.rootMeanSquaredLogError); + return writer; + }; + + /** + * Encodes the specified RegressionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.RegressionEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IRegressionEvaluationMetrics} message RegressionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegressionEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegressionEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.RegressionEvaluationMetrics} RegressionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegressionEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.RegressionEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rootMeanSquaredError = reader.float(); + break; + } + case 2: { + message.meanAbsoluteError = reader.float(); + break; + } + case 3: { + message.meanAbsolutePercentageError = reader.float(); + break; + } + case 4: { + message.rSquared = reader.float(); + break; + } + case 5: { + message.rootMeanSquaredLogError = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegressionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.RegressionEvaluationMetrics} RegressionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegressionEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegressionEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegressionEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rootMeanSquaredError != null && message.hasOwnProperty("rootMeanSquaredError")) + if (typeof message.rootMeanSquaredError !== "number") + return "rootMeanSquaredError: number expected"; + if (message.meanAbsoluteError != null && message.hasOwnProperty("meanAbsoluteError")) + if (typeof message.meanAbsoluteError !== "number") + return "meanAbsoluteError: number expected"; + if (message.meanAbsolutePercentageError != null && message.hasOwnProperty("meanAbsolutePercentageError")) + if (typeof message.meanAbsolutePercentageError !== "number") + return "meanAbsolutePercentageError: number expected"; + if (message.rSquared != null && message.hasOwnProperty("rSquared")) + if (typeof message.rSquared !== "number") + return "rSquared: number expected"; + if (message.rootMeanSquaredLogError != null && message.hasOwnProperty("rootMeanSquaredLogError")) + if (typeof message.rootMeanSquaredLogError !== "number") + return "rootMeanSquaredLogError: number expected"; + return null; + }; + + /** + * Creates a RegressionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.RegressionEvaluationMetrics} RegressionEvaluationMetrics + */ + RegressionEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.RegressionEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1beta1.RegressionEvaluationMetrics(); + if (object.rootMeanSquaredError != null) + message.rootMeanSquaredError = Number(object.rootMeanSquaredError); + if (object.meanAbsoluteError != null) + message.meanAbsoluteError = Number(object.meanAbsoluteError); + if (object.meanAbsolutePercentageError != null) + message.meanAbsolutePercentageError = Number(object.meanAbsolutePercentageError); + if (object.rSquared != null) + message.rSquared = Number(object.rSquared); + if (object.rootMeanSquaredLogError != null) + message.rootMeanSquaredLogError = Number(object.rootMeanSquaredLogError); + return message; + }; + + /** + * Creates a plain object from a RegressionEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.RegressionEvaluationMetrics} message RegressionEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegressionEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rootMeanSquaredError = 0; + object.meanAbsoluteError = 0; + object.meanAbsolutePercentageError = 0; + object.rSquared = 0; + object.rootMeanSquaredLogError = 0; + } + if (message.rootMeanSquaredError != null && message.hasOwnProperty("rootMeanSquaredError")) + object.rootMeanSquaredError = options.json && !isFinite(message.rootMeanSquaredError) ? String(message.rootMeanSquaredError) : message.rootMeanSquaredError; + if (message.meanAbsoluteError != null && message.hasOwnProperty("meanAbsoluteError")) + object.meanAbsoluteError = options.json && !isFinite(message.meanAbsoluteError) ? String(message.meanAbsoluteError) : message.meanAbsoluteError; + if (message.meanAbsolutePercentageError != null && message.hasOwnProperty("meanAbsolutePercentageError")) + object.meanAbsolutePercentageError = options.json && !isFinite(message.meanAbsolutePercentageError) ? String(message.meanAbsolutePercentageError) : message.meanAbsolutePercentageError; + if (message.rSquared != null && message.hasOwnProperty("rSquared")) + object.rSquared = options.json && !isFinite(message.rSquared) ? String(message.rSquared) : message.rSquared; + if (message.rootMeanSquaredLogError != null && message.hasOwnProperty("rootMeanSquaredLogError")) + object.rootMeanSquaredLogError = options.json && !isFinite(message.rootMeanSquaredLogError) ? String(message.rootMeanSquaredLogError) : message.rootMeanSquaredLogError; + return object; + }; + + /** + * Converts this RegressionEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + RegressionEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RegressionEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RegressionEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.RegressionEvaluationMetrics"; + }; + + return RegressionEvaluationMetrics; + })(); + + v1beta1.TextExtractionAnnotation = (function() { + + /** + * Properties of a TextExtractionAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextExtractionAnnotation + * @property {google.cloud.automl.v1beta1.ITextSegment|null} [textSegment] TextExtractionAnnotation textSegment + * @property {number|null} [score] TextExtractionAnnotation score + */ + + /** + * Constructs a new TextExtractionAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextExtractionAnnotation. + * @implements ITextExtractionAnnotation + * @constructor + * @param {google.cloud.automl.v1beta1.ITextExtractionAnnotation=} [properties] Properties to set + */ + function TextExtractionAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextExtractionAnnotation textSegment. + * @member {google.cloud.automl.v1beta1.ITextSegment|null|undefined} textSegment + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @instance + */ + TextExtractionAnnotation.prototype.textSegment = null; + + /** + * TextExtractionAnnotation score. + * @member {number} score + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @instance + */ + TextExtractionAnnotation.prototype.score = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TextExtractionAnnotation annotation. + * @member {"textSegment"|undefined} annotation + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @instance + */ + Object.defineProperty(TextExtractionAnnotation.prototype, "annotation", { + get: $util.oneOfGetter($oneOfFields = ["textSegment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TextExtractionAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextExtractionAnnotation} TextExtractionAnnotation instance + */ + TextExtractionAnnotation.create = function create(properties) { + return new TextExtractionAnnotation(properties); + }; + + /** + * Encodes the specified TextExtractionAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionAnnotation} message TextExtractionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionAnnotation.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.textSegment != null && Object.hasOwnProperty.call(message, "textSegment")) + $root.google.cloud.automl.v1beta1.TextSegment.encode(message.textSegment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextExtractionAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionAnnotation} message TextExtractionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextExtractionAnnotation} TextExtractionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextExtractionAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.textSegment = $root.google.cloud.automl.v1beta1.TextSegment.decode(reader, reader.uint32()); + break; + } + case 1: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextExtractionAnnotation} TextExtractionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.textSegment != null && message.hasOwnProperty("textSegment")) { + properties.annotation = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextSegment.verify(message.textSegment); + if (error) + return "textSegment." + error; + } + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a TextExtractionAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextExtractionAnnotation} TextExtractionAnnotation + */ + TextExtractionAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextExtractionAnnotation) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextExtractionAnnotation(); + if (object.textSegment != null) { + if (typeof object.textSegment !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TextExtractionAnnotation.textSegment: object expected"); + message.textSegment = $root.google.cloud.automl.v1beta1.TextSegment.fromObject(object.textSegment); + } + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a TextExtractionAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @static + * @param {google.cloud.automl.v1beta1.TextExtractionAnnotation} message TextExtractionAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.score = 0; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.textSegment != null && message.hasOwnProperty("textSegment")) { + object.textSegment = $root.google.cloud.automl.v1beta1.TextSegment.toObject(message.textSegment, options); + if (options.oneofs) + object.annotation = "textSegment"; + } + return object; + }; + + /** + * Converts this TextExtractionAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @instance + * @returns {Object.} JSON object + */ + TextExtractionAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextExtractionAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextExtractionAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextExtractionAnnotation"; + }; + + return TextExtractionAnnotation; + })(); + + v1beta1.TextExtractionEvaluationMetrics = (function() { + + /** + * Properties of a TextExtractionEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextExtractionEvaluationMetrics + * @property {number|null} [auPrc] TextExtractionEvaluationMetrics auPrc + * @property {Array.|null} [confidenceMetricsEntries] TextExtractionEvaluationMetrics confidenceMetricsEntries + */ + + /** + * Constructs a new TextExtractionEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextExtractionEvaluationMetrics. + * @implements ITextExtractionEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics=} [properties] Properties to set + */ + function TextExtractionEvaluationMetrics(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]]; + } + + /** + * TextExtractionEvaluationMetrics auPrc. + * @member {number} auPrc + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @instance + */ + TextExtractionEvaluationMetrics.prototype.auPrc = 0; + + /** + * TextExtractionEvaluationMetrics confidenceMetricsEntries. + * @member {Array.} confidenceMetricsEntries + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @instance + */ + TextExtractionEvaluationMetrics.prototype.confidenceMetricsEntries = $util.emptyArray; + + /** + * Creates a new TextExtractionEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics} TextExtractionEvaluationMetrics instance + */ + TextExtractionEvaluationMetrics.create = function create(properties) { + return new TextExtractionEvaluationMetrics(properties); + }; + + /** + * Encodes the specified TextExtractionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics} message TextExtractionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.auPrc != null && Object.hasOwnProperty.call(message, "auPrc")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.auPrc); + if (message.confidenceMetricsEntries != null && message.confidenceMetricsEntries.length) + for (var i = 0; i < message.confidenceMetricsEntries.length; ++i) + $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.encode(message.confidenceMetricsEntries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextExtractionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics} message TextExtractionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics} TextExtractionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.auPrc = reader.float(); + break; + } + case 2: { + if (!(message.confidenceMetricsEntries && message.confidenceMetricsEntries.length)) + message.confidenceMetricsEntries = []; + message.confidenceMetricsEntries.push($root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics} TextExtractionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + if (typeof message.auPrc !== "number") + return "auPrc: 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.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify(message.confidenceMetricsEntries[i]); + if (error) + return "confidenceMetricsEntries." + error; + } + } + return null; + }; + + /** + * Creates a TextExtractionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics} TextExtractionEvaluationMetrics + */ + TextExtractionEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics(); + if (object.auPrc != null) + message.auPrc = Number(object.auPrc); + if (object.confidenceMetricsEntries) { + if (!Array.isArray(object.confidenceMetricsEntries)) + throw TypeError(".google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.confidenceMetricsEntries: array expected"); + message.confidenceMetricsEntries = []; + for (var i = 0; i < object.confidenceMetricsEntries.length; ++i) { + if (typeof object.confidenceMetricsEntries[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.confidenceMetricsEntries: object expected"); + message.confidenceMetricsEntries[i] = $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.fromObject(object.confidenceMetricsEntries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TextExtractionEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics} message TextExtractionEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.confidenceMetricsEntries = []; + if (options.defaults) + object.auPrc = 0; + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + object.auPrc = options.json && !isFinite(message.auPrc) ? String(message.auPrc) : message.auPrc; + if (message.confidenceMetricsEntries && message.confidenceMetricsEntries.length) { + object.confidenceMetricsEntries = []; + for (var j = 0; j < message.confidenceMetricsEntries.length; ++j) + object.confidenceMetricsEntries[j] = $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.toObject(message.confidenceMetricsEntries[j], options); + } + return object; + }; + + /** + * Converts this TextExtractionEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + TextExtractionEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextExtractionEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextExtractionEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics"; + }; + + TextExtractionEvaluationMetrics.ConfidenceMetricsEntry = (function() { + + /** + * Properties of a ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @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 + */ + + /** + * Constructs a new ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @classdesc Represents a ConfidenceMetricsEntry. + * @implements IConfidenceMetricsEntry + * @constructor + * @param {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.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.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.confidenceThreshold = 0; + + /** + * ConfidenceMetricsEntry recall. + * @member {number} recall + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recall = 0; + + /** + * ConfidenceMetricsEntry precision. + * @member {number} precision + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precision = 0; + + /** + * ConfidenceMetricsEntry f1Score. + * @member {number} f1Score + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1Score = 0; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry instance + */ + ConfidenceMetricsEntry.create = function create(properties) { + return new ConfidenceMetricsEntry(properties); + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.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 3, wireType 5 =*/29).float(message.recall); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.precision); + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.f1Score); + return writer; + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.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.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.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.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.confidenceThreshold = reader.float(); + break; + } + case 3: { + message.recall = reader.float(); + break; + } + case 4: { + message.precision = reader.float(); + break; + } + case 5: { + message.f1Score = 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.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.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.automl.v1beta1.TextExtractionEvaluationMetrics.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"; + return null; + }; + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + */ + ConfidenceMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.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); + return message; + }; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.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; + } + 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; + return object; + }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.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.automl.v1beta1.TextExtractionEvaluationMetrics.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.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry"; + }; + + return ConfidenceMetricsEntry; + })(); + + return TextExtractionEvaluationMetrics; + })(); + + v1beta1.TextSentimentAnnotation = (function() { + + /** + * Properties of a TextSentimentAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextSentimentAnnotation + * @property {number|null} [sentiment] TextSentimentAnnotation sentiment + */ + + /** + * Constructs a new TextSentimentAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextSentimentAnnotation. + * @implements ITextSentimentAnnotation + * @constructor + * @param {google.cloud.automl.v1beta1.ITextSentimentAnnotation=} [properties] Properties to set + */ + function TextSentimentAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSentimentAnnotation sentiment. + * @member {number} sentiment + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @instance + */ + TextSentimentAnnotation.prototype.sentiment = 0; + + /** + * Creates a new TextSentimentAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextSentimentAnnotation} TextSentimentAnnotation instance + */ + TextSentimentAnnotation.create = function create(properties) { + return new TextSentimentAnnotation(properties); + }; + + /** + * Encodes the specified TextSentimentAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentAnnotation} message TextSentimentAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sentiment != null && Object.hasOwnProperty.call(message, "sentiment")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sentiment); + return writer; + }; + + /** + * Encodes the specified TextSentimentAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentAnnotation} message TextSentimentAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextSentimentAnnotation} TextSentimentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextSentimentAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sentiment = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextSentimentAnnotation} TextSentimentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sentiment != null && message.hasOwnProperty("sentiment")) + if (!$util.isInteger(message.sentiment)) + return "sentiment: integer expected"; + return null; + }; + + /** + * Creates a TextSentimentAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextSentimentAnnotation} TextSentimentAnnotation + */ + TextSentimentAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextSentimentAnnotation) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextSentimentAnnotation(); + if (object.sentiment != null) + message.sentiment = object.sentiment | 0; + return message; + }; + + /** + * Creates a plain object from a TextSentimentAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @static + * @param {google.cloud.automl.v1beta1.TextSentimentAnnotation} message TextSentimentAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sentiment = 0; + if (message.sentiment != null && message.hasOwnProperty("sentiment")) + object.sentiment = message.sentiment; + return object; + }; + + /** + * Converts this TextSentimentAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @instance + * @returns {Object.} JSON object + */ + TextSentimentAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSentimentAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSentimentAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextSentimentAnnotation"; + }; + + return TextSentimentAnnotation; + })(); + + v1beta1.TextSentimentEvaluationMetrics = (function() { + + /** + * Properties of a TextSentimentEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextSentimentEvaluationMetrics + * @property {number|null} [precision] TextSentimentEvaluationMetrics precision + * @property {number|null} [recall] TextSentimentEvaluationMetrics recall + * @property {number|null} [f1Score] TextSentimentEvaluationMetrics f1Score + * @property {number|null} [meanAbsoluteError] TextSentimentEvaluationMetrics meanAbsoluteError + * @property {number|null} [meanSquaredError] TextSentimentEvaluationMetrics meanSquaredError + * @property {number|null} [linearKappa] TextSentimentEvaluationMetrics linearKappa + * @property {number|null} [quadraticKappa] TextSentimentEvaluationMetrics quadraticKappa + * @property {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix|null} [confusionMatrix] TextSentimentEvaluationMetrics confusionMatrix + * @property {Array.|null} [annotationSpecId] TextSentimentEvaluationMetrics annotationSpecId + */ + + /** + * Constructs a new TextSentimentEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextSentimentEvaluationMetrics. + * @implements ITextSentimentEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics=} [properties] Properties to set + */ + function TextSentimentEvaluationMetrics(properties) { + this.annotationSpecId = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSentimentEvaluationMetrics precision. + * @member {number} precision + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.precision = 0; + + /** + * TextSentimentEvaluationMetrics recall. + * @member {number} recall + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.recall = 0; + + /** + * TextSentimentEvaluationMetrics f1Score. + * @member {number} f1Score + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.f1Score = 0; + + /** + * TextSentimentEvaluationMetrics meanAbsoluteError. + * @member {number} meanAbsoluteError + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.meanAbsoluteError = 0; + + /** + * TextSentimentEvaluationMetrics meanSquaredError. + * @member {number} meanSquaredError + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.meanSquaredError = 0; + + /** + * TextSentimentEvaluationMetrics linearKappa. + * @member {number} linearKappa + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.linearKappa = 0; + + /** + * TextSentimentEvaluationMetrics quadraticKappa. + * @member {number} quadraticKappa + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.quadraticKappa = 0; + + /** + * TextSentimentEvaluationMetrics confusionMatrix. + * @member {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix|null|undefined} confusionMatrix + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.confusionMatrix = null; + + /** + * TextSentimentEvaluationMetrics annotationSpecId. + * @member {Array.} annotationSpecId + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.annotationSpecId = $util.emptyArray; + + /** + * Creates a new TextSentimentEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics} TextSentimentEvaluationMetrics instance + */ + TextSentimentEvaluationMetrics.create = function create(properties) { + return new TextSentimentEvaluationMetrics(properties); + }; + + /** + * Encodes the specified TextSentimentEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics} message TextSentimentEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.precision); + if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.recall); + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.f1Score); + if (message.meanAbsoluteError != null && Object.hasOwnProperty.call(message, "meanAbsoluteError")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.meanAbsoluteError); + if (message.meanSquaredError != null && Object.hasOwnProperty.call(message, "meanSquaredError")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.meanSquaredError); + if (message.linearKappa != null && Object.hasOwnProperty.call(message, "linearKappa")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.linearKappa); + if (message.quadraticKappa != null && Object.hasOwnProperty.call(message, "quadraticKappa")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.quadraticKappa); + if (message.confusionMatrix != null && Object.hasOwnProperty.call(message, "confusionMatrix")) + $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.encode(message.confusionMatrix, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.annotationSpecId != null && message.annotationSpecId.length) + for (var i = 0; i < message.annotationSpecId.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.annotationSpecId[i]); + return writer; + }; + + /** + * Encodes the specified TextSentimentEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics} message TextSentimentEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics} TextSentimentEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.precision = reader.float(); + break; + } + case 2: { + message.recall = reader.float(); + break; + } + case 3: { + message.f1Score = reader.float(); + break; + } + case 4: { + message.meanAbsoluteError = reader.float(); + break; + } + case 5: { + message.meanSquaredError = reader.float(); + break; + } + case 6: { + message.linearKappa = reader.float(); + break; + } + case 7: { + message.quadraticKappa = reader.float(); + break; + } + case 8: { + message.confusionMatrix = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.annotationSpecId && message.annotationSpecId.length)) + message.annotationSpecId = []; + message.annotationSpecId.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics} TextSentimentEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.precision != null && message.hasOwnProperty("precision")) + if (typeof message.precision !== "number") + return "precision: number expected"; + if (message.recall != null && message.hasOwnProperty("recall")) + if (typeof message.recall !== "number") + return "recall: number expected"; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + if (typeof message.f1Score !== "number") + return "f1Score: number expected"; + if (message.meanAbsoluteError != null && message.hasOwnProperty("meanAbsoluteError")) + if (typeof message.meanAbsoluteError !== "number") + return "meanAbsoluteError: number expected"; + if (message.meanSquaredError != null && message.hasOwnProperty("meanSquaredError")) + if (typeof message.meanSquaredError !== "number") + return "meanSquaredError: number expected"; + if (message.linearKappa != null && message.hasOwnProperty("linearKappa")) + if (typeof message.linearKappa !== "number") + return "linearKappa: number expected"; + if (message.quadraticKappa != null && message.hasOwnProperty("quadraticKappa")) + if (typeof message.quadraticKappa !== "number") + return "quadraticKappa: number expected"; + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) { + var error = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.verify(message.confusionMatrix); + if (error) + return "confusionMatrix." + error; + } + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) { + if (!Array.isArray(message.annotationSpecId)) + return "annotationSpecId: array expected"; + for (var i = 0; i < message.annotationSpecId.length; ++i) + if (!$util.isString(message.annotationSpecId[i])) + return "annotationSpecId: string[] expected"; + } + return null; + }; + + /** + * Creates a TextSentimentEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics} TextSentimentEvaluationMetrics + */ + TextSentimentEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics(); + if (object.precision != null) + message.precision = Number(object.precision); + if (object.recall != null) + message.recall = Number(object.recall); + if (object.f1Score != null) + message.f1Score = Number(object.f1Score); + if (object.meanAbsoluteError != null) + message.meanAbsoluteError = Number(object.meanAbsoluteError); + if (object.meanSquaredError != null) + message.meanSquaredError = Number(object.meanSquaredError); + if (object.linearKappa != null) + message.linearKappa = Number(object.linearKappa); + if (object.quadraticKappa != null) + message.quadraticKappa = Number(object.quadraticKappa); + if (object.confusionMatrix != null) { + if (typeof object.confusionMatrix !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.confusionMatrix: object expected"); + message.confusionMatrix = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.fromObject(object.confusionMatrix); + } + if (object.annotationSpecId) { + if (!Array.isArray(object.annotationSpecId)) + throw TypeError(".google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.annotationSpecId: array expected"); + message.annotationSpecId = []; + for (var i = 0; i < object.annotationSpecId.length; ++i) + message.annotationSpecId[i] = String(object.annotationSpecId[i]); + } + return message; + }; + + /** + * Creates a plain object from a TextSentimentEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics} message TextSentimentEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotationSpecId = []; + if (options.defaults) { + object.precision = 0; + object.recall = 0; + object.f1Score = 0; + object.meanAbsoluteError = 0; + object.meanSquaredError = 0; + object.linearKappa = 0; + object.quadraticKappa = 0; + object.confusionMatrix = null; + } + if (message.precision != null && message.hasOwnProperty("precision")) + object.precision = options.json && !isFinite(message.precision) ? String(message.precision) : message.precision; + if (message.recall != null && message.hasOwnProperty("recall")) + object.recall = options.json && !isFinite(message.recall) ? String(message.recall) : message.recall; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + object.f1Score = options.json && !isFinite(message.f1Score) ? String(message.f1Score) : message.f1Score; + if (message.meanAbsoluteError != null && message.hasOwnProperty("meanAbsoluteError")) + object.meanAbsoluteError = options.json && !isFinite(message.meanAbsoluteError) ? String(message.meanAbsoluteError) : message.meanAbsoluteError; + if (message.meanSquaredError != null && message.hasOwnProperty("meanSquaredError")) + object.meanSquaredError = options.json && !isFinite(message.meanSquaredError) ? String(message.meanSquaredError) : message.meanSquaredError; + if (message.linearKappa != null && message.hasOwnProperty("linearKappa")) + object.linearKappa = options.json && !isFinite(message.linearKappa) ? String(message.linearKappa) : message.linearKappa; + if (message.quadraticKappa != null && message.hasOwnProperty("quadraticKappa")) + object.quadraticKappa = options.json && !isFinite(message.quadraticKappa) ? String(message.quadraticKappa) : message.quadraticKappa; + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) + object.confusionMatrix = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.toObject(message.confusionMatrix, options); + if (message.annotationSpecId && message.annotationSpecId.length) { + object.annotationSpecId = []; + for (var j = 0; j < message.annotationSpecId.length; ++j) + object.annotationSpecId[j] = message.annotationSpecId[j]; + } + return object; + }; + + /** + * Converts this TextSentimentEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + TextSentimentEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSentimentEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSentimentEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics"; + }; + + return TextSentimentEvaluationMetrics; + })(); + + v1beta1.TranslationDatasetMetadata = (function() { + + /** + * Properties of a TranslationDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ITranslationDatasetMetadata + * @property {string|null} [sourceLanguageCode] TranslationDatasetMetadata sourceLanguageCode + * @property {string|null} [targetLanguageCode] TranslationDatasetMetadata targetLanguageCode + */ + + /** + * Constructs a new TranslationDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TranslationDatasetMetadata. + * @implements ITranslationDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ITranslationDatasetMetadata=} [properties] Properties to set + */ + function TranslationDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationDatasetMetadata sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @instance + */ + TranslationDatasetMetadata.prototype.sourceLanguageCode = ""; + + /** + * TranslationDatasetMetadata targetLanguageCode. + * @member {string} targetLanguageCode + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @instance + */ + TranslationDatasetMetadata.prototype.targetLanguageCode = ""; + + /** + * Creates a new TranslationDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITranslationDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TranslationDatasetMetadata} TranslationDatasetMetadata instance + */ + TranslationDatasetMetadata.create = function create(properties) { + return new TranslationDatasetMetadata(properties); + }; + + /** + * Encodes the specified TranslationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITranslationDatasetMetadata} message TranslationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceLanguageCode); + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetLanguageCode); + return writer; + }; + + /** + * Encodes the specified TranslationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITranslationDatasetMetadata} message TranslationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TranslationDatasetMetadata} TranslationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TranslationDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sourceLanguageCode = reader.string(); + break; + } + case 2: { + message.targetLanguageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TranslationDatasetMetadata} TranslationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (!$util.isString(message.targetLanguageCode)) + return "targetLanguageCode: string expected"; + return null; + }; + + /** + * Creates a TranslationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TranslationDatasetMetadata} TranslationDatasetMetadata + */ + TranslationDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TranslationDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.TranslationDatasetMetadata(); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCode != null) + message.targetLanguageCode = String(object.targetLanguageCode); + return message; + }; + + /** + * Creates a plain object from a TranslationDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.TranslationDatasetMetadata} message TranslationDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceLanguageCode = ""; + object.targetLanguageCode = ""; + } + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + object.targetLanguageCode = message.targetLanguageCode; + return object; + }; + + /** + * Converts this TranslationDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TranslationDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranslationDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslationDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TranslationDatasetMetadata"; + }; + + return TranslationDatasetMetadata; + })(); + + v1beta1.TranslationEvaluationMetrics = (function() { + + /** + * Properties of a TranslationEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @interface ITranslationEvaluationMetrics + * @property {number|null} [bleuScore] TranslationEvaluationMetrics bleuScore + * @property {number|null} [baseBleuScore] TranslationEvaluationMetrics baseBleuScore + */ + + /** + * Constructs a new TranslationEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TranslationEvaluationMetrics. + * @implements ITranslationEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1beta1.ITranslationEvaluationMetrics=} [properties] Properties to set + */ + function TranslationEvaluationMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationEvaluationMetrics bleuScore. + * @member {number} bleuScore + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @instance + */ + TranslationEvaluationMetrics.prototype.bleuScore = 0; + + /** + * TranslationEvaluationMetrics baseBleuScore. + * @member {number} baseBleuScore + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @instance + */ + TranslationEvaluationMetrics.prototype.baseBleuScore = 0; + + /** + * Creates a new TranslationEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ITranslationEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TranslationEvaluationMetrics} TranslationEvaluationMetrics instance + */ + TranslationEvaluationMetrics.create = function create(properties) { + return new TranslationEvaluationMetrics(properties); + }; + + /** + * Encodes the specified TranslationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ITranslationEvaluationMetrics} message TranslationEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bleuScore != null && Object.hasOwnProperty.call(message, "bleuScore")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.bleuScore); + if (message.baseBleuScore != null && Object.hasOwnProperty.call(message, "baseBleuScore")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.baseBleuScore); + return writer; + }; + + /** + * Encodes the specified TranslationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ITranslationEvaluationMetrics} message TranslationEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TranslationEvaluationMetrics} TranslationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TranslationEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.bleuScore = reader.double(); + break; + } + case 2: { + message.baseBleuScore = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TranslationEvaluationMetrics} TranslationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bleuScore != null && message.hasOwnProperty("bleuScore")) + if (typeof message.bleuScore !== "number") + return "bleuScore: number expected"; + if (message.baseBleuScore != null && message.hasOwnProperty("baseBleuScore")) + if (typeof message.baseBleuScore !== "number") + return "baseBleuScore: number expected"; + return null; + }; + + /** + * Creates a TranslationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TranslationEvaluationMetrics} TranslationEvaluationMetrics + */ + TranslationEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TranslationEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1beta1.TranslationEvaluationMetrics(); + if (object.bleuScore != null) + message.bleuScore = Number(object.bleuScore); + if (object.baseBleuScore != null) + message.baseBleuScore = Number(object.baseBleuScore); + return message; + }; + + /** + * Creates a plain object from a TranslationEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.TranslationEvaluationMetrics} message TranslationEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bleuScore = 0; + object.baseBleuScore = 0; + } + if (message.bleuScore != null && message.hasOwnProperty("bleuScore")) + object.bleuScore = options.json && !isFinite(message.bleuScore) ? String(message.bleuScore) : message.bleuScore; + if (message.baseBleuScore != null && message.hasOwnProperty("baseBleuScore")) + object.baseBleuScore = options.json && !isFinite(message.baseBleuScore) ? String(message.baseBleuScore) : message.baseBleuScore; + return object; + }; + + /** + * Converts this TranslationEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + TranslationEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranslationEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslationEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TranslationEvaluationMetrics"; + }; + + return TranslationEvaluationMetrics; + })(); + + v1beta1.TranslationModelMetadata = (function() { + + /** + * Properties of a TranslationModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ITranslationModelMetadata + * @property {string|null} [baseModel] TranslationModelMetadata baseModel + * @property {string|null} [sourceLanguageCode] TranslationModelMetadata sourceLanguageCode + * @property {string|null} [targetLanguageCode] TranslationModelMetadata targetLanguageCode + */ + + /** + * Constructs a new TranslationModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TranslationModelMetadata. + * @implements ITranslationModelMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ITranslationModelMetadata=} [properties] Properties to set + */ + function TranslationModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationModelMetadata baseModel. + * @member {string} baseModel + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @instance + */ + TranslationModelMetadata.prototype.baseModel = ""; + + /** + * TranslationModelMetadata sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @instance + */ + TranslationModelMetadata.prototype.sourceLanguageCode = ""; + + /** + * TranslationModelMetadata targetLanguageCode. + * @member {string} targetLanguageCode + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @instance + */ + TranslationModelMetadata.prototype.targetLanguageCode = ""; + + /** + * Creates a new TranslationModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITranslationModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TranslationModelMetadata} TranslationModelMetadata instance + */ + TranslationModelMetadata.create = function create(properties) { + return new TranslationModelMetadata(properties); + }; + + /** + * Encodes the specified TranslationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITranslationModelMetadata} message TranslationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseModel != null && Object.hasOwnProperty.call(message, "baseModel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseModel); + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCode); + return writer; + }; + + /** + * Encodes the specified TranslationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITranslationModelMetadata} message TranslationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TranslationModelMetadata} TranslationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TranslationModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.baseModel = reader.string(); + break; + } + case 2: { + message.sourceLanguageCode = reader.string(); + break; + } + case 3: { + message.targetLanguageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TranslationModelMetadata} TranslationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseModel != null && message.hasOwnProperty("baseModel")) + if (!$util.isString(message.baseModel)) + return "baseModel: string expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (!$util.isString(message.targetLanguageCode)) + return "targetLanguageCode: string expected"; + return null; + }; + + /** + * Creates a TranslationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TranslationModelMetadata} TranslationModelMetadata + */ + TranslationModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TranslationModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.TranslationModelMetadata(); + if (object.baseModel != null) + message.baseModel = String(object.baseModel); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCode != null) + message.targetLanguageCode = String(object.targetLanguageCode); + return message; + }; + + /** + * Creates a plain object from a TranslationModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.TranslationModelMetadata} message TranslationModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.baseModel = ""; + object.sourceLanguageCode = ""; + object.targetLanguageCode = ""; + } + if (message.baseModel != null && message.hasOwnProperty("baseModel")) + object.baseModel = message.baseModel; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + object.targetLanguageCode = message.targetLanguageCode; + return object; + }; + + /** + * Converts this TranslationModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TranslationModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranslationModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslationModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TranslationModelMetadata"; + }; + + return TranslationModelMetadata; + })(); + + v1beta1.TranslationAnnotation = (function() { + + /** + * Properties of a TranslationAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @interface ITranslationAnnotation + * @property {google.cloud.automl.v1beta1.ITextSnippet|null} [translatedContent] TranslationAnnotation translatedContent + */ + + /** + * Constructs a new TranslationAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TranslationAnnotation. + * @implements ITranslationAnnotation + * @constructor + * @param {google.cloud.automl.v1beta1.ITranslationAnnotation=} [properties] Properties to set + */ + function TranslationAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationAnnotation translatedContent. + * @member {google.cloud.automl.v1beta1.ITextSnippet|null|undefined} translatedContent + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @instance + */ + TranslationAnnotation.prototype.translatedContent = null; + + /** + * Creates a new TranslationAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITranslationAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TranslationAnnotation} TranslationAnnotation instance + */ + TranslationAnnotation.create = function create(properties) { + return new TranslationAnnotation(properties); + }; + + /** + * Encodes the specified TranslationAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITranslationAnnotation} message TranslationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.translatedContent != null && Object.hasOwnProperty.call(message, "translatedContent")) + $root.google.cloud.automl.v1beta1.TextSnippet.encode(message.translatedContent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TranslationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITranslationAnnotation} message TranslationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TranslationAnnotation} TranslationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TranslationAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.translatedContent = $root.google.cloud.automl.v1beta1.TextSnippet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TranslationAnnotation} TranslationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.translatedContent != null && message.hasOwnProperty("translatedContent")) { + var error = $root.google.cloud.automl.v1beta1.TextSnippet.verify(message.translatedContent); + if (error) + return "translatedContent." + error; + } + return null; + }; + + /** + * Creates a TranslationAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TranslationAnnotation} TranslationAnnotation + */ + TranslationAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TranslationAnnotation) + return object; + var message = new $root.google.cloud.automl.v1beta1.TranslationAnnotation(); + if (object.translatedContent != null) { + if (typeof object.translatedContent !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TranslationAnnotation.translatedContent: object expected"); + message.translatedContent = $root.google.cloud.automl.v1beta1.TextSnippet.fromObject(object.translatedContent); + } + return message; + }; + + /** + * Creates a plain object from a TranslationAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.TranslationAnnotation} message TranslationAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.translatedContent = null; + if (message.translatedContent != null && message.hasOwnProperty("translatedContent")) + object.translatedContent = $root.google.cloud.automl.v1beta1.TextSnippet.toObject(message.translatedContent, options); + return object; + }; + + /** + * Converts this TranslationAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @instance + * @returns {Object.} JSON object + */ + TranslationAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranslationAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslationAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TranslationAnnotation"; + }; + + return TranslationAnnotation; + })(); + + v1beta1.AnnotationSpec = (function() { + + /** + * Properties of an AnnotationSpec. + * @memberof google.cloud.automl.v1beta1 + * @interface IAnnotationSpec + * @property {string|null} [name] AnnotationSpec name + * @property {string|null} [displayName] AnnotationSpec displayName + * @property {number|null} [exampleCount] AnnotationSpec exampleCount + */ + + /** + * Constructs a new AnnotationSpec. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an AnnotationSpec. + * @implements IAnnotationSpec + * @constructor + * @param {google.cloud.automl.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 name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @instance + */ + AnnotationSpec.prototype.name = ""; + + /** + * AnnotationSpec displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @instance + */ + AnnotationSpec.prototype.displayName = ""; + + /** + * AnnotationSpec exampleCount. + * @member {number} exampleCount + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @instance + */ + AnnotationSpec.prototype.exampleCount = 0; + + /** + * Creates a new AnnotationSpec instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @static + * @param {google.cloud.automl.v1beta1.IAnnotationSpec=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.AnnotationSpec} AnnotationSpec instance + */ + AnnotationSpec.create = function create(properties) { + return new AnnotationSpec(properties); + }; + + /** + * Encodes the specified AnnotationSpec message. Does not implicitly {@link google.cloud.automl.v1beta1.AnnotationSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @static + * @param {google.cloud.automl.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.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.exampleCount != null && Object.hasOwnProperty.call(message, "exampleCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.exampleCount); + return writer; + }; + + /** + * Encodes the specified AnnotationSpec message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.AnnotationSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.AnnotationSpec(); + 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.exampleCount = reader.int32(); + 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.automl.v1beta1.AnnotationSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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.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.exampleCount != null && message.hasOwnProperty("exampleCount")) + if (!$util.isInteger(message.exampleCount)) + return "exampleCount: integer expected"; + return null; + }; + + /** + * Creates an AnnotationSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.AnnotationSpec} AnnotationSpec + */ + AnnotationSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.AnnotationSpec) + return object; + var message = new $root.google.cloud.automl.v1beta1.AnnotationSpec(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.exampleCount != null) + message.exampleCount = object.exampleCount | 0; + return message; + }; + + /** + * Creates a plain object from an AnnotationSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @static + * @param {google.cloud.automl.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.name = ""; + object.displayName = ""; + object.exampleCount = 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.exampleCount != null && message.hasOwnProperty("exampleCount")) + object.exampleCount = message.exampleCount; + return object; + }; + + /** + * Converts this AnnotationSpec to JSON. + * @function toJSON + * @memberof google.cloud.automl.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.automl.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.automl.v1beta1.AnnotationSpec"; + }; + + return AnnotationSpec; + })(); + + v1beta1.Dataset = (function() { + + /** + * Properties of a Dataset. + * @memberof google.cloud.automl.v1beta1 + * @interface IDataset + * @property {google.cloud.automl.v1beta1.ITranslationDatasetMetadata|null} [translationDatasetMetadata] Dataset translationDatasetMetadata + * @property {google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata|null} [imageClassificationDatasetMetadata] Dataset imageClassificationDatasetMetadata + * @property {google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata|null} [textClassificationDatasetMetadata] Dataset textClassificationDatasetMetadata + * @property {google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata|null} [imageObjectDetectionDatasetMetadata] Dataset imageObjectDetectionDatasetMetadata + * @property {google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata|null} [videoClassificationDatasetMetadata] Dataset videoClassificationDatasetMetadata + * @property {google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata|null} [videoObjectTrackingDatasetMetadata] Dataset videoObjectTrackingDatasetMetadata + * @property {google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata|null} [textExtractionDatasetMetadata] Dataset textExtractionDatasetMetadata + * @property {google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata|null} [textSentimentDatasetMetadata] Dataset textSentimentDatasetMetadata + * @property {google.cloud.automl.v1beta1.ITablesDatasetMetadata|null} [tablesDatasetMetadata] Dataset tablesDatasetMetadata + * @property {string|null} [name] Dataset name + * @property {string|null} [displayName] Dataset displayName + * @property {string|null} [description] Dataset description + * @property {number|null} [exampleCount] Dataset exampleCount + * @property {google.protobuf.ITimestamp|null} [createTime] Dataset createTime + * @property {string|null} [etag] Dataset etag + */ + + /** + * Constructs a new Dataset. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a Dataset. + * @implements IDataset + * @constructor + * @param {google.cloud.automl.v1beta1.IDataset=} [properties] Properties to set + */ + function Dataset(properties) { + if (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 translationDatasetMetadata. + * @member {google.cloud.automl.v1beta1.ITranslationDatasetMetadata|null|undefined} translationDatasetMetadata + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.translationDatasetMetadata = null; + + /** + * Dataset imageClassificationDatasetMetadata. + * @member {google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata|null|undefined} imageClassificationDatasetMetadata + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.imageClassificationDatasetMetadata = null; + + /** + * Dataset textClassificationDatasetMetadata. + * @member {google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata|null|undefined} textClassificationDatasetMetadata + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.textClassificationDatasetMetadata = null; + + /** + * Dataset imageObjectDetectionDatasetMetadata. + * @member {google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata|null|undefined} imageObjectDetectionDatasetMetadata + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.imageObjectDetectionDatasetMetadata = null; + + /** + * Dataset videoClassificationDatasetMetadata. + * @member {google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata|null|undefined} videoClassificationDatasetMetadata + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.videoClassificationDatasetMetadata = null; + + /** + * Dataset videoObjectTrackingDatasetMetadata. + * @member {google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata|null|undefined} videoObjectTrackingDatasetMetadata + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.videoObjectTrackingDatasetMetadata = null; + + /** + * Dataset textExtractionDatasetMetadata. + * @member {google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata|null|undefined} textExtractionDatasetMetadata + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.textExtractionDatasetMetadata = null; + + /** + * Dataset textSentimentDatasetMetadata. + * @member {google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata|null|undefined} textSentimentDatasetMetadata + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.textSentimentDatasetMetadata = null; + + /** + * Dataset tablesDatasetMetadata. + * @member {google.cloud.automl.v1beta1.ITablesDatasetMetadata|null|undefined} tablesDatasetMetadata + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.tablesDatasetMetadata = null; + + /** + * Dataset name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.name = ""; + + /** + * Dataset displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.displayName = ""; + + /** + * Dataset description. + * @member {string} description + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.description = ""; + + /** + * Dataset exampleCount. + * @member {number} exampleCount + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.exampleCount = 0; + + /** + * Dataset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.createTime = null; + + /** + * Dataset etag. + * @member {string} etag + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Dataset datasetMetadata. + * @member {"translationDatasetMetadata"|"imageClassificationDatasetMetadata"|"textClassificationDatasetMetadata"|"imageObjectDetectionDatasetMetadata"|"videoClassificationDatasetMetadata"|"videoObjectTrackingDatasetMetadata"|"textExtractionDatasetMetadata"|"textSentimentDatasetMetadata"|"tablesDatasetMetadata"|undefined} datasetMetadata + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Object.defineProperty(Dataset.prototype, "datasetMetadata", { + get: $util.oneOfGetter($oneOfFields = ["translationDatasetMetadata", "imageClassificationDatasetMetadata", "textClassificationDatasetMetadata", "imageObjectDetectionDatasetMetadata", "videoClassificationDatasetMetadata", "videoObjectTrackingDatasetMetadata", "textExtractionDatasetMetadata", "textSentimentDatasetMetadata", "tablesDatasetMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Dataset instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.Dataset + * @static + * @param {google.cloud.automl.v1beta1.IDataset=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.Dataset} Dataset instance + */ + Dataset.create = function create(properties) { + return new Dataset(properties); + }; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.automl.v1beta1.Dataset.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.Dataset + * @static + * @param {google.cloud.automl.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 14, wireType 2 =*/114).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.etag); + if (message.exampleCount != null && Object.hasOwnProperty.call(message, "exampleCount")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.exampleCount); + if (message.translationDatasetMetadata != null && Object.hasOwnProperty.call(message, "translationDatasetMetadata")) + $root.google.cloud.automl.v1beta1.TranslationDatasetMetadata.encode(message.translationDatasetMetadata, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.imageClassificationDatasetMetadata != null && Object.hasOwnProperty.call(message, "imageClassificationDatasetMetadata")) + $root.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.encode(message.imageClassificationDatasetMetadata, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.textClassificationDatasetMetadata != null && Object.hasOwnProperty.call(message, "textClassificationDatasetMetadata")) + $root.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.encode(message.textClassificationDatasetMetadata, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.imageObjectDetectionDatasetMetadata != null && Object.hasOwnProperty.call(message, "imageObjectDetectionDatasetMetadata")) + $root.google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata.encode(message.imageObjectDetectionDatasetMetadata, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.textExtractionDatasetMetadata != null && Object.hasOwnProperty.call(message, "textExtractionDatasetMetadata")) + $root.google.cloud.automl.v1beta1.TextExtractionDatasetMetadata.encode(message.textExtractionDatasetMetadata, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.videoObjectTrackingDatasetMetadata != null && Object.hasOwnProperty.call(message, "videoObjectTrackingDatasetMetadata")) + $root.google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata.encode(message.videoObjectTrackingDatasetMetadata, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.textSentimentDatasetMetadata != null && Object.hasOwnProperty.call(message, "textSentimentDatasetMetadata")) + $root.google.cloud.automl.v1beta1.TextSentimentDatasetMetadata.encode(message.textSentimentDatasetMetadata, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.videoClassificationDatasetMetadata != null && Object.hasOwnProperty.call(message, "videoClassificationDatasetMetadata")) + $root.google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata.encode(message.videoClassificationDatasetMetadata, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.tablesDatasetMetadata != null && Object.hasOwnProperty.call(message, "tablesDatasetMetadata")) + $root.google.cloud.automl.v1beta1.TablesDatasetMetadata.encode(message.tablesDatasetMetadata, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Dataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.Dataset + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.Dataset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 23: { + message.translationDatasetMetadata = $root.google.cloud.automl.v1beta1.TranslationDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 24: { + message.imageClassificationDatasetMetadata = $root.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 25: { + message.textClassificationDatasetMetadata = $root.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 26: { + message.imageObjectDetectionDatasetMetadata = $root.google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 31: { + message.videoClassificationDatasetMetadata = $root.google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 29: { + message.videoObjectTrackingDatasetMetadata = $root.google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 28: { + message.textExtractionDatasetMetadata = $root.google.cloud.automl.v1beta1.TextExtractionDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 30: { + message.textSentimentDatasetMetadata = $root.google.cloud.automl.v1beta1.TextSentimentDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 33: { + message.tablesDatasetMetadata = $root.google.cloud.automl.v1beta1.TablesDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 21: { + message.exampleCount = reader.int32(); + break; + } + case 14: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 17: { + message.etag = reader.string(); + 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.automl.v1beta1.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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"; + var properties = {}; + if (message.translationDatasetMetadata != null && message.hasOwnProperty("translationDatasetMetadata")) { + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.TranslationDatasetMetadata.verify(message.translationDatasetMetadata); + if (error) + return "translationDatasetMetadata." + error; + } + } + if (message.imageClassificationDatasetMetadata != null && message.hasOwnProperty("imageClassificationDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.verify(message.imageClassificationDatasetMetadata); + if (error) + return "imageClassificationDatasetMetadata." + error; + } + } + if (message.textClassificationDatasetMetadata != null && message.hasOwnProperty("textClassificationDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.verify(message.textClassificationDatasetMetadata); + if (error) + return "textClassificationDatasetMetadata." + error; + } + } + if (message.imageObjectDetectionDatasetMetadata != null && message.hasOwnProperty("imageObjectDetectionDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata.verify(message.imageObjectDetectionDatasetMetadata); + if (error) + return "imageObjectDetectionDatasetMetadata." + error; + } + } + if (message.videoClassificationDatasetMetadata != null && message.hasOwnProperty("videoClassificationDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata.verify(message.videoClassificationDatasetMetadata); + if (error) + return "videoClassificationDatasetMetadata." + error; + } + } + if (message.videoObjectTrackingDatasetMetadata != null && message.hasOwnProperty("videoObjectTrackingDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata.verify(message.videoObjectTrackingDatasetMetadata); + if (error) + return "videoObjectTrackingDatasetMetadata." + error; + } + } + if (message.textExtractionDatasetMetadata != null && message.hasOwnProperty("textExtractionDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextExtractionDatasetMetadata.verify(message.textExtractionDatasetMetadata); + if (error) + return "textExtractionDatasetMetadata." + error; + } + } + if (message.textSentimentDatasetMetadata != null && message.hasOwnProperty("textSentimentDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextSentimentDatasetMetadata.verify(message.textSentimentDatasetMetadata); + if (error) + return "textSentimentDatasetMetadata." + error; + } + } + if (message.tablesDatasetMetadata != null && message.hasOwnProperty("tablesDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.TablesDatasetMetadata.verify(message.tablesDatasetMetadata); + if (error) + return "tablesDatasetMetadata." + error; + } + } + 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.exampleCount != null && message.hasOwnProperty("exampleCount")) + if (!$util.isInteger(message.exampleCount)) + return "exampleCount: integer expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.Dataset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.Dataset} Dataset + */ + Dataset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.Dataset) + return object; + var message = new $root.google.cloud.automl.v1beta1.Dataset(); + if (object.translationDatasetMetadata != null) { + if (typeof object.translationDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Dataset.translationDatasetMetadata: object expected"); + message.translationDatasetMetadata = $root.google.cloud.automl.v1beta1.TranslationDatasetMetadata.fromObject(object.translationDatasetMetadata); + } + if (object.imageClassificationDatasetMetadata != null) { + if (typeof object.imageClassificationDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Dataset.imageClassificationDatasetMetadata: object expected"); + message.imageClassificationDatasetMetadata = $root.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.fromObject(object.imageClassificationDatasetMetadata); + } + if (object.textClassificationDatasetMetadata != null) { + if (typeof object.textClassificationDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Dataset.textClassificationDatasetMetadata: object expected"); + message.textClassificationDatasetMetadata = $root.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.fromObject(object.textClassificationDatasetMetadata); + } + if (object.imageObjectDetectionDatasetMetadata != null) { + if (typeof object.imageObjectDetectionDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Dataset.imageObjectDetectionDatasetMetadata: object expected"); + message.imageObjectDetectionDatasetMetadata = $root.google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata.fromObject(object.imageObjectDetectionDatasetMetadata); + } + if (object.videoClassificationDatasetMetadata != null) { + if (typeof object.videoClassificationDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Dataset.videoClassificationDatasetMetadata: object expected"); + message.videoClassificationDatasetMetadata = $root.google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata.fromObject(object.videoClassificationDatasetMetadata); + } + if (object.videoObjectTrackingDatasetMetadata != null) { + if (typeof object.videoObjectTrackingDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Dataset.videoObjectTrackingDatasetMetadata: object expected"); + message.videoObjectTrackingDatasetMetadata = $root.google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata.fromObject(object.videoObjectTrackingDatasetMetadata); + } + if (object.textExtractionDatasetMetadata != null) { + if (typeof object.textExtractionDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Dataset.textExtractionDatasetMetadata: object expected"); + message.textExtractionDatasetMetadata = $root.google.cloud.automl.v1beta1.TextExtractionDatasetMetadata.fromObject(object.textExtractionDatasetMetadata); + } + if (object.textSentimentDatasetMetadata != null) { + if (typeof object.textSentimentDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Dataset.textSentimentDatasetMetadata: object expected"); + message.textSentimentDatasetMetadata = $root.google.cloud.automl.v1beta1.TextSentimentDatasetMetadata.fromObject(object.textSentimentDatasetMetadata); + } + if (object.tablesDatasetMetadata != null) { + if (typeof object.tablesDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Dataset.tablesDatasetMetadata: object expected"); + message.tablesDatasetMetadata = $root.google.cloud.automl.v1beta1.TablesDatasetMetadata.fromObject(object.tablesDatasetMetadata); + } + 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.exampleCount != null) + message.exampleCount = object.exampleCount | 0; + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Dataset.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.Dataset + * @static + * @param {google.cloud.automl.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.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.etag = ""; + object.exampleCount = 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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) + object.exampleCount = message.exampleCount; + if (message.translationDatasetMetadata != null && message.hasOwnProperty("translationDatasetMetadata")) { + object.translationDatasetMetadata = $root.google.cloud.automl.v1beta1.TranslationDatasetMetadata.toObject(message.translationDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "translationDatasetMetadata"; + } + if (message.imageClassificationDatasetMetadata != null && message.hasOwnProperty("imageClassificationDatasetMetadata")) { + object.imageClassificationDatasetMetadata = $root.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.toObject(message.imageClassificationDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "imageClassificationDatasetMetadata"; + } + if (message.textClassificationDatasetMetadata != null && message.hasOwnProperty("textClassificationDatasetMetadata")) { + object.textClassificationDatasetMetadata = $root.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.toObject(message.textClassificationDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "textClassificationDatasetMetadata"; + } + if (message.imageObjectDetectionDatasetMetadata != null && message.hasOwnProperty("imageObjectDetectionDatasetMetadata")) { + object.imageObjectDetectionDatasetMetadata = $root.google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata.toObject(message.imageObjectDetectionDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "imageObjectDetectionDatasetMetadata"; + } + if (message.textExtractionDatasetMetadata != null && message.hasOwnProperty("textExtractionDatasetMetadata")) { + object.textExtractionDatasetMetadata = $root.google.cloud.automl.v1beta1.TextExtractionDatasetMetadata.toObject(message.textExtractionDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "textExtractionDatasetMetadata"; + } + if (message.videoObjectTrackingDatasetMetadata != null && message.hasOwnProperty("videoObjectTrackingDatasetMetadata")) { + object.videoObjectTrackingDatasetMetadata = $root.google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata.toObject(message.videoObjectTrackingDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "videoObjectTrackingDatasetMetadata"; + } + if (message.textSentimentDatasetMetadata != null && message.hasOwnProperty("textSentimentDatasetMetadata")) { + object.textSentimentDatasetMetadata = $root.google.cloud.automl.v1beta1.TextSentimentDatasetMetadata.toObject(message.textSentimentDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "textSentimentDatasetMetadata"; + } + if (message.videoClassificationDatasetMetadata != null && message.hasOwnProperty("videoClassificationDatasetMetadata")) { + object.videoClassificationDatasetMetadata = $root.google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata.toObject(message.videoClassificationDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "videoClassificationDatasetMetadata"; + } + if (message.tablesDatasetMetadata != null && message.hasOwnProperty("tablesDatasetMetadata")) { + object.tablesDatasetMetadata = $root.google.cloud.automl.v1beta1.TablesDatasetMetadata.toObject(message.tablesDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "tablesDatasetMetadata"; + } + return object; + }; + + /** + * Converts this Dataset to JSON. + * @function toJSON + * @memberof google.cloud.automl.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.automl.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.automl.v1beta1.Dataset"; + }; + + return Dataset; + })(); + + v1beta1.ImageClassificationDatasetMetadata = (function() { + + /** + * Properties of an ImageClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IImageClassificationDatasetMetadata + * @property {google.cloud.automl.v1beta1.ClassificationType|null} [classificationType] ImageClassificationDatasetMetadata classificationType + */ + + /** + * Constructs a new ImageClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ImageClassificationDatasetMetadata. + * @implements IImageClassificationDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata=} [properties] Properties to set + */ + function ImageClassificationDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageClassificationDatasetMetadata classificationType. + * @member {google.cloud.automl.v1beta1.ClassificationType} classificationType + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @instance + */ + ImageClassificationDatasetMetadata.prototype.classificationType = 0; + + /** + * Creates a new ImageClassificationDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata} ImageClassificationDatasetMetadata instance + */ + ImageClassificationDatasetMetadata.create = function create(properties) { + return new ImageClassificationDatasetMetadata(properties); + }; + + /** + * Encodes the specified ImageClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata} message ImageClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.classificationType != null && Object.hasOwnProperty.call(message, "classificationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.classificationType); + return writer; + }; + + /** + * Encodes the specified ImageClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata} message ImageClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageClassificationDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata} ImageClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.classificationType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata} ImageClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageClassificationDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageClassificationDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + switch (message.classificationType) { + default: + return "classificationType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ImageClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata} ImageClassificationDatasetMetadata + */ + ImageClassificationDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata(); + switch (object.classificationType) { + default: + if (typeof object.classificationType === "number") { + message.classificationType = object.classificationType; + break; + } + break; + case "CLASSIFICATION_TYPE_UNSPECIFIED": + case 0: + message.classificationType = 0; + break; + case "MULTICLASS": + case 1: + message.classificationType = 1; + break; + case "MULTILABEL": + case 2: + message.classificationType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ImageClassificationDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata} message ImageClassificationDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageClassificationDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.classificationType = options.enums === String ? "CLASSIFICATION_TYPE_UNSPECIFIED" : 0; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + object.classificationType = options.enums === String ? $root.google.cloud.automl.v1beta1.ClassificationType[message.classificationType] === undefined ? message.classificationType : $root.google.cloud.automl.v1beta1.ClassificationType[message.classificationType] : message.classificationType; + return object; + }; + + /** + * Converts this ImageClassificationDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageClassificationDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageClassificationDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageClassificationDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata"; + }; + + return ImageClassificationDatasetMetadata; + })(); + + v1beta1.ImageObjectDetectionDatasetMetadata = (function() { + + /** + * Properties of an ImageObjectDetectionDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IImageObjectDetectionDatasetMetadata + */ + + /** + * Constructs a new ImageObjectDetectionDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ImageObjectDetectionDatasetMetadata. + * @implements IImageObjectDetectionDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata=} [properties] Properties to set + */ + function ImageObjectDetectionDatasetMetadata(properties) { + if (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 ImageObjectDetectionDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata} ImageObjectDetectionDatasetMetadata instance + */ + ImageObjectDetectionDatasetMetadata.create = function create(properties) { + return new ImageObjectDetectionDatasetMetadata(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata} message ImageObjectDetectionDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata} message ImageObjectDetectionDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata} ImageObjectDetectionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata} ImageObjectDetectionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata} ImageObjectDetectionDatasetMetadata + */ + ImageObjectDetectionDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata(); + }; + + /** + * Creates a plain object from an ImageObjectDetectionDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata} message ImageObjectDetectionDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionDatasetMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ImageObjectDetectionDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata"; + }; + + return ImageObjectDetectionDatasetMetadata; + })(); + + v1beta1.ImageClassificationModelMetadata = (function() { + + /** + * Properties of an ImageClassificationModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IImageClassificationModelMetadata + * @property {string|null} [baseModelId] ImageClassificationModelMetadata baseModelId + * @property {number|Long|null} [trainBudget] ImageClassificationModelMetadata trainBudget + * @property {number|Long|null} [trainCost] ImageClassificationModelMetadata trainCost + * @property {string|null} [stopReason] ImageClassificationModelMetadata stopReason + * @property {string|null} [modelType] ImageClassificationModelMetadata modelType + * @property {number|null} [nodeQps] ImageClassificationModelMetadata nodeQps + * @property {number|Long|null} [nodeCount] ImageClassificationModelMetadata nodeCount + */ + + /** + * Constructs a new ImageClassificationModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ImageClassificationModelMetadata. + * @implements IImageClassificationModelMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IImageClassificationModelMetadata=} [properties] Properties to set + */ + function ImageClassificationModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageClassificationModelMetadata baseModelId. + * @member {string} baseModelId + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.baseModelId = ""; + + /** + * ImageClassificationModelMetadata trainBudget. + * @member {number|Long} trainBudget + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.trainBudget = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImageClassificationModelMetadata trainCost. + * @member {number|Long} trainCost + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.trainCost = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImageClassificationModelMetadata stopReason. + * @member {string} stopReason + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.stopReason = ""; + + /** + * ImageClassificationModelMetadata modelType. + * @member {string} modelType + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.modelType = ""; + + /** + * ImageClassificationModelMetadata nodeQps. + * @member {number} nodeQps + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.nodeQps = 0; + + /** + * ImageClassificationModelMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImageClassificationModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageClassificationModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ImageClassificationModelMetadata} ImageClassificationModelMetadata instance + */ + ImageClassificationModelMetadata.create = function create(properties) { + return new ImageClassificationModelMetadata(properties); + }; + + /** + * Encodes the specified ImageClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageClassificationModelMetadata} message ImageClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseModelId != null && Object.hasOwnProperty.call(message, "baseModelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseModelId); + if (message.trainBudget != null && Object.hasOwnProperty.call(message, "trainBudget")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.trainBudget); + if (message.trainCost != null && Object.hasOwnProperty.call(message, "trainCost")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.trainCost); + if (message.stopReason != null && Object.hasOwnProperty.call(message, "stopReason")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.stopReason); + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.modelType); + if (message.nodeQps != null && Object.hasOwnProperty.call(message, "nodeQps")) + writer.uint32(/* id 13, wireType 1 =*/105).double(message.nodeQps); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 14, wireType 0 =*/112).int64(message.nodeCount); + return writer; + }; + + /** + * Encodes the specified ImageClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageClassificationModelMetadata} message ImageClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageClassificationModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ImageClassificationModelMetadata} ImageClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ImageClassificationModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.baseModelId = reader.string(); + break; + } + case 2: { + message.trainBudget = reader.int64(); + break; + } + case 3: { + message.trainCost = reader.int64(); + break; + } + case 5: { + message.stopReason = reader.string(); + break; + } + case 7: { + message.modelType = reader.string(); + break; + } + case 13: { + message.nodeQps = reader.double(); + break; + } + case 14: { + message.nodeCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ImageClassificationModelMetadata} ImageClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageClassificationModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageClassificationModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseModelId != null && message.hasOwnProperty("baseModelId")) + if (!$util.isString(message.baseModelId)) + return "baseModelId: string expected"; + if (message.trainBudget != null && message.hasOwnProperty("trainBudget")) + if (!$util.isInteger(message.trainBudget) && !(message.trainBudget && $util.isInteger(message.trainBudget.low) && $util.isInteger(message.trainBudget.high))) + return "trainBudget: integer|Long expected"; + if (message.trainCost != null && message.hasOwnProperty("trainCost")) + if (!$util.isInteger(message.trainCost) && !(message.trainCost && $util.isInteger(message.trainCost.low) && $util.isInteger(message.trainCost.high))) + return "trainCost: integer|Long expected"; + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + if (!$util.isString(message.stopReason)) + return "stopReason: string expected"; + if (message.modelType != null && message.hasOwnProperty("modelType")) + if (!$util.isString(message.modelType)) + return "modelType: string expected"; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + if (typeof message.nodeQps !== "number") + return "nodeQps: number expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ImageClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ImageClassificationModelMetadata} ImageClassificationModelMetadata + */ + ImageClassificationModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ImageClassificationModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.ImageClassificationModelMetadata(); + if (object.baseModelId != null) + message.baseModelId = String(object.baseModelId); + if (object.trainBudget != null) + if ($util.Long) + (message.trainBudget = $util.Long.fromValue(object.trainBudget)).unsigned = false; + else if (typeof object.trainBudget === "string") + message.trainBudget = parseInt(object.trainBudget, 10); + else if (typeof object.trainBudget === "number") + message.trainBudget = object.trainBudget; + else if (typeof object.trainBudget === "object") + message.trainBudget = new $util.LongBits(object.trainBudget.low >>> 0, object.trainBudget.high >>> 0).toNumber(); + if (object.trainCost != null) + if ($util.Long) + (message.trainCost = $util.Long.fromValue(object.trainCost)).unsigned = false; + else if (typeof object.trainCost === "string") + message.trainCost = parseInt(object.trainCost, 10); + else if (typeof object.trainCost === "number") + message.trainCost = object.trainCost; + else if (typeof object.trainCost === "object") + message.trainCost = new $util.LongBits(object.trainCost.low >>> 0, object.trainCost.high >>> 0).toNumber(); + if (object.stopReason != null) + message.stopReason = String(object.stopReason); + if (object.modelType != null) + message.modelType = String(object.modelType); + if (object.nodeQps != null) + message.nodeQps = Number(object.nodeQps); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImageClassificationModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ImageClassificationModelMetadata} message ImageClassificationModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageClassificationModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.baseModelId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainBudget = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainBudget = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainCost = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainCost = options.longs === String ? "0" : 0; + object.stopReason = ""; + object.modelType = ""; + object.nodeQps = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + } + if (message.baseModelId != null && message.hasOwnProperty("baseModelId")) + object.baseModelId = message.baseModelId; + if (message.trainBudget != null && message.hasOwnProperty("trainBudget")) + if (typeof message.trainBudget === "number") + object.trainBudget = options.longs === String ? String(message.trainBudget) : message.trainBudget; + else + object.trainBudget = options.longs === String ? $util.Long.prototype.toString.call(message.trainBudget) : options.longs === Number ? new $util.LongBits(message.trainBudget.low >>> 0, message.trainBudget.high >>> 0).toNumber() : message.trainBudget; + if (message.trainCost != null && message.hasOwnProperty("trainCost")) + if (typeof message.trainCost === "number") + object.trainCost = options.longs === String ? String(message.trainCost) : message.trainCost; + else + object.trainCost = options.longs === String ? $util.Long.prototype.toString.call(message.trainCost) : options.longs === Number ? new $util.LongBits(message.trainCost.low >>> 0, message.trainCost.high >>> 0).toNumber() : message.trainCost; + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + object.stopReason = message.stopReason; + if (message.modelType != null && message.hasOwnProperty("modelType")) + object.modelType = message.modelType; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + object.nodeQps = options.json && !isFinite(message.nodeQps) ? String(message.nodeQps) : message.nodeQps; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + return object; + }; + + /** + * Converts this ImageClassificationModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageClassificationModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageClassificationModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageClassificationModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ImageClassificationModelMetadata"; + }; + + return ImageClassificationModelMetadata; + })(); + + v1beta1.ImageObjectDetectionModelMetadata = (function() { + + /** + * Properties of an ImageObjectDetectionModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IImageObjectDetectionModelMetadata + * @property {string|null} [modelType] ImageObjectDetectionModelMetadata modelType + * @property {number|Long|null} [nodeCount] ImageObjectDetectionModelMetadata nodeCount + * @property {number|null} [nodeQps] ImageObjectDetectionModelMetadata nodeQps + * @property {string|null} [stopReason] ImageObjectDetectionModelMetadata stopReason + * @property {number|Long|null} [trainBudgetMilliNodeHours] ImageObjectDetectionModelMetadata trainBudgetMilliNodeHours + * @property {number|Long|null} [trainCostMilliNodeHours] ImageObjectDetectionModelMetadata trainCostMilliNodeHours + */ + + /** + * Constructs a new ImageObjectDetectionModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ImageObjectDetectionModelMetadata. + * @implements IImageObjectDetectionModelMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata=} [properties] Properties to set + */ + function ImageObjectDetectionModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionModelMetadata modelType. + * @member {string} modelType + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.modelType = ""; + + /** + * ImageObjectDetectionModelMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImageObjectDetectionModelMetadata nodeQps. + * @member {number} nodeQps + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.nodeQps = 0; + + /** + * ImageObjectDetectionModelMetadata stopReason. + * @member {string} stopReason + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.stopReason = ""; + + /** + * ImageObjectDetectionModelMetadata trainBudgetMilliNodeHours. + * @member {number|Long} trainBudgetMilliNodeHours + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.trainBudgetMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImageObjectDetectionModelMetadata trainCostMilliNodeHours. + * @member {number|Long} trainCostMilliNodeHours + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.trainCostMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImageObjectDetectionModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata} ImageObjectDetectionModelMetadata instance + */ + ImageObjectDetectionModelMetadata.create = function create(properties) { + return new ImageObjectDetectionModelMetadata(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata} message ImageObjectDetectionModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.modelType); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.nodeCount); + if (message.nodeQps != null && Object.hasOwnProperty.call(message, "nodeQps")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.nodeQps); + if (message.stopReason != null && Object.hasOwnProperty.call(message, "stopReason")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.stopReason); + if (message.trainBudgetMilliNodeHours != null && Object.hasOwnProperty.call(message, "trainBudgetMilliNodeHours")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.trainBudgetMilliNodeHours); + if (message.trainCostMilliNodeHours != null && Object.hasOwnProperty.call(message, "trainCostMilliNodeHours")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.trainCostMilliNodeHours); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata} message ImageObjectDetectionModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata} ImageObjectDetectionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.modelType = reader.string(); + break; + } + case 3: { + message.nodeCount = reader.int64(); + break; + } + case 4: { + message.nodeQps = reader.double(); + break; + } + case 5: { + message.stopReason = reader.string(); + break; + } + case 6: { + message.trainBudgetMilliNodeHours = reader.int64(); + break; + } + case 7: { + message.trainCostMilliNodeHours = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata} ImageObjectDetectionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelType != null && message.hasOwnProperty("modelType")) + if (!$util.isString(message.modelType)) + return "modelType: string expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + if (typeof message.nodeQps !== "number") + return "nodeQps: number expected"; + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + if (!$util.isString(message.stopReason)) + return "stopReason: string expected"; + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + if (!$util.isInteger(message.trainBudgetMilliNodeHours) && !(message.trainBudgetMilliNodeHours && $util.isInteger(message.trainBudgetMilliNodeHours.low) && $util.isInteger(message.trainBudgetMilliNodeHours.high))) + return "trainBudgetMilliNodeHours: integer|Long expected"; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (!$util.isInteger(message.trainCostMilliNodeHours) && !(message.trainCostMilliNodeHours && $util.isInteger(message.trainCostMilliNodeHours.low) && $util.isInteger(message.trainCostMilliNodeHours.high))) + return "trainCostMilliNodeHours: integer|Long expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata} ImageObjectDetectionModelMetadata + */ + ImageObjectDetectionModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata(); + if (object.modelType != null) + message.modelType = String(object.modelType); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); + if (object.nodeQps != null) + message.nodeQps = Number(object.nodeQps); + if (object.stopReason != null) + message.stopReason = String(object.stopReason); + if (object.trainBudgetMilliNodeHours != null) + if ($util.Long) + (message.trainBudgetMilliNodeHours = $util.Long.fromValue(object.trainBudgetMilliNodeHours)).unsigned = false; + else if (typeof object.trainBudgetMilliNodeHours === "string") + message.trainBudgetMilliNodeHours = parseInt(object.trainBudgetMilliNodeHours, 10); + else if (typeof object.trainBudgetMilliNodeHours === "number") + message.trainBudgetMilliNodeHours = object.trainBudgetMilliNodeHours; + else if (typeof object.trainBudgetMilliNodeHours === "object") + message.trainBudgetMilliNodeHours = new $util.LongBits(object.trainBudgetMilliNodeHours.low >>> 0, object.trainBudgetMilliNodeHours.high >>> 0).toNumber(); + if (object.trainCostMilliNodeHours != null) + if ($util.Long) + (message.trainCostMilliNodeHours = $util.Long.fromValue(object.trainCostMilliNodeHours)).unsigned = false; + else if (typeof object.trainCostMilliNodeHours === "string") + message.trainCostMilliNodeHours = parseInt(object.trainCostMilliNodeHours, 10); + else if (typeof object.trainCostMilliNodeHours === "number") + message.trainCostMilliNodeHours = object.trainCostMilliNodeHours; + else if (typeof object.trainCostMilliNodeHours === "object") + message.trainCostMilliNodeHours = new $util.LongBits(object.trainCostMilliNodeHours.low >>> 0, object.trainCostMilliNodeHours.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata} message ImageObjectDetectionModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modelType = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + object.nodeQps = 0; + object.stopReason = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainBudgetMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainBudgetMilliNodeHours = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainCostMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainCostMilliNodeHours = options.longs === String ? "0" : 0; + } + if (message.modelType != null && message.hasOwnProperty("modelType")) + object.modelType = message.modelType; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + object.nodeQps = options.json && !isFinite(message.nodeQps) ? String(message.nodeQps) : message.nodeQps; + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + object.stopReason = message.stopReason; + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + if (typeof message.trainBudgetMilliNodeHours === "number") + object.trainBudgetMilliNodeHours = options.longs === String ? String(message.trainBudgetMilliNodeHours) : message.trainBudgetMilliNodeHours; + else + object.trainBudgetMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainBudgetMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainBudgetMilliNodeHours.low >>> 0, message.trainBudgetMilliNodeHours.high >>> 0).toNumber() : message.trainBudgetMilliNodeHours; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (typeof message.trainCostMilliNodeHours === "number") + object.trainCostMilliNodeHours = options.longs === String ? String(message.trainCostMilliNodeHours) : message.trainCostMilliNodeHours; + else + object.trainCostMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainCostMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainCostMilliNodeHours.low >>> 0, message.trainCostMilliNodeHours.high >>> 0).toNumber() : message.trainCostMilliNodeHours; + return object; + }; + + /** + * Converts this ImageObjectDetectionModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata"; + }; + + return ImageObjectDetectionModelMetadata; + })(); + + v1beta1.ImageClassificationModelDeploymentMetadata = (function() { + + /** + * Properties of an ImageClassificationModelDeploymentMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IImageClassificationModelDeploymentMetadata + * @property {number|Long|null} [nodeCount] ImageClassificationModelDeploymentMetadata nodeCount + */ + + /** + * Constructs a new ImageClassificationModelDeploymentMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ImageClassificationModelDeploymentMetadata. + * @implements IImageClassificationModelDeploymentMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata=} [properties] Properties to set + */ + function ImageClassificationModelDeploymentMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageClassificationModelDeploymentMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @instance + */ + ImageClassificationModelDeploymentMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImageClassificationModelDeploymentMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata} ImageClassificationModelDeploymentMetadata instance + */ + ImageClassificationModelDeploymentMetadata.create = function create(properties) { + return new ImageClassificationModelDeploymentMetadata(properties); + }; + + /** + * Encodes the specified ImageClassificationModelDeploymentMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata} message ImageClassificationModelDeploymentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationModelDeploymentMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.nodeCount); + return writer; + }; + + /** + * Encodes the specified ImageClassificationModelDeploymentMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata} message ImageClassificationModelDeploymentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationModelDeploymentMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageClassificationModelDeploymentMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata} ImageClassificationModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationModelDeploymentMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nodeCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageClassificationModelDeploymentMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata} ImageClassificationModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationModelDeploymentMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageClassificationModelDeploymentMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageClassificationModelDeploymentMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ImageClassificationModelDeploymentMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata} ImageClassificationModelDeploymentMetadata + */ + ImageClassificationModelDeploymentMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata(); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImageClassificationModelDeploymentMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata} message ImageClassificationModelDeploymentMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageClassificationModelDeploymentMetadata.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.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + return object; + }; + + /** + * Converts this ImageClassificationModelDeploymentMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageClassificationModelDeploymentMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageClassificationModelDeploymentMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageClassificationModelDeploymentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata"; + }; + + return ImageClassificationModelDeploymentMetadata; + })(); + + v1beta1.ImageObjectDetectionModelDeploymentMetadata = (function() { + + /** + * Properties of an ImageObjectDetectionModelDeploymentMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IImageObjectDetectionModelDeploymentMetadata + * @property {number|Long|null} [nodeCount] ImageObjectDetectionModelDeploymentMetadata nodeCount + */ + + /** + * Constructs a new ImageObjectDetectionModelDeploymentMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ImageObjectDetectionModelDeploymentMetadata. + * @implements IImageObjectDetectionModelDeploymentMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata=} [properties] Properties to set + */ + function ImageObjectDetectionModelDeploymentMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionModelDeploymentMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @instance + */ + ImageObjectDetectionModelDeploymentMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImageObjectDetectionModelDeploymentMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata} ImageObjectDetectionModelDeploymentMetadata instance + */ + ImageObjectDetectionModelDeploymentMetadata.create = function create(properties) { + return new ImageObjectDetectionModelDeploymentMetadata(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionModelDeploymentMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata} message ImageObjectDetectionModelDeploymentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionModelDeploymentMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.nodeCount); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionModelDeploymentMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata} message ImageObjectDetectionModelDeploymentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionModelDeploymentMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionModelDeploymentMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata} ImageObjectDetectionModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionModelDeploymentMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nodeCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionModelDeploymentMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata} ImageObjectDetectionModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionModelDeploymentMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionModelDeploymentMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionModelDeploymentMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionModelDeploymentMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata} ImageObjectDetectionModelDeploymentMetadata + */ + ImageObjectDetectionModelDeploymentMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata(); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionModelDeploymentMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata} message ImageObjectDetectionModelDeploymentMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionModelDeploymentMetadata.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.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + return object; + }; + + /** + * Converts this ImageObjectDetectionModelDeploymentMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionModelDeploymentMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionModelDeploymentMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionModelDeploymentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata"; + }; + + return ImageObjectDetectionModelDeploymentMetadata; + })(); + + v1beta1.TextClassificationDatasetMetadata = (function() { + + /** + * Properties of a TextClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextClassificationDatasetMetadata + * @property {google.cloud.automl.v1beta1.ClassificationType|null} [classificationType] TextClassificationDatasetMetadata classificationType + */ + + /** + * Constructs a new TextClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextClassificationDatasetMetadata. + * @implements ITextClassificationDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata=} [properties] Properties to set + */ + function TextClassificationDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextClassificationDatasetMetadata classificationType. + * @member {google.cloud.automl.v1beta1.ClassificationType} classificationType + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @instance + */ + TextClassificationDatasetMetadata.prototype.classificationType = 0; + + /** + * Creates a new TextClassificationDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextClassificationDatasetMetadata} TextClassificationDatasetMetadata instance + */ + TextClassificationDatasetMetadata.create = function create(properties) { + return new TextClassificationDatasetMetadata(properties); + }; + + /** + * Encodes the specified TextClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata} message TextClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.classificationType != null && Object.hasOwnProperty.call(message, "classificationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.classificationType); + return writer; + }; + + /** + * Encodes the specified TextClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata} message TextClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextClassificationDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextClassificationDatasetMetadata} TextClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.classificationType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextClassificationDatasetMetadata} TextClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextClassificationDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextClassificationDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + switch (message.classificationType) { + default: + return "classificationType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TextClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextClassificationDatasetMetadata} TextClassificationDatasetMetadata + */ + TextClassificationDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata(); + switch (object.classificationType) { + default: + if (typeof object.classificationType === "number") { + message.classificationType = object.classificationType; + break; + } + break; + case "CLASSIFICATION_TYPE_UNSPECIFIED": + case 0: + message.classificationType = 0; + break; + case "MULTICLASS": + case 1: + message.classificationType = 1; + break; + case "MULTILABEL": + case 2: + message.classificationType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TextClassificationDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.TextClassificationDatasetMetadata} message TextClassificationDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextClassificationDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.classificationType = options.enums === String ? "CLASSIFICATION_TYPE_UNSPECIFIED" : 0; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + object.classificationType = options.enums === String ? $root.google.cloud.automl.v1beta1.ClassificationType[message.classificationType] === undefined ? message.classificationType : $root.google.cloud.automl.v1beta1.ClassificationType[message.classificationType] : message.classificationType; + return object; + }; + + /** + * Converts this TextClassificationDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TextClassificationDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextClassificationDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextClassificationDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextClassificationDatasetMetadata"; + }; + + return TextClassificationDatasetMetadata; + })(); + + v1beta1.TextClassificationModelMetadata = (function() { + + /** + * Properties of a TextClassificationModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextClassificationModelMetadata + * @property {google.cloud.automl.v1beta1.ClassificationType|null} [classificationType] TextClassificationModelMetadata classificationType + */ + + /** + * Constructs a new TextClassificationModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextClassificationModelMetadata. + * @implements ITextClassificationModelMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ITextClassificationModelMetadata=} [properties] Properties to set + */ + function TextClassificationModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextClassificationModelMetadata classificationType. + * @member {google.cloud.automl.v1beta1.ClassificationType} classificationType + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @instance + */ + TextClassificationModelMetadata.prototype.classificationType = 0; + + /** + * Creates a new TextClassificationModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextClassificationModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextClassificationModelMetadata} TextClassificationModelMetadata instance + */ + TextClassificationModelMetadata.create = function create(properties) { + return new TextClassificationModelMetadata(properties); + }; + + /** + * Encodes the specified TextClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextClassificationModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextClassificationModelMetadata} message TextClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.classificationType != null && Object.hasOwnProperty.call(message, "classificationType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.classificationType); + return writer; + }; + + /** + * Encodes the specified TextClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextClassificationModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextClassificationModelMetadata} message TextClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextClassificationModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextClassificationModelMetadata} TextClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextClassificationModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.classificationType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextClassificationModelMetadata} TextClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextClassificationModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextClassificationModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + switch (message.classificationType) { + default: + return "classificationType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TextClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextClassificationModelMetadata} TextClassificationModelMetadata + */ + TextClassificationModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextClassificationModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextClassificationModelMetadata(); + switch (object.classificationType) { + default: + if (typeof object.classificationType === "number") { + message.classificationType = object.classificationType; + break; + } + break; + case "CLASSIFICATION_TYPE_UNSPECIFIED": + case 0: + message.classificationType = 0; + break; + case "MULTICLASS": + case 1: + message.classificationType = 1; + break; + case "MULTILABEL": + case 2: + message.classificationType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TextClassificationModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.TextClassificationModelMetadata} message TextClassificationModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextClassificationModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.classificationType = options.enums === String ? "CLASSIFICATION_TYPE_UNSPECIFIED" : 0; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + object.classificationType = options.enums === String ? $root.google.cloud.automl.v1beta1.ClassificationType[message.classificationType] === undefined ? message.classificationType : $root.google.cloud.automl.v1beta1.ClassificationType[message.classificationType] : message.classificationType; + return object; + }; + + /** + * Converts this TextClassificationModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TextClassificationModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextClassificationModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextClassificationModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextClassificationModelMetadata"; + }; + + return TextClassificationModelMetadata; + })(); + + v1beta1.TextExtractionDatasetMetadata = (function() { + + /** + * Properties of a TextExtractionDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextExtractionDatasetMetadata + */ + + /** + * Constructs a new TextExtractionDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextExtractionDatasetMetadata. + * @implements ITextExtractionDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata=} [properties] Properties to set + */ + function TextExtractionDatasetMetadata(properties) { + if (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 TextExtractionDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextExtractionDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextExtractionDatasetMetadata} TextExtractionDatasetMetadata instance + */ + TextExtractionDatasetMetadata.create = function create(properties) { + return new TextExtractionDatasetMetadata(properties); + }; + + /** + * Encodes the specified TextExtractionDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextExtractionDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata} message TextExtractionDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified TextExtractionDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextExtractionDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata} message TextExtractionDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextExtractionDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextExtractionDatasetMetadata} TextExtractionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextExtractionDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextExtractionDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextExtractionDatasetMetadata} TextExtractionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextExtractionDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a TextExtractionDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextExtractionDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextExtractionDatasetMetadata} TextExtractionDatasetMetadata + */ + TextExtractionDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextExtractionDatasetMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.TextExtractionDatasetMetadata(); + }; + + /** + * Creates a plain object from a TextExtractionDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextExtractionDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.TextExtractionDatasetMetadata} message TextExtractionDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionDatasetMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this TextExtractionDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextExtractionDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TextExtractionDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextExtractionDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextExtractionDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextExtractionDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextExtractionDatasetMetadata"; + }; + + return TextExtractionDatasetMetadata; + })(); + + v1beta1.TextExtractionModelMetadata = (function() { + + /** + * Properties of a TextExtractionModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextExtractionModelMetadata + * @property {string|null} [modelHint] TextExtractionModelMetadata modelHint + */ + + /** + * Constructs a new TextExtractionModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextExtractionModelMetadata. + * @implements ITextExtractionModelMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ITextExtractionModelMetadata=} [properties] Properties to set + */ + function TextExtractionModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextExtractionModelMetadata modelHint. + * @member {string} modelHint + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @instance + */ + TextExtractionModelMetadata.prototype.modelHint = ""; + + /** + * Creates a new TextExtractionModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextExtractionModelMetadata} TextExtractionModelMetadata instance + */ + TextExtractionModelMetadata.create = function create(properties) { + return new TextExtractionModelMetadata(properties); + }; + + /** + * Encodes the specified TextExtractionModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionModelMetadata} message TextExtractionModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelHint != null && Object.hasOwnProperty.call(message, "modelHint")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.modelHint); + return writer; + }; + + /** + * Encodes the specified TextExtractionModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionModelMetadata} message TextExtractionModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextExtractionModelMetadata} TextExtractionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextExtractionModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.modelHint = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextExtractionModelMetadata} TextExtractionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelHint != null && message.hasOwnProperty("modelHint")) + if (!$util.isString(message.modelHint)) + return "modelHint: string expected"; + return null; + }; + + /** + * Creates a TextExtractionModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextExtractionModelMetadata} TextExtractionModelMetadata + */ + TextExtractionModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextExtractionModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextExtractionModelMetadata(); + if (object.modelHint != null) + message.modelHint = String(object.modelHint); + return message; + }; + + /** + * Creates a plain object from a TextExtractionModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.TextExtractionModelMetadata} message TextExtractionModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.modelHint = ""; + if (message.modelHint != null && message.hasOwnProperty("modelHint")) + object.modelHint = message.modelHint; + return object; + }; + + /** + * Converts this TextExtractionModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TextExtractionModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextExtractionModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextExtractionModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextExtractionModelMetadata"; + }; + + return TextExtractionModelMetadata; + })(); + + v1beta1.TextSentimentDatasetMetadata = (function() { + + /** + * Properties of a TextSentimentDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextSentimentDatasetMetadata + * @property {number|null} [sentimentMax] TextSentimentDatasetMetadata sentimentMax + */ + + /** + * Constructs a new TextSentimentDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextSentimentDatasetMetadata. + * @implements ITextSentimentDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata=} [properties] Properties to set + */ + function TextSentimentDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSentimentDatasetMetadata sentimentMax. + * @member {number} sentimentMax + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @instance + */ + TextSentimentDatasetMetadata.prototype.sentimentMax = 0; + + /** + * Creates a new TextSentimentDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextSentimentDatasetMetadata} TextSentimentDatasetMetadata instance + */ + TextSentimentDatasetMetadata.create = function create(properties) { + return new TextSentimentDatasetMetadata(properties); + }; + + /** + * Encodes the specified TextSentimentDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata} message TextSentimentDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sentimentMax != null && Object.hasOwnProperty.call(message, "sentimentMax")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sentimentMax); + return writer; + }; + + /** + * Encodes the specified TextSentimentDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata} message TextSentimentDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextSentimentDatasetMetadata} TextSentimentDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextSentimentDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sentimentMax = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextSentimentDatasetMetadata} TextSentimentDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sentimentMax != null && message.hasOwnProperty("sentimentMax")) + if (!$util.isInteger(message.sentimentMax)) + return "sentimentMax: integer expected"; + return null; + }; + + /** + * Creates a TextSentimentDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextSentimentDatasetMetadata} TextSentimentDatasetMetadata + */ + TextSentimentDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextSentimentDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextSentimentDatasetMetadata(); + if (object.sentimentMax != null) + message.sentimentMax = object.sentimentMax | 0; + return message; + }; + + /** + * Creates a plain object from a TextSentimentDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.TextSentimentDatasetMetadata} message TextSentimentDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sentimentMax = 0; + if (message.sentimentMax != null && message.hasOwnProperty("sentimentMax")) + object.sentimentMax = message.sentimentMax; + return object; + }; + + /** + * Converts this TextSentimentDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TextSentimentDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSentimentDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSentimentDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextSentimentDatasetMetadata"; + }; + + return TextSentimentDatasetMetadata; + })(); + + v1beta1.TextSentimentModelMetadata = (function() { + + /** + * Properties of a TextSentimentModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextSentimentModelMetadata + */ + + /** + * Constructs a new TextSentimentModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextSentimentModelMetadata. + * @implements ITextSentimentModelMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ITextSentimentModelMetadata=} [properties] Properties to set + */ + function TextSentimentModelMetadata(properties) { + if (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 TextSentimentModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextSentimentModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextSentimentModelMetadata} TextSentimentModelMetadata instance + */ + TextSentimentModelMetadata.create = function create(properties) { + return new TextSentimentModelMetadata(properties); + }; + + /** + * Encodes the specified TextSentimentModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextSentimentModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentModelMetadata} message TextSentimentModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified TextSentimentModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSentimentModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentModelMetadata} message TextSentimentModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextSentimentModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextSentimentModelMetadata} TextSentimentModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextSentimentModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSentimentModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextSentimentModelMetadata} TextSentimentModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextSentimentModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a TextSentimentModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextSentimentModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextSentimentModelMetadata} TextSentimentModelMetadata + */ + TextSentimentModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextSentimentModelMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.TextSentimentModelMetadata(); + }; + + /** + * Creates a plain object from a TextSentimentModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextSentimentModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.TextSentimentModelMetadata} message TextSentimentModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentModelMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this TextSentimentModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextSentimentModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TextSentimentModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSentimentModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextSentimentModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSentimentModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextSentimentModelMetadata"; + }; + + return TextSentimentModelMetadata; + })(); + + v1beta1.VideoClassificationDatasetMetadata = (function() { + + /** + * Properties of a VideoClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IVideoClassificationDatasetMetadata + */ + + /** + * Constructs a new VideoClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a VideoClassificationDatasetMetadata. + * @implements IVideoClassificationDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata=} [properties] Properties to set + */ + function VideoClassificationDatasetMetadata(properties) { + if (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 VideoClassificationDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata} VideoClassificationDatasetMetadata instance + */ + VideoClassificationDatasetMetadata.create = function create(properties) { + return new VideoClassificationDatasetMetadata(properties); + }; + + /** + * Encodes the specified VideoClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata} message VideoClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoClassificationDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VideoClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata} message VideoClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoClassificationDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoClassificationDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata} VideoClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoClassificationDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata} VideoClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoClassificationDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoClassificationDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoClassificationDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VideoClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata} VideoClassificationDatasetMetadata + */ + VideoClassificationDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata(); + }; + + /** + * Creates a plain object from a VideoClassificationDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata} message VideoClassificationDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoClassificationDatasetMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VideoClassificationDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + VideoClassificationDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoClassificationDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoClassificationDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata"; + }; + + return VideoClassificationDatasetMetadata; + })(); + + v1beta1.VideoObjectTrackingDatasetMetadata = (function() { + + /** + * Properties of a VideoObjectTrackingDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IVideoObjectTrackingDatasetMetadata + */ + + /** + * Constructs a new VideoObjectTrackingDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a VideoObjectTrackingDatasetMetadata. + * @implements IVideoObjectTrackingDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata=} [properties] Properties to set + */ + function VideoObjectTrackingDatasetMetadata(properties) { + if (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 VideoObjectTrackingDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata} VideoObjectTrackingDatasetMetadata instance + */ + VideoObjectTrackingDatasetMetadata.create = function create(properties) { + return new VideoObjectTrackingDatasetMetadata(properties); + }; + + /** + * Encodes the specified VideoObjectTrackingDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata} message VideoObjectTrackingDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoObjectTrackingDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VideoObjectTrackingDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata} message VideoObjectTrackingDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoObjectTrackingDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoObjectTrackingDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata} VideoObjectTrackingDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoObjectTrackingDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoObjectTrackingDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata} VideoObjectTrackingDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoObjectTrackingDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoObjectTrackingDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoObjectTrackingDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VideoObjectTrackingDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata} VideoObjectTrackingDatasetMetadata + */ + VideoObjectTrackingDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata(); + }; + + /** + * Creates a plain object from a VideoObjectTrackingDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata} message VideoObjectTrackingDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoObjectTrackingDatasetMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VideoObjectTrackingDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + VideoObjectTrackingDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoObjectTrackingDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoObjectTrackingDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata"; + }; + + return VideoObjectTrackingDatasetMetadata; + })(); + + v1beta1.VideoClassificationModelMetadata = (function() { + + /** + * Properties of a VideoClassificationModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IVideoClassificationModelMetadata + */ + + /** + * Constructs a new VideoClassificationModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a VideoClassificationModelMetadata. + * @implements IVideoClassificationModelMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IVideoClassificationModelMetadata=} [properties] Properties to set + */ + function VideoClassificationModelMetadata(properties) { + if (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 VideoClassificationModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.VideoClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoClassificationModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.VideoClassificationModelMetadata} VideoClassificationModelMetadata instance + */ + VideoClassificationModelMetadata.create = function create(properties) { + return new VideoClassificationModelMetadata(properties); + }; + + /** + * Encodes the specified VideoClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.VideoClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoClassificationModelMetadata} message VideoClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoClassificationModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VideoClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoClassificationModelMetadata} message VideoClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoClassificationModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoClassificationModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.VideoClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.VideoClassificationModelMetadata} VideoClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoClassificationModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.VideoClassificationModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.VideoClassificationModelMetadata} VideoClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoClassificationModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoClassificationModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.VideoClassificationModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoClassificationModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VideoClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.VideoClassificationModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.VideoClassificationModelMetadata} VideoClassificationModelMetadata + */ + VideoClassificationModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.VideoClassificationModelMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.VideoClassificationModelMetadata(); + }; + + /** + * Creates a plain object from a VideoClassificationModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.VideoClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.VideoClassificationModelMetadata} message VideoClassificationModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoClassificationModelMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VideoClassificationModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.VideoClassificationModelMetadata + * @instance + * @returns {Object.} JSON object + */ + VideoClassificationModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoClassificationModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.VideoClassificationModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoClassificationModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.VideoClassificationModelMetadata"; + }; + + return VideoClassificationModelMetadata; + })(); + + v1beta1.VideoObjectTrackingModelMetadata = (function() { + + /** + * Properties of a VideoObjectTrackingModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IVideoObjectTrackingModelMetadata + */ + + /** + * Constructs a new VideoObjectTrackingModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a VideoObjectTrackingModelMetadata. + * @implements IVideoObjectTrackingModelMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata=} [properties] Properties to set + */ + function VideoObjectTrackingModelMetadata(properties) { + if (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 VideoObjectTrackingModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata} VideoObjectTrackingModelMetadata instance + */ + VideoObjectTrackingModelMetadata.create = function create(properties) { + return new VideoObjectTrackingModelMetadata(properties); + }; + + /** + * Encodes the specified VideoObjectTrackingModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata} message VideoObjectTrackingModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoObjectTrackingModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VideoObjectTrackingModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata} message VideoObjectTrackingModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoObjectTrackingModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoObjectTrackingModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata} VideoObjectTrackingModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoObjectTrackingModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoObjectTrackingModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata} VideoObjectTrackingModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoObjectTrackingModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoObjectTrackingModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoObjectTrackingModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VideoObjectTrackingModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata} VideoObjectTrackingModelMetadata + */ + VideoObjectTrackingModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata(); + }; + + /** + * Creates a plain object from a VideoObjectTrackingModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata} message VideoObjectTrackingModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoObjectTrackingModelMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VideoObjectTrackingModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata + * @instance + * @returns {Object.} JSON object + */ + VideoObjectTrackingModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoObjectTrackingModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoObjectTrackingModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata"; + }; + + return VideoObjectTrackingModelMetadata; + })(); + + v1beta1.Model = (function() { + + /** + * Properties of a Model. + * @memberof google.cloud.automl.v1beta1 + * @interface IModel + * @property {google.cloud.automl.v1beta1.ITranslationModelMetadata|null} [translationModelMetadata] Model translationModelMetadata + * @property {google.cloud.automl.v1beta1.IImageClassificationModelMetadata|null} [imageClassificationModelMetadata] Model imageClassificationModelMetadata + * @property {google.cloud.automl.v1beta1.ITextClassificationModelMetadata|null} [textClassificationModelMetadata] Model textClassificationModelMetadata + * @property {google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata|null} [imageObjectDetectionModelMetadata] Model imageObjectDetectionModelMetadata + * @property {google.cloud.automl.v1beta1.IVideoClassificationModelMetadata|null} [videoClassificationModelMetadata] Model videoClassificationModelMetadata + * @property {google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata|null} [videoObjectTrackingModelMetadata] Model videoObjectTrackingModelMetadata + * @property {google.cloud.automl.v1beta1.ITextExtractionModelMetadata|null} [textExtractionModelMetadata] Model textExtractionModelMetadata + * @property {google.cloud.automl.v1beta1.ITablesModelMetadata|null} [tablesModelMetadata] Model tablesModelMetadata + * @property {google.cloud.automl.v1beta1.ITextSentimentModelMetadata|null} [textSentimentModelMetadata] Model textSentimentModelMetadata + * @property {string|null} [name] Model name + * @property {string|null} [displayName] Model displayName + * @property {string|null} [datasetId] Model datasetId + * @property {google.protobuf.ITimestamp|null} [createTime] Model createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Model updateTime + * @property {google.cloud.automl.v1beta1.Model.DeploymentState|null} [deploymentState] Model deploymentState + */ + + /** + * Constructs a new Model. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a Model. + * @implements IModel + * @constructor + * @param {google.cloud.automl.v1beta1.IModel=} [properties] Properties to set + */ + function Model(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Model translationModelMetadata. + * @member {google.cloud.automl.v1beta1.ITranslationModelMetadata|null|undefined} translationModelMetadata + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.translationModelMetadata = null; + + /** + * Model imageClassificationModelMetadata. + * @member {google.cloud.automl.v1beta1.IImageClassificationModelMetadata|null|undefined} imageClassificationModelMetadata + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.imageClassificationModelMetadata = null; + + /** + * Model textClassificationModelMetadata. + * @member {google.cloud.automl.v1beta1.ITextClassificationModelMetadata|null|undefined} textClassificationModelMetadata + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.textClassificationModelMetadata = null; + + /** + * Model imageObjectDetectionModelMetadata. + * @member {google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata|null|undefined} imageObjectDetectionModelMetadata + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.imageObjectDetectionModelMetadata = null; + + /** + * Model videoClassificationModelMetadata. + * @member {google.cloud.automl.v1beta1.IVideoClassificationModelMetadata|null|undefined} videoClassificationModelMetadata + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.videoClassificationModelMetadata = null; + + /** + * Model videoObjectTrackingModelMetadata. + * @member {google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata|null|undefined} videoObjectTrackingModelMetadata + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.videoObjectTrackingModelMetadata = null; + + /** + * Model textExtractionModelMetadata. + * @member {google.cloud.automl.v1beta1.ITextExtractionModelMetadata|null|undefined} textExtractionModelMetadata + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.textExtractionModelMetadata = null; + + /** + * Model tablesModelMetadata. + * @member {google.cloud.automl.v1beta1.ITablesModelMetadata|null|undefined} tablesModelMetadata + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.tablesModelMetadata = null; + + /** + * Model textSentimentModelMetadata. + * @member {google.cloud.automl.v1beta1.ITextSentimentModelMetadata|null|undefined} textSentimentModelMetadata + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.textSentimentModelMetadata = null; + + /** + * Model name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.name = ""; + + /** + * Model displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.displayName = ""; + + /** + * Model datasetId. + * @member {string} datasetId + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.datasetId = ""; + + /** + * Model createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.createTime = null; + + /** + * Model updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.updateTime = null; + + /** + * Model deploymentState. + * @member {google.cloud.automl.v1beta1.Model.DeploymentState} deploymentState + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.deploymentState = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Model modelMetadata. + * @member {"translationModelMetadata"|"imageClassificationModelMetadata"|"textClassificationModelMetadata"|"imageObjectDetectionModelMetadata"|"videoClassificationModelMetadata"|"videoObjectTrackingModelMetadata"|"textExtractionModelMetadata"|"tablesModelMetadata"|"textSentimentModelMetadata"|undefined} modelMetadata + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Object.defineProperty(Model.prototype, "modelMetadata", { + get: $util.oneOfGetter($oneOfFields = ["translationModelMetadata", "imageClassificationModelMetadata", "textClassificationModelMetadata", "imageObjectDetectionModelMetadata", "videoClassificationModelMetadata", "videoObjectTrackingModelMetadata", "textExtractionModelMetadata", "tablesModelMetadata", "textSentimentModelMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Model instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.Model + * @static + * @param {google.cloud.automl.v1beta1.IModel=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.Model} Model instance + */ + Model.create = function create(properties) { + return new Model(properties); + }; + + /** + * Encodes the specified Model message. Does not implicitly {@link google.cloud.automl.v1beta1.Model.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.Model + * @static + * @param {google.cloud.automl.v1beta1.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.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.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.datasetId); + 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.deploymentState != null && Object.hasOwnProperty.call(message, "deploymentState")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.deploymentState); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.imageClassificationModelMetadata != null && Object.hasOwnProperty.call(message, "imageClassificationModelMetadata")) + $root.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.encode(message.imageClassificationModelMetadata, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.textClassificationModelMetadata != null && Object.hasOwnProperty.call(message, "textClassificationModelMetadata")) + $root.google.cloud.automl.v1beta1.TextClassificationModelMetadata.encode(message.textClassificationModelMetadata, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.translationModelMetadata != null && Object.hasOwnProperty.call(message, "translationModelMetadata")) + $root.google.cloud.automl.v1beta1.TranslationModelMetadata.encode(message.translationModelMetadata, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.textExtractionModelMetadata != null && Object.hasOwnProperty.call(message, "textExtractionModelMetadata")) + $root.google.cloud.automl.v1beta1.TextExtractionModelMetadata.encode(message.textExtractionModelMetadata, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.imageObjectDetectionModelMetadata != null && Object.hasOwnProperty.call(message, "imageObjectDetectionModelMetadata")) + $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.encode(message.imageObjectDetectionModelMetadata, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.videoObjectTrackingModelMetadata != null && Object.hasOwnProperty.call(message, "videoObjectTrackingModelMetadata")) + $root.google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata.encode(message.videoObjectTrackingModelMetadata, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.textSentimentModelMetadata != null && Object.hasOwnProperty.call(message, "textSentimentModelMetadata")) + $root.google.cloud.automl.v1beta1.TextSentimentModelMetadata.encode(message.textSentimentModelMetadata, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.videoClassificationModelMetadata != null && Object.hasOwnProperty.call(message, "videoClassificationModelMetadata")) + $root.google.cloud.automl.v1beta1.VideoClassificationModelMetadata.encode(message.videoClassificationModelMetadata, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.tablesModelMetadata != null && Object.hasOwnProperty.call(message, "tablesModelMetadata")) + $root.google.cloud.automl.v1beta1.TablesModelMetadata.encode(message.tablesModelMetadata, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Model.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.Model + * @static + * @param {google.cloud.automl.v1beta1.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Model message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.Model(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 15: { + message.translationModelMetadata = $root.google.cloud.automl.v1beta1.TranslationModelMetadata.decode(reader, reader.uint32()); + break; + } + case 13: { + message.imageClassificationModelMetadata = $root.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.decode(reader, reader.uint32()); + break; + } + case 14: { + message.textClassificationModelMetadata = $root.google.cloud.automl.v1beta1.TextClassificationModelMetadata.decode(reader, reader.uint32()); + break; + } + case 20: { + message.imageObjectDetectionModelMetadata = $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.decode(reader, reader.uint32()); + break; + } + case 23: { + message.videoClassificationModelMetadata = $root.google.cloud.automl.v1beta1.VideoClassificationModelMetadata.decode(reader, reader.uint32()); + break; + } + case 21: { + message.videoObjectTrackingModelMetadata = $root.google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata.decode(reader, reader.uint32()); + break; + } + case 19: { + message.textExtractionModelMetadata = $root.google.cloud.automl.v1beta1.TextExtractionModelMetadata.decode(reader, reader.uint32()); + break; + } + case 24: { + message.tablesModelMetadata = $root.google.cloud.automl.v1beta1.TablesModelMetadata.decode(reader, reader.uint32()); + break; + } + case 22: { + message.textSentimentModelMetadata = $root.google.cloud.automl.v1beta1.TextSentimentModelMetadata.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.datasetId = reader.string(); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.deploymentState = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Model message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Model message. + * @function verify + * @memberof google.cloud.automl.v1beta1.Model + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Model.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.translationModelMetadata != null && message.hasOwnProperty("translationModelMetadata")) { + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.TranslationModelMetadata.verify(message.translationModelMetadata); + if (error) + return "translationModelMetadata." + error; + } + } + if (message.imageClassificationModelMetadata != null && message.hasOwnProperty("imageClassificationModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.verify(message.imageClassificationModelMetadata); + if (error) + return "imageClassificationModelMetadata." + error; + } + } + if (message.textClassificationModelMetadata != null && message.hasOwnProperty("textClassificationModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextClassificationModelMetadata.verify(message.textClassificationModelMetadata); + if (error) + return "textClassificationModelMetadata." + error; + } + } + if (message.imageObjectDetectionModelMetadata != null && message.hasOwnProperty("imageObjectDetectionModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.verify(message.imageObjectDetectionModelMetadata); + if (error) + return "imageObjectDetectionModelMetadata." + error; + } + } + if (message.videoClassificationModelMetadata != null && message.hasOwnProperty("videoClassificationModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.VideoClassificationModelMetadata.verify(message.videoClassificationModelMetadata); + if (error) + return "videoClassificationModelMetadata." + error; + } + } + if (message.videoObjectTrackingModelMetadata != null && message.hasOwnProperty("videoObjectTrackingModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata.verify(message.videoObjectTrackingModelMetadata); + if (error) + return "videoObjectTrackingModelMetadata." + error; + } + } + if (message.textExtractionModelMetadata != null && message.hasOwnProperty("textExtractionModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextExtractionModelMetadata.verify(message.textExtractionModelMetadata); + if (error) + return "textExtractionModelMetadata." + error; + } + } + if (message.tablesModelMetadata != null && message.hasOwnProperty("tablesModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.TablesModelMetadata.verify(message.tablesModelMetadata); + if (error) + return "tablesModelMetadata." + error; + } + } + if (message.textSentimentModelMetadata != null && message.hasOwnProperty("textSentimentModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextSentimentModelMetadata.verify(message.textSentimentModelMetadata); + if (error) + return "textSentimentModelMetadata." + error; + } + } + 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.datasetId != null && message.hasOwnProperty("datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: 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.deploymentState != null && message.hasOwnProperty("deploymentState")) + switch (message.deploymentState) { + default: + return "deploymentState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a Model message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.Model + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.Model} Model + */ + Model.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.Model) + return object; + var message = new $root.google.cloud.automl.v1beta1.Model(); + if (object.translationModelMetadata != null) { + if (typeof object.translationModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Model.translationModelMetadata: object expected"); + message.translationModelMetadata = $root.google.cloud.automl.v1beta1.TranslationModelMetadata.fromObject(object.translationModelMetadata); + } + if (object.imageClassificationModelMetadata != null) { + if (typeof object.imageClassificationModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Model.imageClassificationModelMetadata: object expected"); + message.imageClassificationModelMetadata = $root.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.fromObject(object.imageClassificationModelMetadata); + } + if (object.textClassificationModelMetadata != null) { + if (typeof object.textClassificationModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Model.textClassificationModelMetadata: object expected"); + message.textClassificationModelMetadata = $root.google.cloud.automl.v1beta1.TextClassificationModelMetadata.fromObject(object.textClassificationModelMetadata); + } + if (object.imageObjectDetectionModelMetadata != null) { + if (typeof object.imageObjectDetectionModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Model.imageObjectDetectionModelMetadata: object expected"); + message.imageObjectDetectionModelMetadata = $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.fromObject(object.imageObjectDetectionModelMetadata); + } + if (object.videoClassificationModelMetadata != null) { + if (typeof object.videoClassificationModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Model.videoClassificationModelMetadata: object expected"); + message.videoClassificationModelMetadata = $root.google.cloud.automl.v1beta1.VideoClassificationModelMetadata.fromObject(object.videoClassificationModelMetadata); + } + if (object.videoObjectTrackingModelMetadata != null) { + if (typeof object.videoObjectTrackingModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Model.videoObjectTrackingModelMetadata: object expected"); + message.videoObjectTrackingModelMetadata = $root.google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata.fromObject(object.videoObjectTrackingModelMetadata); + } + if (object.textExtractionModelMetadata != null) { + if (typeof object.textExtractionModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Model.textExtractionModelMetadata: object expected"); + message.textExtractionModelMetadata = $root.google.cloud.automl.v1beta1.TextExtractionModelMetadata.fromObject(object.textExtractionModelMetadata); + } + if (object.tablesModelMetadata != null) { + if (typeof object.tablesModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Model.tablesModelMetadata: object expected"); + message.tablesModelMetadata = $root.google.cloud.automl.v1beta1.TablesModelMetadata.fromObject(object.tablesModelMetadata); + } + if (object.textSentimentModelMetadata != null) { + if (typeof object.textSentimentModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Model.textSentimentModelMetadata: object expected"); + message.textSentimentModelMetadata = $root.google.cloud.automl.v1beta1.TextSentimentModelMetadata.fromObject(object.textSentimentModelMetadata); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Model.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.automl.v1beta1.Model.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.deploymentState) { + default: + if (typeof object.deploymentState === "number") { + message.deploymentState = object.deploymentState; + break; + } + break; + case "DEPLOYMENT_STATE_UNSPECIFIED": + case 0: + message.deploymentState = 0; + break; + case "DEPLOYED": + case 1: + message.deploymentState = 1; + break; + case "UNDEPLOYED": + case 2: + message.deploymentState = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a Model message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.Model + * @static + * @param {google.cloud.automl.v1beta1.Model} message Model + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Model.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.datasetId = ""; + object.createTime = null; + object.deploymentState = options.enums === String ? "DEPLOYMENT_STATE_UNSPECIFIED" : 0; + object.updateTime = 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.datasetId != null && message.hasOwnProperty("datasetId")) + object.datasetId = message.datasetId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.deploymentState != null && message.hasOwnProperty("deploymentState")) + object.deploymentState = options.enums === String ? $root.google.cloud.automl.v1beta1.Model.DeploymentState[message.deploymentState] === undefined ? message.deploymentState : $root.google.cloud.automl.v1beta1.Model.DeploymentState[message.deploymentState] : message.deploymentState; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.imageClassificationModelMetadata != null && message.hasOwnProperty("imageClassificationModelMetadata")) { + object.imageClassificationModelMetadata = $root.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.toObject(message.imageClassificationModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "imageClassificationModelMetadata"; + } + if (message.textClassificationModelMetadata != null && message.hasOwnProperty("textClassificationModelMetadata")) { + object.textClassificationModelMetadata = $root.google.cloud.automl.v1beta1.TextClassificationModelMetadata.toObject(message.textClassificationModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "textClassificationModelMetadata"; + } + if (message.translationModelMetadata != null && message.hasOwnProperty("translationModelMetadata")) { + object.translationModelMetadata = $root.google.cloud.automl.v1beta1.TranslationModelMetadata.toObject(message.translationModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "translationModelMetadata"; + } + if (message.textExtractionModelMetadata != null && message.hasOwnProperty("textExtractionModelMetadata")) { + object.textExtractionModelMetadata = $root.google.cloud.automl.v1beta1.TextExtractionModelMetadata.toObject(message.textExtractionModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "textExtractionModelMetadata"; + } + if (message.imageObjectDetectionModelMetadata != null && message.hasOwnProperty("imageObjectDetectionModelMetadata")) { + object.imageObjectDetectionModelMetadata = $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.toObject(message.imageObjectDetectionModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "imageObjectDetectionModelMetadata"; + } + if (message.videoObjectTrackingModelMetadata != null && message.hasOwnProperty("videoObjectTrackingModelMetadata")) { + object.videoObjectTrackingModelMetadata = $root.google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata.toObject(message.videoObjectTrackingModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "videoObjectTrackingModelMetadata"; + } + if (message.textSentimentModelMetadata != null && message.hasOwnProperty("textSentimentModelMetadata")) { + object.textSentimentModelMetadata = $root.google.cloud.automl.v1beta1.TextSentimentModelMetadata.toObject(message.textSentimentModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "textSentimentModelMetadata"; + } + if (message.videoClassificationModelMetadata != null && message.hasOwnProperty("videoClassificationModelMetadata")) { + object.videoClassificationModelMetadata = $root.google.cloud.automl.v1beta1.VideoClassificationModelMetadata.toObject(message.videoClassificationModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "videoClassificationModelMetadata"; + } + if (message.tablesModelMetadata != null && message.hasOwnProperty("tablesModelMetadata")) { + object.tablesModelMetadata = $root.google.cloud.automl.v1beta1.TablesModelMetadata.toObject(message.tablesModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "tablesModelMetadata"; + } + return object; + }; + + /** + * Converts this Model to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.Model + * @instance + * @returns {Object.} JSON object + */ + Model.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Model + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.Model + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.Model"; + }; + + /** + * DeploymentState enum. + * @name google.cloud.automl.v1beta1.Model.DeploymentState + * @enum {number} + * @property {number} DEPLOYMENT_STATE_UNSPECIFIED=0 DEPLOYMENT_STATE_UNSPECIFIED value + * @property {number} DEPLOYED=1 DEPLOYED value + * @property {number} UNDEPLOYED=2 UNDEPLOYED value + */ + Model.DeploymentState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEPLOYMENT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEPLOYED"] = 1; + values[valuesById[2] = "UNDEPLOYED"] = 2; + return values; + })(); + + return Model; + })(); + + v1beta1.ModelEvaluation = (function() { + + /** + * Properties of a ModelEvaluation. + * @memberof google.cloud.automl.v1beta1 + * @interface IModelEvaluation + * @property {google.cloud.automl.v1beta1.IClassificationEvaluationMetrics|null} [classificationEvaluationMetrics] ModelEvaluation classificationEvaluationMetrics + * @property {google.cloud.automl.v1beta1.IRegressionEvaluationMetrics|null} [regressionEvaluationMetrics] ModelEvaluation regressionEvaluationMetrics + * @property {google.cloud.automl.v1beta1.ITranslationEvaluationMetrics|null} [translationEvaluationMetrics] ModelEvaluation translationEvaluationMetrics + * @property {google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics|null} [imageObjectDetectionEvaluationMetrics] ModelEvaluation imageObjectDetectionEvaluationMetrics + * @property {google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics|null} [videoObjectTrackingEvaluationMetrics] ModelEvaluation videoObjectTrackingEvaluationMetrics + * @property {google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics|null} [textSentimentEvaluationMetrics] ModelEvaluation textSentimentEvaluationMetrics + * @property {google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics|null} [textExtractionEvaluationMetrics] ModelEvaluation textExtractionEvaluationMetrics + * @property {string|null} [name] ModelEvaluation name + * @property {string|null} [annotationSpecId] ModelEvaluation annotationSpecId + * @property {string|null} [displayName] ModelEvaluation displayName + * @property {google.protobuf.ITimestamp|null} [createTime] ModelEvaluation createTime + * @property {number|null} [evaluatedExampleCount] ModelEvaluation evaluatedExampleCount + */ + + /** + * Constructs a new ModelEvaluation. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ModelEvaluation. + * @implements IModelEvaluation + * @constructor + * @param {google.cloud.automl.v1beta1.IModelEvaluation=} [properties] Properties to set + */ + function ModelEvaluation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelEvaluation classificationEvaluationMetrics. + * @member {google.cloud.automl.v1beta1.IClassificationEvaluationMetrics|null|undefined} classificationEvaluationMetrics + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.classificationEvaluationMetrics = null; + + /** + * ModelEvaluation regressionEvaluationMetrics. + * @member {google.cloud.automl.v1beta1.IRegressionEvaluationMetrics|null|undefined} regressionEvaluationMetrics + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.regressionEvaluationMetrics = null; + + /** + * ModelEvaluation translationEvaluationMetrics. + * @member {google.cloud.automl.v1beta1.ITranslationEvaluationMetrics|null|undefined} translationEvaluationMetrics + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.translationEvaluationMetrics = null; + + /** + * ModelEvaluation imageObjectDetectionEvaluationMetrics. + * @member {google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics|null|undefined} imageObjectDetectionEvaluationMetrics + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.imageObjectDetectionEvaluationMetrics = null; + + /** + * ModelEvaluation videoObjectTrackingEvaluationMetrics. + * @member {google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics|null|undefined} videoObjectTrackingEvaluationMetrics + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.videoObjectTrackingEvaluationMetrics = null; + + /** + * ModelEvaluation textSentimentEvaluationMetrics. + * @member {google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics|null|undefined} textSentimentEvaluationMetrics + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.textSentimentEvaluationMetrics = null; + + /** + * ModelEvaluation textExtractionEvaluationMetrics. + * @member {google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics|null|undefined} textExtractionEvaluationMetrics + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.textExtractionEvaluationMetrics = null; + + /** + * ModelEvaluation name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.name = ""; + + /** + * ModelEvaluation annotationSpecId. + * @member {string} annotationSpecId + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.annotationSpecId = ""; + + /** + * ModelEvaluation displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.displayName = ""; + + /** + * ModelEvaluation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.createTime = null; + + /** + * ModelEvaluation evaluatedExampleCount. + * @member {number} evaluatedExampleCount + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.evaluatedExampleCount = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ModelEvaluation metrics. + * @member {"classificationEvaluationMetrics"|"regressionEvaluationMetrics"|"translationEvaluationMetrics"|"imageObjectDetectionEvaluationMetrics"|"videoObjectTrackingEvaluationMetrics"|"textSentimentEvaluationMetrics"|"textExtractionEvaluationMetrics"|undefined} metrics + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + Object.defineProperty(ModelEvaluation.prototype, "metrics", { + get: $util.oneOfGetter($oneOfFields = ["classificationEvaluationMetrics", "regressionEvaluationMetrics", "translationEvaluationMetrics", "imageObjectDetectionEvaluationMetrics", "videoObjectTrackingEvaluationMetrics", "textSentimentEvaluationMetrics", "textExtractionEvaluationMetrics"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ModelEvaluation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @static + * @param {google.cloud.automl.v1beta1.IModelEvaluation=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ModelEvaluation} ModelEvaluation instance + */ + ModelEvaluation.create = function create(properties) { + return new ModelEvaluation(properties); + }; + + /** + * Encodes the specified ModelEvaluation message. Does not implicitly {@link google.cloud.automl.v1beta1.ModelEvaluation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @static + * @param {google.cloud.automl.v1beta1.IModelEvaluation} message ModelEvaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelEvaluation.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.annotationSpecId != null && Object.hasOwnProperty.call(message, "annotationSpecId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.annotationSpecId); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.evaluatedExampleCount != null && Object.hasOwnProperty.call(message, "evaluatedExampleCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.evaluatedExampleCount); + if (message.classificationEvaluationMetrics != null && Object.hasOwnProperty.call(message, "classificationEvaluationMetrics")) + $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.encode(message.classificationEvaluationMetrics, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.translationEvaluationMetrics != null && Object.hasOwnProperty.call(message, "translationEvaluationMetrics")) + $root.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.encode(message.translationEvaluationMetrics, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.textSentimentEvaluationMetrics != null && Object.hasOwnProperty.call(message, "textSentimentEvaluationMetrics")) + $root.google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.encode(message.textSentimentEvaluationMetrics, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.imageObjectDetectionEvaluationMetrics != null && Object.hasOwnProperty.call(message, "imageObjectDetectionEvaluationMetrics")) + $root.google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.encode(message.imageObjectDetectionEvaluationMetrics, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.textExtractionEvaluationMetrics != null && Object.hasOwnProperty.call(message, "textExtractionEvaluationMetrics")) + $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.encode(message.textExtractionEvaluationMetrics, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.videoObjectTrackingEvaluationMetrics != null && Object.hasOwnProperty.call(message, "videoObjectTrackingEvaluationMetrics")) + $root.google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.encode(message.videoObjectTrackingEvaluationMetrics, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.displayName); + if (message.regressionEvaluationMetrics != null && Object.hasOwnProperty.call(message, "regressionEvaluationMetrics")) + $root.google.cloud.automl.v1beta1.RegressionEvaluationMetrics.encode(message.regressionEvaluationMetrics, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModelEvaluation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ModelEvaluation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @static + * @param {google.cloud.automl.v1beta1.IModelEvaluation} message ModelEvaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelEvaluation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ModelEvaluation} ModelEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelEvaluation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ModelEvaluation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + message.classificationEvaluationMetrics = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 24: { + message.regressionEvaluationMetrics = $root.google.cloud.automl.v1beta1.RegressionEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 9: { + message.translationEvaluationMetrics = $root.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 12: { + message.imageObjectDetectionEvaluationMetrics = $root.google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 14: { + message.videoObjectTrackingEvaluationMetrics = $root.google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 11: { + message.textSentimentEvaluationMetrics = $root.google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 13: { + message.textExtractionEvaluationMetrics = $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.annotationSpecId = reader.string(); + break; + } + case 15: { + message.displayName = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.evaluatedExampleCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ModelEvaluation} ModelEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelEvaluation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelEvaluation message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelEvaluation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.classificationEvaluationMetrics != null && message.hasOwnProperty("classificationEvaluationMetrics")) { + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.verify(message.classificationEvaluationMetrics); + if (error) + return "classificationEvaluationMetrics." + error; + } + } + if (message.regressionEvaluationMetrics != null && message.hasOwnProperty("regressionEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1beta1.RegressionEvaluationMetrics.verify(message.regressionEvaluationMetrics); + if (error) + return "regressionEvaluationMetrics." + error; + } + } + if (message.translationEvaluationMetrics != null && message.hasOwnProperty("translationEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.verify(message.translationEvaluationMetrics); + if (error) + return "translationEvaluationMetrics." + error; + } + } + if (message.imageObjectDetectionEvaluationMetrics != null && message.hasOwnProperty("imageObjectDetectionEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.verify(message.imageObjectDetectionEvaluationMetrics); + if (error) + return "imageObjectDetectionEvaluationMetrics." + error; + } + } + if (message.videoObjectTrackingEvaluationMetrics != null && message.hasOwnProperty("videoObjectTrackingEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.verify(message.videoObjectTrackingEvaluationMetrics); + if (error) + return "videoObjectTrackingEvaluationMetrics." + error; + } + } + if (message.textSentimentEvaluationMetrics != null && message.hasOwnProperty("textSentimentEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.verify(message.textSentimentEvaluationMetrics); + if (error) + return "textSentimentEvaluationMetrics." + error; + } + } + if (message.textExtractionEvaluationMetrics != null && message.hasOwnProperty("textExtractionEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.verify(message.textExtractionEvaluationMetrics); + if (error) + return "textExtractionEvaluationMetrics." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + if (!$util.isString(message.annotationSpecId)) + return "annotationSpecId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: 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.evaluatedExampleCount != null && message.hasOwnProperty("evaluatedExampleCount")) + if (!$util.isInteger(message.evaluatedExampleCount)) + return "evaluatedExampleCount: integer expected"; + return null; + }; + + /** + * Creates a ModelEvaluation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ModelEvaluation} ModelEvaluation + */ + ModelEvaluation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ModelEvaluation) + return object; + var message = new $root.google.cloud.automl.v1beta1.ModelEvaluation(); + if (object.classificationEvaluationMetrics != null) { + if (typeof object.classificationEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelEvaluation.classificationEvaluationMetrics: object expected"); + message.classificationEvaluationMetrics = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.fromObject(object.classificationEvaluationMetrics); + } + if (object.regressionEvaluationMetrics != null) { + if (typeof object.regressionEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelEvaluation.regressionEvaluationMetrics: object expected"); + message.regressionEvaluationMetrics = $root.google.cloud.automl.v1beta1.RegressionEvaluationMetrics.fromObject(object.regressionEvaluationMetrics); + } + if (object.translationEvaluationMetrics != null) { + if (typeof object.translationEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelEvaluation.translationEvaluationMetrics: object expected"); + message.translationEvaluationMetrics = $root.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.fromObject(object.translationEvaluationMetrics); + } + if (object.imageObjectDetectionEvaluationMetrics != null) { + if (typeof object.imageObjectDetectionEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelEvaluation.imageObjectDetectionEvaluationMetrics: object expected"); + message.imageObjectDetectionEvaluationMetrics = $root.google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.fromObject(object.imageObjectDetectionEvaluationMetrics); + } + if (object.videoObjectTrackingEvaluationMetrics != null) { + if (typeof object.videoObjectTrackingEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelEvaluation.videoObjectTrackingEvaluationMetrics: object expected"); + message.videoObjectTrackingEvaluationMetrics = $root.google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.fromObject(object.videoObjectTrackingEvaluationMetrics); + } + if (object.textSentimentEvaluationMetrics != null) { + if (typeof object.textSentimentEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelEvaluation.textSentimentEvaluationMetrics: object expected"); + message.textSentimentEvaluationMetrics = $root.google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.fromObject(object.textSentimentEvaluationMetrics); + } + if (object.textExtractionEvaluationMetrics != null) { + if (typeof object.textExtractionEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelEvaluation.textExtractionEvaluationMetrics: object expected"); + message.textExtractionEvaluationMetrics = $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.fromObject(object.textExtractionEvaluationMetrics); + } + if (object.name != null) + message.name = String(object.name); + if (object.annotationSpecId != null) + message.annotationSpecId = String(object.annotationSpecId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelEvaluation.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.evaluatedExampleCount != null) + message.evaluatedExampleCount = object.evaluatedExampleCount | 0; + return message; + }; + + /** + * Creates a plain object from a ModelEvaluation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @static + * @param {google.cloud.automl.v1beta1.ModelEvaluation} message ModelEvaluation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelEvaluation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.annotationSpecId = ""; + object.createTime = null; + object.evaluatedExampleCount = 0; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + object.annotationSpecId = message.annotationSpecId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.evaluatedExampleCount != null && message.hasOwnProperty("evaluatedExampleCount")) + object.evaluatedExampleCount = message.evaluatedExampleCount; + if (message.classificationEvaluationMetrics != null && message.hasOwnProperty("classificationEvaluationMetrics")) { + object.classificationEvaluationMetrics = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.toObject(message.classificationEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "classificationEvaluationMetrics"; + } + if (message.translationEvaluationMetrics != null && message.hasOwnProperty("translationEvaluationMetrics")) { + object.translationEvaluationMetrics = $root.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.toObject(message.translationEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "translationEvaluationMetrics"; + } + if (message.textSentimentEvaluationMetrics != null && message.hasOwnProperty("textSentimentEvaluationMetrics")) { + object.textSentimentEvaluationMetrics = $root.google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.toObject(message.textSentimentEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "textSentimentEvaluationMetrics"; + } + if (message.imageObjectDetectionEvaluationMetrics != null && message.hasOwnProperty("imageObjectDetectionEvaluationMetrics")) { + object.imageObjectDetectionEvaluationMetrics = $root.google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.toObject(message.imageObjectDetectionEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "imageObjectDetectionEvaluationMetrics"; + } + if (message.textExtractionEvaluationMetrics != null && message.hasOwnProperty("textExtractionEvaluationMetrics")) { + object.textExtractionEvaluationMetrics = $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.toObject(message.textExtractionEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "textExtractionEvaluationMetrics"; + } + if (message.videoObjectTrackingEvaluationMetrics != null && message.hasOwnProperty("videoObjectTrackingEvaluationMetrics")) { + object.videoObjectTrackingEvaluationMetrics = $root.google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.toObject(message.videoObjectTrackingEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "videoObjectTrackingEvaluationMetrics"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.regressionEvaluationMetrics != null && message.hasOwnProperty("regressionEvaluationMetrics")) { + object.regressionEvaluationMetrics = $root.google.cloud.automl.v1beta1.RegressionEvaluationMetrics.toObject(message.regressionEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "regressionEvaluationMetrics"; + } + return object; + }; + + /** + * Converts this ModelEvaluation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + * @returns {Object.} JSON object + */ + ModelEvaluation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelEvaluation + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelEvaluation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ModelEvaluation"; + }; + + return ModelEvaluation; + })(); + + v1beta1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IOperationMetadata + * @property {google.cloud.automl.v1beta1.IDeleteOperationMetadata|null} [deleteDetails] OperationMetadata deleteDetails + * @property {google.cloud.automl.v1beta1.IDeployModelOperationMetadata|null} [deployModelDetails] OperationMetadata deployModelDetails + * @property {google.cloud.automl.v1beta1.IUndeployModelOperationMetadata|null} [undeployModelDetails] OperationMetadata undeployModelDetails + * @property {google.cloud.automl.v1beta1.ICreateModelOperationMetadata|null} [createModelDetails] OperationMetadata createModelDetails + * @property {google.cloud.automl.v1beta1.IImportDataOperationMetadata|null} [importDataDetails] OperationMetadata importDataDetails + * @property {google.cloud.automl.v1beta1.IBatchPredictOperationMetadata|null} [batchPredictDetails] OperationMetadata batchPredictDetails + * @property {google.cloud.automl.v1beta1.IExportDataOperationMetadata|null} [exportDataDetails] OperationMetadata exportDataDetails + * @property {google.cloud.automl.v1beta1.IExportModelOperationMetadata|null} [exportModelDetails] OperationMetadata exportModelDetails + * @property {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata|null} [exportEvaluatedExamplesDetails] OperationMetadata exportEvaluatedExamplesDetails + * @property {number|null} [progressPercent] OperationMetadata progressPercent + * @property {Array.|null} [partialFailures] OperationMetadata partialFailures + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] OperationMetadata updateTime + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(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]]; + } + + /** + * OperationMetadata deleteDetails. + * @member {google.cloud.automl.v1beta1.IDeleteOperationMetadata|null|undefined} deleteDetails + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.deleteDetails = null; + + /** + * OperationMetadata deployModelDetails. + * @member {google.cloud.automl.v1beta1.IDeployModelOperationMetadata|null|undefined} deployModelDetails + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.deployModelDetails = null; + + /** + * OperationMetadata undeployModelDetails. + * @member {google.cloud.automl.v1beta1.IUndeployModelOperationMetadata|null|undefined} undeployModelDetails + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.undeployModelDetails = null; + + /** + * OperationMetadata createModelDetails. + * @member {google.cloud.automl.v1beta1.ICreateModelOperationMetadata|null|undefined} createModelDetails + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createModelDetails = null; + + /** + * OperationMetadata importDataDetails. + * @member {google.cloud.automl.v1beta1.IImportDataOperationMetadata|null|undefined} importDataDetails + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.importDataDetails = null; + + /** + * OperationMetadata batchPredictDetails. + * @member {google.cloud.automl.v1beta1.IBatchPredictOperationMetadata|null|undefined} batchPredictDetails + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.batchPredictDetails = null; + + /** + * OperationMetadata exportDataDetails. + * @member {google.cloud.automl.v1beta1.IExportDataOperationMetadata|null|undefined} exportDataDetails + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.exportDataDetails = null; + + /** + * OperationMetadata exportModelDetails. + * @member {google.cloud.automl.v1beta1.IExportModelOperationMetadata|null|undefined} exportModelDetails + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.exportModelDetails = null; + + /** + * OperationMetadata exportEvaluatedExamplesDetails. + * @member {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata|null|undefined} exportEvaluatedExamplesDetails + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.exportEvaluatedExamplesDetails = null; + + /** + * OperationMetadata progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.progressPercent = 0; + + /** + * OperationMetadata partialFailures. + * @member {Array.} partialFailures + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.partialFailures = $util.emptyArray; + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.updateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OperationMetadata details. + * @member {"deleteDetails"|"deployModelDetails"|"undeployModelDetails"|"createModelDetails"|"importDataDetails"|"batchPredictDetails"|"exportDataDetails"|"exportModelDetails"|"exportEvaluatedExamplesDetails"|undefined} details + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + Object.defineProperty(OperationMetadata.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["deleteDetails", "deployModelDetails", "undeployModelDetails", "createModelDetails", "importDataDetails", "batchPredictDetails", "exportDataDetails", "exportModelDetails", "exportEvaluatedExamplesDetails"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.deleteDetails != null && Object.hasOwnProperty.call(message, "deleteDetails")) + $root.google.cloud.automl.v1beta1.DeleteOperationMetadata.encode(message.deleteDetails, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.createModelDetails != null && Object.hasOwnProperty.call(message, "createModelDetails")) + $root.google.cloud.automl.v1beta1.CreateModelOperationMetadata.encode(message.createModelDetails, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.progressPercent); + if (message.importDataDetails != null && Object.hasOwnProperty.call(message, "importDataDetails")) + $root.google.cloud.automl.v1beta1.ImportDataOperationMetadata.encode(message.importDataDetails, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.batchPredictDetails != null && Object.hasOwnProperty.call(message, "batchPredictDetails")) + $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.encode(message.batchPredictDetails, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.exportDataDetails != null && Object.hasOwnProperty.call(message, "exportDataDetails")) + $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.encode(message.exportDataDetails, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.exportModelDetails != null && Object.hasOwnProperty.call(message, "exportModelDetails")) + $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.encode(message.exportModelDetails, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.deployModelDetails != null && Object.hasOwnProperty.call(message, "deployModelDetails")) + $root.google.cloud.automl.v1beta1.DeployModelOperationMetadata.encode(message.deployModelDetails, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.undeployModelDetails != null && Object.hasOwnProperty.call(message, "undeployModelDetails")) + $root.google.cloud.automl.v1beta1.UndeployModelOperationMetadata.encode(message.undeployModelDetails, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.exportEvaluatedExamplesDetails != null && Object.hasOwnProperty.call(message, "exportEvaluatedExamplesDetails")) + $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.encode(message.exportEvaluatedExamplesDetails, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + message.deleteDetails = $root.google.cloud.automl.v1beta1.DeleteOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 24: { + message.deployModelDetails = $root.google.cloud.automl.v1beta1.DeployModelOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 25: { + message.undeployModelDetails = $root.google.cloud.automl.v1beta1.UndeployModelOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 10: { + message.createModelDetails = $root.google.cloud.automl.v1beta1.CreateModelOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 15: { + message.importDataDetails = $root.google.cloud.automl.v1beta1.ImportDataOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 16: { + message.batchPredictDetails = $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 21: { + message.exportDataDetails = $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 22: { + message.exportModelDetails = $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 26: { + message.exportEvaluatedExamplesDetails = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 13: { + 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 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.deleteDetails != null && message.hasOwnProperty("deleteDetails")) { + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.DeleteOperationMetadata.verify(message.deleteDetails); + if (error) + return "deleteDetails." + error; + } + } + if (message.deployModelDetails != null && message.hasOwnProperty("deployModelDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.DeployModelOperationMetadata.verify(message.deployModelDetails); + if (error) + return "deployModelDetails." + error; + } + } + if (message.undeployModelDetails != null && message.hasOwnProperty("undeployModelDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.UndeployModelOperationMetadata.verify(message.undeployModelDetails); + if (error) + return "undeployModelDetails." + error; + } + } + if (message.createModelDetails != null && message.hasOwnProperty("createModelDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.CreateModelOperationMetadata.verify(message.createModelDetails); + if (error) + return "createModelDetails." + error; + } + } + if (message.importDataDetails != null && message.hasOwnProperty("importDataDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.ImportDataOperationMetadata.verify(message.importDataDetails); + if (error) + return "importDataDetails." + error; + } + } + if (message.batchPredictDetails != null && message.hasOwnProperty("batchPredictDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.verify(message.batchPredictDetails); + if (error) + return "batchPredictDetails." + error; + } + } + if (message.exportDataDetails != null && message.hasOwnProperty("exportDataDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.verify(message.exportDataDetails); + if (error) + return "exportDataDetails." + error; + } + } + if (message.exportModelDetails != null && message.hasOwnProperty("exportModelDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.verify(message.exportModelDetails); + if (error) + return "exportModelDetails." + error; + } + } + if (message.exportEvaluatedExamplesDetails != null && message.hasOwnProperty("exportEvaluatedExamplesDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.verify(message.exportEvaluatedExamplesDetails); + if (error) + return "exportEvaluatedExamplesDetails." + 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; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.OperationMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.OperationMetadata(); + if (object.deleteDetails != null) { + if (typeof object.deleteDetails !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.deleteDetails: object expected"); + message.deleteDetails = $root.google.cloud.automl.v1beta1.DeleteOperationMetadata.fromObject(object.deleteDetails); + } + if (object.deployModelDetails != null) { + if (typeof object.deployModelDetails !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.deployModelDetails: object expected"); + message.deployModelDetails = $root.google.cloud.automl.v1beta1.DeployModelOperationMetadata.fromObject(object.deployModelDetails); + } + if (object.undeployModelDetails != null) { + if (typeof object.undeployModelDetails !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.undeployModelDetails: object expected"); + message.undeployModelDetails = $root.google.cloud.automl.v1beta1.UndeployModelOperationMetadata.fromObject(object.undeployModelDetails); + } + if (object.createModelDetails != null) { + if (typeof object.createModelDetails !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.createModelDetails: object expected"); + message.createModelDetails = $root.google.cloud.automl.v1beta1.CreateModelOperationMetadata.fromObject(object.createModelDetails); + } + if (object.importDataDetails != null) { + if (typeof object.importDataDetails !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.importDataDetails: object expected"); + message.importDataDetails = $root.google.cloud.automl.v1beta1.ImportDataOperationMetadata.fromObject(object.importDataDetails); + } + if (object.batchPredictDetails != null) { + if (typeof object.batchPredictDetails !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.batchPredictDetails: object expected"); + message.batchPredictDetails = $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.fromObject(object.batchPredictDetails); + } + if (object.exportDataDetails != null) { + if (typeof object.exportDataDetails !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.exportDataDetails: object expected"); + message.exportDataDetails = $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.fromObject(object.exportDataDetails); + } + if (object.exportModelDetails != null) { + if (typeof object.exportModelDetails !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.exportModelDetails: object expected"); + message.exportModelDetails = $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.fromObject(object.exportModelDetails); + } + if (object.exportEvaluatedExamplesDetails != null) { + if (typeof object.exportEvaluatedExamplesDetails !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.exportEvaluatedExamplesDetails: object expected"); + message.exportEvaluatedExamplesDetails = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.fromObject(object.exportEvaluatedExamplesDetails); + } + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.partialFailures) { + if (!Array.isArray(object.partialFailures)) + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.partialFailures: array expected"); + message.partialFailures = []; + for (var i = 0; i < object.partialFailures.length; ++i) { + if (typeof object.partialFailures[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.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.automl.v1beta1.OperationMetadata.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.automl.v1beta1.OperationMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.partialFailures = []; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + object.progressPercent = 0; + } + 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); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteDetails != null && message.hasOwnProperty("deleteDetails")) { + object.deleteDetails = $root.google.cloud.automl.v1beta1.DeleteOperationMetadata.toObject(message.deleteDetails, options); + if (options.oneofs) + object.details = "deleteDetails"; + } + if (message.createModelDetails != null && message.hasOwnProperty("createModelDetails")) { + object.createModelDetails = $root.google.cloud.automl.v1beta1.CreateModelOperationMetadata.toObject(message.createModelDetails, options); + if (options.oneofs) + object.details = "createModelDetails"; + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.importDataDetails != null && message.hasOwnProperty("importDataDetails")) { + object.importDataDetails = $root.google.cloud.automl.v1beta1.ImportDataOperationMetadata.toObject(message.importDataDetails, options); + if (options.oneofs) + object.details = "importDataDetails"; + } + if (message.batchPredictDetails != null && message.hasOwnProperty("batchPredictDetails")) { + object.batchPredictDetails = $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.toObject(message.batchPredictDetails, options); + if (options.oneofs) + object.details = "batchPredictDetails"; + } + if (message.exportDataDetails != null && message.hasOwnProperty("exportDataDetails")) { + object.exportDataDetails = $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.toObject(message.exportDataDetails, options); + if (options.oneofs) + object.details = "exportDataDetails"; + } + if (message.exportModelDetails != null && message.hasOwnProperty("exportModelDetails")) { + object.exportModelDetails = $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.toObject(message.exportModelDetails, options); + if (options.oneofs) + object.details = "exportModelDetails"; + } + if (message.deployModelDetails != null && message.hasOwnProperty("deployModelDetails")) { + object.deployModelDetails = $root.google.cloud.automl.v1beta1.DeployModelOperationMetadata.toObject(message.deployModelDetails, options); + if (options.oneofs) + object.details = "deployModelDetails"; + } + if (message.undeployModelDetails != null && message.hasOwnProperty("undeployModelDetails")) { + object.undeployModelDetails = $root.google.cloud.automl.v1beta1.UndeployModelOperationMetadata.toObject(message.undeployModelDetails, options); + if (options.oneofs) + object.details = "undeployModelDetails"; + } + if (message.exportEvaluatedExamplesDetails != null && message.hasOwnProperty("exportEvaluatedExamplesDetails")) { + object.exportEvaluatedExamplesDetails = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.toObject(message.exportEvaluatedExamplesDetails, options); + if (options.oneofs) + object.details = "exportEvaluatedExamplesDetails"; + } + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1beta1.DeleteOperationMetadata = (function() { + + /** + * Properties of a DeleteOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IDeleteOperationMetadata + */ + + /** + * Constructs a new DeleteOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a DeleteOperationMetadata. + * @implements IDeleteOperationMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IDeleteOperationMetadata=} [properties] Properties to set + */ + function DeleteOperationMetadata(properties) { + if (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 DeleteOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.DeleteOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IDeleteOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.DeleteOperationMetadata} DeleteOperationMetadata instance + */ + DeleteOperationMetadata.create = function create(properties) { + return new DeleteOperationMetadata(properties); + }; + + /** + * Encodes the specified DeleteOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.DeleteOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IDeleteOperationMetadata} message DeleteOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.DeleteOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IDeleteOperationMetadata} message DeleteOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.DeleteOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.DeleteOperationMetadata} DeleteOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.DeleteOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.DeleteOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.DeleteOperationMetadata} DeleteOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.DeleteOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.DeleteOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.DeleteOperationMetadata} DeleteOperationMetadata + */ + DeleteOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.DeleteOperationMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.DeleteOperationMetadata(); + }; + + /** + * Creates a plain object from a DeleteOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.DeleteOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.DeleteOperationMetadata} message DeleteOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.DeleteOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.DeleteOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.DeleteOperationMetadata"; + }; + + return DeleteOperationMetadata; + })(); + + v1beta1.DeployModelOperationMetadata = (function() { + + /** + * Properties of a DeployModelOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IDeployModelOperationMetadata + */ + + /** + * Constructs a new DeployModelOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a DeployModelOperationMetadata. + * @implements IDeployModelOperationMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IDeployModelOperationMetadata=} [properties] Properties to set + */ + function DeployModelOperationMetadata(properties) { + if (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 DeployModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.DeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IDeployModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.DeployModelOperationMetadata} DeployModelOperationMetadata instance + */ + DeployModelOperationMetadata.create = function create(properties) { + return new DeployModelOperationMetadata(properties); + }; + + /** + * Encodes the specified DeployModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.DeployModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.DeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IDeployModelOperationMetadata} message DeployModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeployModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DeployModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.DeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IDeployModelOperationMetadata} message DeployModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.DeployModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.DeployModelOperationMetadata} DeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployModelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.DeployModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.DeployModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.DeployModelOperationMetadata} DeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployModelOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.DeployModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeployModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.DeployModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.DeployModelOperationMetadata} DeployModelOperationMetadata + */ + DeployModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.DeployModelOperationMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.DeployModelOperationMetadata(); + }; + + /** + * Creates a plain object from a DeployModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.DeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.DeployModelOperationMetadata} message DeployModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployModelOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeployModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.DeployModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + DeployModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.DeployModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.DeployModelOperationMetadata"; + }; + + return DeployModelOperationMetadata; + })(); + + v1beta1.UndeployModelOperationMetadata = (function() { + + /** + * Properties of an UndeployModelOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IUndeployModelOperationMetadata + */ + + /** + * Constructs a new UndeployModelOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an UndeployModelOperationMetadata. + * @implements IUndeployModelOperationMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IUndeployModelOperationMetadata=} [properties] Properties to set + */ + function UndeployModelOperationMetadata(properties) { + if (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 UndeployModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.UndeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IUndeployModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.UndeployModelOperationMetadata} UndeployModelOperationMetadata instance + */ + UndeployModelOperationMetadata.create = function create(properties) { + return new UndeployModelOperationMetadata(properties); + }; + + /** + * Encodes the specified UndeployModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.UndeployModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.UndeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IUndeployModelOperationMetadata} message UndeployModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UndeployModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.UndeployModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.UndeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IUndeployModelOperationMetadata} message UndeployModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeployModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.UndeployModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.UndeployModelOperationMetadata} UndeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployModelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.UndeployModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeployModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.UndeployModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.UndeployModelOperationMetadata} UndeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeployModelOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.UndeployModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeployModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UndeployModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.UndeployModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.UndeployModelOperationMetadata} UndeployModelOperationMetadata + */ + UndeployModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.UndeployModelOperationMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.UndeployModelOperationMetadata(); + }; + + /** + * Creates a plain object from an UndeployModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.UndeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.UndeployModelOperationMetadata} message UndeployModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeployModelOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UndeployModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.UndeployModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + UndeployModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeployModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.UndeployModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeployModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.UndeployModelOperationMetadata"; + }; + + return UndeployModelOperationMetadata; + })(); + + v1beta1.CreateModelOperationMetadata = (function() { + + /** + * Properties of a CreateModelOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ICreateModelOperationMetadata + */ + + /** + * Constructs a new CreateModelOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a CreateModelOperationMetadata. + * @implements ICreateModelOperationMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ICreateModelOperationMetadata=} [properties] Properties to set + */ + function CreateModelOperationMetadata(properties) { + if (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 CreateModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.CreateModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.ICreateModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.CreateModelOperationMetadata} CreateModelOperationMetadata instance + */ + CreateModelOperationMetadata.create = function create(properties) { + return new CreateModelOperationMetadata(properties); + }; + + /** + * Encodes the specified CreateModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.CreateModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.CreateModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.ICreateModelOperationMetadata} message CreateModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CreateModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CreateModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.CreateModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.ICreateModelOperationMetadata} message CreateModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.CreateModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.CreateModelOperationMetadata} CreateModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateModelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.CreateModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.CreateModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.CreateModelOperationMetadata} CreateModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateModelOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.CreateModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CreateModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.CreateModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.CreateModelOperationMetadata} CreateModelOperationMetadata + */ + CreateModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.CreateModelOperationMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.CreateModelOperationMetadata(); + }; + + /** + * Creates a plain object from a CreateModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.CreateModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.CreateModelOperationMetadata} message CreateModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateModelOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CreateModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.CreateModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.CreateModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.CreateModelOperationMetadata"; + }; + + return CreateModelOperationMetadata; + })(); + + v1beta1.ImportDataOperationMetadata = (function() { + + /** + * Properties of an ImportDataOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IImportDataOperationMetadata + */ + + /** + * Constructs a new ImportDataOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ImportDataOperationMetadata. + * @implements IImportDataOperationMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IImportDataOperationMetadata=} [properties] Properties to set + */ + function ImportDataOperationMetadata(properties) { + if (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 ImportDataOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ImportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImportDataOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ImportDataOperationMetadata} ImportDataOperationMetadata instance + */ + ImportDataOperationMetadata.create = function create(properties) { + return new ImportDataOperationMetadata(properties); + }; + + /** + * Encodes the specified ImportDataOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImportDataOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ImportDataOperationMetadata + * @static + * @param {google.cloud.automl.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(); + return writer; + }; + + /** + * Encodes the specified ImportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImportDataOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ImportDataOperationMetadata + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.ImportDataOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + 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.automl.v1beta1.ImportDataOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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"; + return null; + }; + + /** + * Creates an ImportDataOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ImportDataOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ImportDataOperationMetadata} ImportDataOperationMetadata + */ + ImportDataOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ImportDataOperationMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.ImportDataOperationMetadata(); + }; + + /** + * Creates a plain object from an ImportDataOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ImportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.ImportDataOperationMetadata} message ImportDataOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDataOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ImportDataOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.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.automl.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.automl.v1beta1.ImportDataOperationMetadata"; + }; + + return ImportDataOperationMetadata; + })(); + + v1beta1.ExportDataOperationMetadata = (function() { + + /** + * Properties of an ExportDataOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IExportDataOperationMetadata + * @property {google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo|null} [outputInfo] ExportDataOperationMetadata outputInfo + */ + + /** + * Constructs a new ExportDataOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ExportDataOperationMetadata. + * @implements IExportDataOperationMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IExportDataOperationMetadata=} [properties] Properties to set + */ + function ExportDataOperationMetadata(properties) { + if (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 outputInfo. + * @member {google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo|null|undefined} outputInfo + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @instance + */ + ExportDataOperationMetadata.prototype.outputInfo = null; + + /** + * Creates a new ExportDataOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IExportDataOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExportDataOperationMetadata} ExportDataOperationMetadata instance + */ + ExportDataOperationMetadata.create = function create(properties) { + return new ExportDataOperationMetadata(properties); + }; + + /** + * Encodes the specified ExportDataOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportDataOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @static + * @param {google.cloud.automl.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.outputInfo != null && Object.hasOwnProperty.call(message, "outputInfo")) + $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.encode(message.outputInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportDataOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.ExportDataOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.outputInfo = $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.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.automl.v1beta1.ExportDataOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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.outputInfo != null && message.hasOwnProperty("outputInfo")) { + var error = $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.verify(message.outputInfo); + if (error) + return "outputInfo." + error; + } + return null; + }; + + /** + * Creates an ExportDataOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExportDataOperationMetadata} ExportDataOperationMetadata + */ + ExportDataOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata(); + if (object.outputInfo != null) { + if (typeof object.outputInfo !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExportDataOperationMetadata.outputInfo: object expected"); + message.outputInfo = $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.fromObject(object.outputInfo); + } + return message; + }; + + /** + * Creates a plain object from an ExportDataOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @static + * @param {google.cloud.automl.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.defaults) + object.outputInfo = null; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + object.outputInfo = $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.toObject(message.outputInfo, options); + return object; + }; + + /** + * Converts this ExportDataOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.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.automl.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.automl.v1beta1.ExportDataOperationMetadata"; + }; + + ExportDataOperationMetadata.ExportDataOutputInfo = (function() { + + /** + * Properties of an ExportDataOutputInfo. + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @interface IExportDataOutputInfo + * @property {string|null} [gcsOutputDirectory] ExportDataOutputInfo gcsOutputDirectory + * @property {string|null} [bigqueryOutputDataset] ExportDataOutputInfo bigqueryOutputDataset + */ + + /** + * Constructs a new ExportDataOutputInfo. + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @classdesc Represents an ExportDataOutputInfo. + * @implements IExportDataOutputInfo + * @constructor + * @param {google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo=} [properties] Properties to set + */ + function ExportDataOutputInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportDataOutputInfo gcsOutputDirectory. + * @member {string|null|undefined} gcsOutputDirectory + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @instance + */ + ExportDataOutputInfo.prototype.gcsOutputDirectory = null; + + /** + * ExportDataOutputInfo bigqueryOutputDataset. + * @member {string|null|undefined} bigqueryOutputDataset + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @instance + */ + ExportDataOutputInfo.prototype.bigqueryOutputDataset = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportDataOutputInfo outputLocation. + * @member {"gcsOutputDirectory"|"bigqueryOutputDataset"|undefined} outputLocation + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @instance + */ + Object.defineProperty(ExportDataOutputInfo.prototype, "outputLocation", { + get: $util.oneOfGetter($oneOfFields = ["gcsOutputDirectory", "bigqueryOutputDataset"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportDataOutputInfo instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo} ExportDataOutputInfo instance + */ + ExportDataOutputInfo.create = function create(properties) { + return new ExportDataOutputInfo(properties); + }; + + /** + * Encodes the specified ExportDataOutputInfo message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo} message ExportDataOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataOutputInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsOutputDirectory != null && Object.hasOwnProperty.call(message, "gcsOutputDirectory")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsOutputDirectory); + if (message.bigqueryOutputDataset != null && Object.hasOwnProperty.call(message, "bigqueryOutputDataset")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.bigqueryOutputDataset); + return writer; + }; + + /** + * Encodes the specified ExportDataOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo} message ExportDataOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataOutputInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportDataOutputInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo} ExportDataOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataOutputInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsOutputDirectory = reader.string(); + break; + } + case 2: { + message.bigqueryOutputDataset = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportDataOutputInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo} ExportDataOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataOutputInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportDataOutputInfo message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportDataOutputInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + properties.outputLocation = 1; + if (!$util.isString(message.gcsOutputDirectory)) + return "gcsOutputDirectory: string expected"; + } + if (message.bigqueryOutputDataset != null && message.hasOwnProperty("bigqueryOutputDataset")) { + if (properties.outputLocation === 1) + return "outputLocation: multiple values"; + properties.outputLocation = 1; + if (!$util.isString(message.bigqueryOutputDataset)) + return "bigqueryOutputDataset: string expected"; + } + return null; + }; + + /** + * Creates an ExportDataOutputInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo} ExportDataOutputInfo + */ + ExportDataOutputInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo(); + if (object.gcsOutputDirectory != null) + message.gcsOutputDirectory = String(object.gcsOutputDirectory); + if (object.bigqueryOutputDataset != null) + message.bigqueryOutputDataset = String(object.bigqueryOutputDataset); + return message; + }; + + /** + * Creates a plain object from an ExportDataOutputInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo} message ExportDataOutputInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportDataOutputInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + object.gcsOutputDirectory = message.gcsOutputDirectory; + if (options.oneofs) + object.outputLocation = "gcsOutputDirectory"; + } + if (message.bigqueryOutputDataset != null && message.hasOwnProperty("bigqueryOutputDataset")) { + object.bigqueryOutputDataset = message.bigqueryOutputDataset; + if (options.oneofs) + object.outputLocation = "bigqueryOutputDataset"; + } + return object; + }; + + /** + * Converts this ExportDataOutputInfo to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @instance + * @returns {Object.} JSON object + */ + ExportDataOutputInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportDataOutputInfo + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportDataOutputInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo"; + }; + + return ExportDataOutputInfo; + })(); + + return ExportDataOperationMetadata; + })(); + + v1beta1.BatchPredictOperationMetadata = (function() { + + /** + * Properties of a BatchPredictOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IBatchPredictOperationMetadata + * @property {google.cloud.automl.v1beta1.IBatchPredictInputConfig|null} [inputConfig] BatchPredictOperationMetadata inputConfig + * @property {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo|null} [outputInfo] BatchPredictOperationMetadata outputInfo + */ + + /** + * Constructs a new BatchPredictOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a BatchPredictOperationMetadata. + * @implements IBatchPredictOperationMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IBatchPredictOperationMetadata=} [properties] Properties to set + */ + function BatchPredictOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictOperationMetadata inputConfig. + * @member {google.cloud.automl.v1beta1.IBatchPredictInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @instance + */ + BatchPredictOperationMetadata.prototype.inputConfig = null; + + /** + * BatchPredictOperationMetadata outputInfo. + * @member {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo|null|undefined} outputInfo + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @instance + */ + BatchPredictOperationMetadata.prototype.outputInfo = null; + + /** + * Creates a new BatchPredictOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BatchPredictOperationMetadata} BatchPredictOperationMetadata instance + */ + BatchPredictOperationMetadata.create = function create(properties) { + return new BatchPredictOperationMetadata(properties); + }; + + /** + * Encodes the specified BatchPredictOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictOperationMetadata} message BatchPredictOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.automl.v1beta1.BatchPredictInputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputInfo != null && Object.hasOwnProperty.call(message, "outputInfo")) + $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.encode(message.outputInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictOperationMetadata} message BatchPredictOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.BatchPredictOperationMetadata} BatchPredictOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputConfig = $root.google.cloud.automl.v1beta1.BatchPredictInputConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.outputInfo = $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.BatchPredictOperationMetadata} BatchPredictOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.automl.v1beta1.BatchPredictInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) { + var error = $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify(message.outputInfo); + if (error) + return "outputInfo." + error; + } + return null; + }; + + /** + * Creates a BatchPredictOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BatchPredictOperationMetadata} BatchPredictOperationMetadata + */ + BatchPredictOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata(); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BatchPredictOperationMetadata.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1beta1.BatchPredictInputConfig.fromObject(object.inputConfig); + } + if (object.outputInfo != null) { + if (typeof object.outputInfo !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BatchPredictOperationMetadata.outputInfo: object expected"); + message.outputInfo = $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.fromObject(object.outputInfo); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.BatchPredictOperationMetadata} message BatchPredictOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputConfig = null; + object.outputInfo = null; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.automl.v1beta1.BatchPredictInputConfig.toObject(message.inputConfig, options); + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + object.outputInfo = $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.toObject(message.outputInfo, options); + return object; + }; + + /** + * Converts this BatchPredictOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchPredictOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.BatchPredictOperationMetadata"; + }; + + BatchPredictOperationMetadata.BatchPredictOutputInfo = (function() { + + /** + * Properties of a BatchPredictOutputInfo. + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @interface IBatchPredictOutputInfo + * @property {string|null} [gcsOutputDirectory] BatchPredictOutputInfo gcsOutputDirectory + * @property {string|null} [bigqueryOutputDataset] BatchPredictOutputInfo bigqueryOutputDataset + */ + + /** + * Constructs a new BatchPredictOutputInfo. + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @classdesc Represents a BatchPredictOutputInfo. + * @implements IBatchPredictOutputInfo + * @constructor + * @param {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo=} [properties] Properties to set + */ + function BatchPredictOutputInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictOutputInfo gcsOutputDirectory. + * @member {string|null|undefined} gcsOutputDirectory + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @instance + */ + BatchPredictOutputInfo.prototype.gcsOutputDirectory = null; + + /** + * BatchPredictOutputInfo bigqueryOutputDataset. + * @member {string|null|undefined} bigqueryOutputDataset + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @instance + */ + BatchPredictOutputInfo.prototype.bigqueryOutputDataset = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchPredictOutputInfo outputLocation. + * @member {"gcsOutputDirectory"|"bigqueryOutputDataset"|undefined} outputLocation + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @instance + */ + Object.defineProperty(BatchPredictOutputInfo.prototype, "outputLocation", { + get: $util.oneOfGetter($oneOfFields = ["gcsOutputDirectory", "bigqueryOutputDataset"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchPredictOutputInfo instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo} BatchPredictOutputInfo instance + */ + BatchPredictOutputInfo.create = function create(properties) { + return new BatchPredictOutputInfo(properties); + }; + + /** + * Encodes the specified BatchPredictOutputInfo message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo} message BatchPredictOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOutputInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsOutputDirectory != null && Object.hasOwnProperty.call(message, "gcsOutputDirectory")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsOutputDirectory); + if (message.bigqueryOutputDataset != null && Object.hasOwnProperty.call(message, "bigqueryOutputDataset")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.bigqueryOutputDataset); + return writer; + }; + + /** + * Encodes the specified BatchPredictOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo} message BatchPredictOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOutputInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictOutputInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo} BatchPredictOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOutputInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsOutputDirectory = reader.string(); + break; + } + case 2: { + message.bigqueryOutputDataset = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictOutputInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo} BatchPredictOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOutputInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictOutputInfo message. + * @function verify + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictOutputInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + properties.outputLocation = 1; + if (!$util.isString(message.gcsOutputDirectory)) + return "gcsOutputDirectory: string expected"; + } + if (message.bigqueryOutputDataset != null && message.hasOwnProperty("bigqueryOutputDataset")) { + if (properties.outputLocation === 1) + return "outputLocation: multiple values"; + properties.outputLocation = 1; + if (!$util.isString(message.bigqueryOutputDataset)) + return "bigqueryOutputDataset: string expected"; + } + return null; + }; + + /** + * Creates a BatchPredictOutputInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo} BatchPredictOutputInfo + */ + BatchPredictOutputInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo) + return object; + var message = new $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo(); + if (object.gcsOutputDirectory != null) + message.gcsOutputDirectory = String(object.gcsOutputDirectory); + if (object.bigqueryOutputDataset != null) + message.bigqueryOutputDataset = String(object.bigqueryOutputDataset); + return message; + }; + + /** + * Creates a plain object from a BatchPredictOutputInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo} message BatchPredictOutputInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictOutputInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + object.gcsOutputDirectory = message.gcsOutputDirectory; + if (options.oneofs) + object.outputLocation = "gcsOutputDirectory"; + } + if (message.bigqueryOutputDataset != null && message.hasOwnProperty("bigqueryOutputDataset")) { + object.bigqueryOutputDataset = message.bigqueryOutputDataset; + if (options.oneofs) + object.outputLocation = "bigqueryOutputDataset"; + } + return object; + }; + + /** + * Converts this BatchPredictOutputInfo to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @instance + * @returns {Object.} JSON object + */ + BatchPredictOutputInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictOutputInfo + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictOutputInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo"; + }; + + return BatchPredictOutputInfo; + })(); + + return BatchPredictOperationMetadata; + })(); + + v1beta1.ExportModelOperationMetadata = (function() { + + /** + * Properties of an ExportModelOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IExportModelOperationMetadata + * @property {google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo|null} [outputInfo] ExportModelOperationMetadata outputInfo + */ + + /** + * Constructs a new ExportModelOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ExportModelOperationMetadata. + * @implements IExportModelOperationMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IExportModelOperationMetadata=} [properties] Properties to set + */ + function ExportModelOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportModelOperationMetadata outputInfo. + * @member {google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo|null|undefined} outputInfo + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @instance + */ + ExportModelOperationMetadata.prototype.outputInfo = null; + + /** + * Creates a new ExportModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IExportModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExportModelOperationMetadata} ExportModelOperationMetadata instance + */ + ExportModelOperationMetadata.create = function create(properties) { + return new ExportModelOperationMetadata(properties); + }; + + /** + * Encodes the specified ExportModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IExportModelOperationMetadata} message ExportModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputInfo != null && Object.hasOwnProperty.call(message, "outputInfo")) + $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo.encode(message.outputInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IExportModelOperationMetadata} message ExportModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ExportModelOperationMetadata} ExportModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.outputInfo = $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ExportModelOperationMetadata} ExportModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportModelOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) { + var error = $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo.verify(message.outputInfo); + if (error) + return "outputInfo." + error; + } + return null; + }; + + /** + * Creates an ExportModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExportModelOperationMetadata} ExportModelOperationMetadata + */ + ExportModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata(); + if (object.outputInfo != null) { + if (typeof object.outputInfo !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExportModelOperationMetadata.outputInfo: object expected"); + message.outputInfo = $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo.fromObject(object.outputInfo); + } + return message; + }; + + /** + * Creates a plain object from an ExportModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.ExportModelOperationMetadata} message ExportModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportModelOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputInfo = null; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + object.outputInfo = $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo.toObject(message.outputInfo, options); + return object; + }; + + /** + * Converts this ExportModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ExportModelOperationMetadata"; + }; + + ExportModelOperationMetadata.ExportModelOutputInfo = (function() { + + /** + * Properties of an ExportModelOutputInfo. + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @interface IExportModelOutputInfo + * @property {string|null} [gcsOutputDirectory] ExportModelOutputInfo gcsOutputDirectory + */ + + /** + * Constructs a new ExportModelOutputInfo. + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @classdesc Represents an ExportModelOutputInfo. + * @implements IExportModelOutputInfo + * @constructor + * @param {google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo=} [properties] Properties to set + */ + function ExportModelOutputInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportModelOutputInfo gcsOutputDirectory. + * @member {string} gcsOutputDirectory + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @instance + */ + ExportModelOutputInfo.prototype.gcsOutputDirectory = ""; + + /** + * Creates a new ExportModelOutputInfo instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo} ExportModelOutputInfo instance + */ + ExportModelOutputInfo.create = function create(properties) { + return new ExportModelOutputInfo(properties); + }; + + /** + * Encodes the specified ExportModelOutputInfo message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo} message ExportModelOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelOutputInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsOutputDirectory != null && Object.hasOwnProperty.call(message, "gcsOutputDirectory")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsOutputDirectory); + return writer; + }; + + /** + * Encodes the specified ExportModelOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo} message ExportModelOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelOutputInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportModelOutputInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo} ExportModelOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelOutputInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsOutputDirectory = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportModelOutputInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo} ExportModelOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelOutputInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportModelOutputInfo message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportModelOutputInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) + if (!$util.isString(message.gcsOutputDirectory)) + return "gcsOutputDirectory: string expected"; + return null; + }; + + /** + * Creates an ExportModelOutputInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo} ExportModelOutputInfo + */ + ExportModelOutputInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo(); + if (object.gcsOutputDirectory != null) + message.gcsOutputDirectory = String(object.gcsOutputDirectory); + return message; + }; + + /** + * Creates a plain object from an ExportModelOutputInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo} message ExportModelOutputInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportModelOutputInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.gcsOutputDirectory = ""; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) + object.gcsOutputDirectory = message.gcsOutputDirectory; + return object; + }; + + /** + * Converts this ExportModelOutputInfo to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @instance + * @returns {Object.} JSON object + */ + ExportModelOutputInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportModelOutputInfo + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportModelOutputInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo"; + }; + + return ExportModelOutputInfo; + })(); + + return ExportModelOperationMetadata; + })(); + + v1beta1.ExportEvaluatedExamplesOperationMetadata = (function() { + + /** + * Properties of an ExportEvaluatedExamplesOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IExportEvaluatedExamplesOperationMetadata + * @property {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo|null} [outputInfo] ExportEvaluatedExamplesOperationMetadata outputInfo + */ + + /** + * Constructs a new ExportEvaluatedExamplesOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ExportEvaluatedExamplesOperationMetadata. + * @implements IExportEvaluatedExamplesOperationMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata=} [properties] Properties to set + */ + function ExportEvaluatedExamplesOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportEvaluatedExamplesOperationMetadata outputInfo. + * @member {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo|null|undefined} outputInfo + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @instance + */ + ExportEvaluatedExamplesOperationMetadata.prototype.outputInfo = null; + + /** + * Creates a new ExportEvaluatedExamplesOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata} ExportEvaluatedExamplesOperationMetadata instance + */ + ExportEvaluatedExamplesOperationMetadata.create = function create(properties) { + return new ExportEvaluatedExamplesOperationMetadata(properties); + }; + + /** + * Encodes the specified ExportEvaluatedExamplesOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata} message ExportEvaluatedExamplesOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEvaluatedExamplesOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputInfo != null && Object.hasOwnProperty.call(message, "outputInfo")) + $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo.encode(message.outputInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportEvaluatedExamplesOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata} message ExportEvaluatedExamplesOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEvaluatedExamplesOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportEvaluatedExamplesOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata} ExportEvaluatedExamplesOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEvaluatedExamplesOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.outputInfo = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportEvaluatedExamplesOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata} ExportEvaluatedExamplesOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEvaluatedExamplesOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportEvaluatedExamplesOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEvaluatedExamplesOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) { + var error = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo.verify(message.outputInfo); + if (error) + return "outputInfo." + error; + } + return null; + }; + + /** + * Creates an ExportEvaluatedExamplesOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata} ExportEvaluatedExamplesOperationMetadata + */ + ExportEvaluatedExamplesOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata(); + if (object.outputInfo != null) { + if (typeof object.outputInfo !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.outputInfo: object expected"); + message.outputInfo = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo.fromObject(object.outputInfo); + } + return message; + }; + + /** + * Creates a plain object from an ExportEvaluatedExamplesOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata} message ExportEvaluatedExamplesOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEvaluatedExamplesOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputInfo = null; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + object.outputInfo = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo.toObject(message.outputInfo, options); + return object; + }; + + /** + * Converts this ExportEvaluatedExamplesOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportEvaluatedExamplesOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportEvaluatedExamplesOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportEvaluatedExamplesOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata"; + }; + + ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo = (function() { + + /** + * Properties of an ExportEvaluatedExamplesOutputInfo. + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @interface IExportEvaluatedExamplesOutputInfo + * @property {string|null} [bigqueryOutputDataset] ExportEvaluatedExamplesOutputInfo bigqueryOutputDataset + */ + + /** + * Constructs a new ExportEvaluatedExamplesOutputInfo. + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @classdesc Represents an ExportEvaluatedExamplesOutputInfo. + * @implements IExportEvaluatedExamplesOutputInfo + * @constructor + * @param {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo=} [properties] Properties to set + */ + function ExportEvaluatedExamplesOutputInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportEvaluatedExamplesOutputInfo bigqueryOutputDataset. + * @member {string} bigqueryOutputDataset + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @instance + */ + ExportEvaluatedExamplesOutputInfo.prototype.bigqueryOutputDataset = ""; + + /** + * Creates a new ExportEvaluatedExamplesOutputInfo instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo} ExportEvaluatedExamplesOutputInfo instance + */ + ExportEvaluatedExamplesOutputInfo.create = function create(properties) { + return new ExportEvaluatedExamplesOutputInfo(properties); + }; + + /** + * Encodes the specified ExportEvaluatedExamplesOutputInfo message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo} message ExportEvaluatedExamplesOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEvaluatedExamplesOutputInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bigqueryOutputDataset != null && Object.hasOwnProperty.call(message, "bigqueryOutputDataset")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.bigqueryOutputDataset); + return writer; + }; + + /** + * Encodes the specified ExportEvaluatedExamplesOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo} message ExportEvaluatedExamplesOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEvaluatedExamplesOutputInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportEvaluatedExamplesOutputInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo} ExportEvaluatedExamplesOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEvaluatedExamplesOutputInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.bigqueryOutputDataset = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportEvaluatedExamplesOutputInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo} ExportEvaluatedExamplesOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEvaluatedExamplesOutputInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportEvaluatedExamplesOutputInfo message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEvaluatedExamplesOutputInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bigqueryOutputDataset != null && message.hasOwnProperty("bigqueryOutputDataset")) + if (!$util.isString(message.bigqueryOutputDataset)) + return "bigqueryOutputDataset: string expected"; + return null; + }; + + /** + * Creates an ExportEvaluatedExamplesOutputInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo} ExportEvaluatedExamplesOutputInfo + */ + ExportEvaluatedExamplesOutputInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo(); + if (object.bigqueryOutputDataset != null) + message.bigqueryOutputDataset = String(object.bigqueryOutputDataset); + return message; + }; + + /** + * Creates a plain object from an ExportEvaluatedExamplesOutputInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo} message ExportEvaluatedExamplesOutputInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEvaluatedExamplesOutputInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.bigqueryOutputDataset = ""; + if (message.bigqueryOutputDataset != null && message.hasOwnProperty("bigqueryOutputDataset")) + object.bigqueryOutputDataset = message.bigqueryOutputDataset; + return object; + }; + + /** + * Converts this ExportEvaluatedExamplesOutputInfo to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @instance + * @returns {Object.} JSON object + */ + ExportEvaluatedExamplesOutputInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportEvaluatedExamplesOutputInfo + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportEvaluatedExamplesOutputInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo"; + }; + + return ExportEvaluatedExamplesOutputInfo; + })(); + + return ExportEvaluatedExamplesOperationMetadata; + })(); + + v1beta1.PredictionService = (function() { + + /** + * Constructs a new PredictionService service. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a PredictionService + * @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 PredictionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (PredictionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PredictionService; + + /** + * Creates new PredictionService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.automl.v1beta1.PredictionService + * @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 {PredictionService} RPC service. Useful where requests and/or responses are streamed. + */ + PredictionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.PredictionService|predict}. + * @memberof google.cloud.automl.v1beta1.PredictionService + * @typedef PredictCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.PredictResponse} [response] PredictResponse + */ + + /** + * Calls Predict. + * @function predict + * @memberof google.cloud.automl.v1beta1.PredictionService + * @instance + * @param {google.cloud.automl.v1beta1.IPredictRequest} request PredictRequest message or plain object + * @param {google.cloud.automl.v1beta1.PredictionService.PredictCallback} callback Node-style callback called with the error, if any, and PredictResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PredictionService.prototype.predict = function predict(request, callback) { + return this.rpcCall(predict, $root.google.cloud.automl.v1beta1.PredictRequest, $root.google.cloud.automl.v1beta1.PredictResponse, request, callback); + }, "name", { value: "Predict" }); + + /** + * Calls Predict. + * @function predict + * @memberof google.cloud.automl.v1beta1.PredictionService + * @instance + * @param {google.cloud.automl.v1beta1.IPredictRequest} request PredictRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.PredictionService|batchPredict}. + * @memberof google.cloud.automl.v1beta1.PredictionService + * @typedef BatchPredictCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchPredict. + * @function batchPredict + * @memberof google.cloud.automl.v1beta1.PredictionService + * @instance + * @param {google.cloud.automl.v1beta1.IBatchPredictRequest} request BatchPredictRequest message or plain object + * @param {google.cloud.automl.v1beta1.PredictionService.BatchPredictCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PredictionService.prototype.batchPredict = function batchPredict(request, callback) { + return this.rpcCall(batchPredict, $root.google.cloud.automl.v1beta1.BatchPredictRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchPredict" }); + + /** + * Calls BatchPredict. + * @function batchPredict + * @memberof google.cloud.automl.v1beta1.PredictionService + * @instance + * @param {google.cloud.automl.v1beta1.IBatchPredictRequest} request BatchPredictRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return PredictionService; + })(); + + v1beta1.PredictRequest = (function() { + + /** + * Properties of a PredictRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IPredictRequest + * @property {string|null} [name] PredictRequest name + * @property {google.cloud.automl.v1beta1.IExamplePayload|null} [payload] PredictRequest payload + * @property {Object.|null} [params] PredictRequest params + */ + + /** + * Constructs a new PredictRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a PredictRequest. + * @implements IPredictRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IPredictRequest=} [properties] Properties to set + */ + function PredictRequest(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PredictRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @instance + */ + PredictRequest.prototype.name = ""; + + /** + * PredictRequest payload. + * @member {google.cloud.automl.v1beta1.IExamplePayload|null|undefined} payload + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @instance + */ + PredictRequest.prototype.payload = null; + + /** + * PredictRequest params. + * @member {Object.} params + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @instance + */ + PredictRequest.prototype.params = $util.emptyObject; + + /** + * Creates a new PredictRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @static + * @param {google.cloud.automl.v1beta1.IPredictRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.PredictRequest} PredictRequest instance + */ + PredictRequest.create = function create(properties) { + return new PredictRequest(properties); + }; + + /** + * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.PredictRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @static + * @param {google.cloud.automl.v1beta1.IPredictRequest} message PredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictRequest.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.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.cloud.automl.v1beta1.ExamplePayload.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.params[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.PredictRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @static + * @param {google.cloud.automl.v1beta1.IPredictRequest} message PredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PredictRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.PredictRequest} PredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.PredictRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.payload = $root.google.cloud.automl.v1beta1.ExamplePayload.decode(reader, reader.uint32()); + break; + } + case 3: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PredictRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.PredictRequest} PredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PredictRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PredictRequest.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.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.cloud.automl.v1beta1.ExamplePayload.verify(message.payload); + if (error) + return "payload." + error; + } + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.PredictRequest} PredictRequest + */ + PredictRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.PredictRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.PredictRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.automl.v1beta1.PredictRequest.payload: object expected"); + message.payload = $root.google.cloud.automl.v1beta1.ExamplePayload.fromObject(object.payload); + } + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.automl.v1beta1.PredictRequest.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @static + * @param {google.cloud.automl.v1beta1.PredictRequest} message PredictRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PredictRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) { + object.name = ""; + object.payload = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.cloud.automl.v1beta1.ExamplePayload.toObject(message.payload, options); + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + return object; + }; + + /** + * Converts this PredictRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @instance + * @returns {Object.} JSON object + */ + PredictRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PredictRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PredictRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.PredictRequest"; + }; + + return PredictRequest; + })(); + + v1beta1.PredictResponse = (function() { + + /** + * Properties of a PredictResponse. + * @memberof google.cloud.automl.v1beta1 + * @interface IPredictResponse + * @property {Array.|null} [payload] PredictResponse payload + * @property {google.cloud.automl.v1beta1.IExamplePayload|null} [preprocessedInput] PredictResponse preprocessedInput + * @property {Object.|null} [metadata] PredictResponse metadata + */ + + /** + * Constructs a new PredictResponse. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a PredictResponse. + * @implements IPredictResponse + * @constructor + * @param {google.cloud.automl.v1beta1.IPredictResponse=} [properties] Properties to set + */ + function PredictResponse(properties) { + this.payload = []; + this.metadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PredictResponse payload. + * @member {Array.} payload + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @instance + */ + PredictResponse.prototype.payload = $util.emptyArray; + + /** + * PredictResponse preprocessedInput. + * @member {google.cloud.automl.v1beta1.IExamplePayload|null|undefined} preprocessedInput + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @instance + */ + PredictResponse.prototype.preprocessedInput = null; + + /** + * PredictResponse metadata. + * @member {Object.} metadata + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @instance + */ + PredictResponse.prototype.metadata = $util.emptyObject; + + /** + * Creates a new PredictResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @static + * @param {google.cloud.automl.v1beta1.IPredictResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.PredictResponse} PredictResponse instance + */ + PredictResponse.create = function create(properties) { + return new PredictResponse(properties); + }; + + /** + * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.PredictResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @static + * @param {google.cloud.automl.v1beta1.IPredictResponse} message PredictResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.payload != null && message.payload.length) + for (var i = 0; i < message.payload.length; ++i) + $root.google.cloud.automl.v1beta1.AnnotationPayload.encode(message.payload[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + if (message.preprocessedInput != null && Object.hasOwnProperty.call(message, "preprocessedInput")) + $root.google.cloud.automl.v1beta1.ExamplePayload.encode(message.preprocessedInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.PredictResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @static + * @param {google.cloud.automl.v1beta1.IPredictResponse} message PredictResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PredictResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.PredictResponse} PredictResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.PredictResponse(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.payload && message.payload.length)) + message.payload = []; + message.payload.push($root.google.cloud.automl.v1beta1.AnnotationPayload.decode(reader, reader.uint32())); + break; + } + case 3: { + message.preprocessedInput = $root.google.cloud.automl.v1beta1.ExamplePayload.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.metadata === $util.emptyObject) + message.metadata = {}; + 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.metadata[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PredictResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.PredictResponse} PredictResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PredictResponse message. + * @function verify + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PredictResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.payload != null && message.hasOwnProperty("payload")) { + if (!Array.isArray(message.payload)) + return "payload: array expected"; + for (var i = 0; i < message.payload.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.AnnotationPayload.verify(message.payload[i]); + if (error) + return "payload." + error; + } + } + if (message.preprocessedInput != null && message.hasOwnProperty("preprocessedInput")) { + var error = $root.google.cloud.automl.v1beta1.ExamplePayload.verify(message.preprocessedInput); + if (error) + return "preprocessedInput." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.PredictResponse} PredictResponse + */ + PredictResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.PredictResponse) + return object; + var message = new $root.google.cloud.automl.v1beta1.PredictResponse(); + if (object.payload) { + if (!Array.isArray(object.payload)) + throw TypeError(".google.cloud.automl.v1beta1.PredictResponse.payload: array expected"); + message.payload = []; + for (var i = 0; i < object.payload.length; ++i) { + if (typeof object.payload[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.PredictResponse.payload: object expected"); + message.payload[i] = $root.google.cloud.automl.v1beta1.AnnotationPayload.fromObject(object.payload[i]); + } + } + if (object.preprocessedInput != null) { + if (typeof object.preprocessedInput !== "object") + throw TypeError(".google.cloud.automl.v1beta1.PredictResponse.preprocessedInput: object expected"); + message.preprocessedInput = $root.google.cloud.automl.v1beta1.ExamplePayload.fromObject(object.preprocessedInput); + } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.PredictResponse.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @static + * @param {google.cloud.automl.v1beta1.PredictResponse} message PredictResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PredictResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.payload = []; + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) + object.preprocessedInput = null; + if (message.payload && message.payload.length) { + object.payload = []; + for (var j = 0; j < message.payload.length; ++j) + object.payload[j] = $root.google.cloud.automl.v1beta1.AnnotationPayload.toObject(message.payload[j], options); + } + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + if (message.preprocessedInput != null && message.hasOwnProperty("preprocessedInput")) + object.preprocessedInput = $root.google.cloud.automl.v1beta1.ExamplePayload.toObject(message.preprocessedInput, options); + return object; + }; + + /** + * Converts this PredictResponse to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @instance + * @returns {Object.} JSON object + */ + PredictResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PredictResponse + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PredictResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.PredictResponse"; + }; + + return PredictResponse; + })(); + + v1beta1.BatchPredictRequest = (function() { + + /** + * Properties of a BatchPredictRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IBatchPredictRequest + * @property {string|null} [name] BatchPredictRequest name + * @property {google.cloud.automl.v1beta1.IBatchPredictInputConfig|null} [inputConfig] BatchPredictRequest inputConfig + * @property {google.cloud.automl.v1beta1.IBatchPredictOutputConfig|null} [outputConfig] BatchPredictRequest outputConfig + * @property {Object.|null} [params] BatchPredictRequest params + */ + + /** + * Constructs a new BatchPredictRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a BatchPredictRequest. + * @implements IBatchPredictRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IBatchPredictRequest=} [properties] Properties to set + */ + function BatchPredictRequest(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @instance + */ + BatchPredictRequest.prototype.name = ""; + + /** + * BatchPredictRequest inputConfig. + * @member {google.cloud.automl.v1beta1.IBatchPredictInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @instance + */ + BatchPredictRequest.prototype.inputConfig = null; + + /** + * BatchPredictRequest outputConfig. + * @member {google.cloud.automl.v1beta1.IBatchPredictOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @instance + */ + BatchPredictRequest.prototype.outputConfig = null; + + /** + * BatchPredictRequest params. + * @member {Object.} params + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @instance + */ + BatchPredictRequest.prototype.params = $util.emptyObject; + + /** + * Creates a new BatchPredictRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BatchPredictRequest} BatchPredictRequest instance + */ + BatchPredictRequest.create = function create(properties) { + return new BatchPredictRequest(properties); + }; + + /** + * Encodes the specified BatchPredictRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictRequest} message BatchPredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictRequest.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.automl.v1beta1.BatchPredictInputConfig.encode(message.inputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.automl.v1beta1.BatchPredictOutputConfig.encode(message.outputConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.params[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictRequest} message BatchPredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.BatchPredictRequest} BatchPredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.BatchPredictRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.inputConfig = $root.google.cloud.automl.v1beta1.BatchPredictInputConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outputConfig = $root.google.cloud.automl.v1beta1.BatchPredictOutputConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.BatchPredictRequest} BatchPredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictRequest.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.automl.v1beta1.BatchPredictInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.automl.v1beta1.BatchPredictOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a BatchPredictRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BatchPredictRequest} BatchPredictRequest + */ + BatchPredictRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BatchPredictRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.BatchPredictRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BatchPredictRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1beta1.BatchPredictInputConfig.fromObject(object.inputConfig); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BatchPredictRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.automl.v1beta1.BatchPredictOutputConfig.fromObject(object.outputConfig); + } + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BatchPredictRequest.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @static + * @param {google.cloud.automl.v1beta1.BatchPredictRequest} message BatchPredictRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) { + object.name = ""; + object.inputConfig = null; + object.outputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.automl.v1beta1.BatchPredictInputConfig.toObject(message.inputConfig, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.automl.v1beta1.BatchPredictOutputConfig.toObject(message.outputConfig, options); + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + return object; + }; + + /** + * Converts this BatchPredictRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @instance + * @returns {Object.} JSON object + */ + BatchPredictRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.BatchPredictRequest"; + }; + + return BatchPredictRequest; + })(); + + v1beta1.BatchPredictResult = (function() { + + /** + * Properties of a BatchPredictResult. + * @memberof google.cloud.automl.v1beta1 + * @interface IBatchPredictResult + * @property {Object.|null} [metadata] BatchPredictResult metadata + */ + + /** + * Constructs a new BatchPredictResult. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a BatchPredictResult. + * @implements IBatchPredictResult + * @constructor + * @param {google.cloud.automl.v1beta1.IBatchPredictResult=} [properties] Properties to set + */ + function BatchPredictResult(properties) { + this.metadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictResult metadata. + * @member {Object.} metadata + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @instance + */ + BatchPredictResult.prototype.metadata = $util.emptyObject; + + /** + * Creates a new BatchPredictResult instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictResult=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BatchPredictResult} BatchPredictResult instance + */ + BatchPredictResult.create = function create(properties) { + return new BatchPredictResult(properties); + }; + + /** + * Encodes the specified BatchPredictResult message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictResult} message BatchPredictResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), 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 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictResult message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictResult} message BatchPredictResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.BatchPredictResult} BatchPredictResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.BatchPredictResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.metadata === $util.emptyObject) + message.metadata = {}; + 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.metadata[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.BatchPredictResult} BatchPredictResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictResult message. + * @function verify + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a BatchPredictResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BatchPredictResult} BatchPredictResult + */ + BatchPredictResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BatchPredictResult) + return object; + var message = new $root.google.cloud.automl.v1beta1.BatchPredictResult(); + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BatchPredictResult.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @static + * @param {google.cloud.automl.v1beta1.BatchPredictResult} message BatchPredictResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.metadata = {}; + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + return object; + }; + + /** + * Converts this BatchPredictResult to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @instance + * @returns {Object.} JSON object + */ + BatchPredictResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictResult + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.BatchPredictResult"; + }; + + return BatchPredictResult; + })(); + + v1beta1.AutoMl = (function() { + + /** + * Constructs a new AutoMl service. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an AutoMl + * @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 AutoMl(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AutoMl.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AutoMl; + + /** + * Creates new AutoMl service using the specified rpc implementation. + * @function create + * @memberof google.cloud.automl.v1beta1.AutoMl + * @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 {AutoMl} RPC service. Useful where requests and/or responses are streamed. + */ + AutoMl.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|createDataset}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef CreateDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.Dataset} [response] Dataset + */ + + /** + * Calls CreateDataset. + * @function createDataset + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.ICreateDatasetRequest} request CreateDatasetRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.CreateDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.createDataset = function createDataset(request, callback) { + return this.rpcCall(createDataset, $root.google.cloud.automl.v1beta1.CreateDatasetRequest, $root.google.cloud.automl.v1beta1.Dataset, request, callback); + }, "name", { value: "CreateDataset" }); + + /** + * Calls CreateDataset. + * @function createDataset + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.ICreateDatasetRequest} request CreateDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getDataset}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef GetDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.Dataset} [response] Dataset + */ + + /** + * Calls GetDataset. + * @function getDataset + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetDatasetRequest} request GetDatasetRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.GetDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getDataset = function getDataset(request, callback) { + return this.rpcCall(getDataset, $root.google.cloud.automl.v1beta1.GetDatasetRequest, $root.google.cloud.automl.v1beta1.Dataset, request, callback); + }, "name", { value: "GetDataset" }); + + /** + * Calls GetDataset. + * @function getDataset + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetDatasetRequest} request GetDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|listDatasets}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef ListDatasetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.ListDatasetsResponse} [response] ListDatasetsResponse + */ + + /** + * Calls ListDatasets. + * @function listDatasets + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IListDatasetsRequest} request ListDatasetsRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.ListDatasetsCallback} callback Node-style callback called with the error, if any, and ListDatasetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.listDatasets = function listDatasets(request, callback) { + return this.rpcCall(listDatasets, $root.google.cloud.automl.v1beta1.ListDatasetsRequest, $root.google.cloud.automl.v1beta1.ListDatasetsResponse, request, callback); + }, "name", { value: "ListDatasets" }); + + /** + * Calls ListDatasets. + * @function listDatasets + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IListDatasetsRequest} request ListDatasetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|updateDataset}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef UpdateDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.Dataset} [response] Dataset + */ + + /** + * Calls UpdateDataset. + * @function updateDataset + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IUpdateDatasetRequest} request UpdateDatasetRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.UpdateDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.updateDataset = function updateDataset(request, callback) { + return this.rpcCall(updateDataset, $root.google.cloud.automl.v1beta1.UpdateDatasetRequest, $root.google.cloud.automl.v1beta1.Dataset, request, callback); + }, "name", { value: "UpdateDataset" }); + + /** + * Calls UpdateDataset. + * @function updateDataset + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IUpdateDatasetRequest} request UpdateDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|deleteDataset}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef DeleteDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteDataset. + * @function deleteDataset + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IDeleteDatasetRequest} request DeleteDatasetRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.DeleteDatasetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.deleteDataset = function deleteDataset(request, callback) { + return this.rpcCall(deleteDataset, $root.google.cloud.automl.v1beta1.DeleteDatasetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteDataset" }); + + /** + * Calls DeleteDataset. + * @function deleteDataset + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IDeleteDatasetRequest} request DeleteDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|importData}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef ImportDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportData. + * @function importData + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IImportDataRequest} request ImportDataRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.ImportDataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.importData = function importData(request, callback) { + return this.rpcCall(importData, $root.google.cloud.automl.v1beta1.ImportDataRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportData" }); + + /** + * Calls ImportData. + * @function importData + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IImportDataRequest} request ImportDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|exportData}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef ExportDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportData. + * @function exportData + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IExportDataRequest} request ExportDataRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.ExportDataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.exportData = function exportData(request, callback) { + return this.rpcCall(exportData, $root.google.cloud.automl.v1beta1.ExportDataRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportData" }); + + /** + * Calls ExportData. + * @function exportData + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IExportDataRequest} request ExportDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getAnnotationSpec}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef GetAnnotationSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.AnnotationSpec} [response] AnnotationSpec + */ + + /** + * Calls GetAnnotationSpec. + * @function getAnnotationSpec + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetAnnotationSpecRequest} request GetAnnotationSpecRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.GetAnnotationSpecCallback} callback Node-style callback called with the error, if any, and AnnotationSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getAnnotationSpec = function getAnnotationSpec(request, callback) { + return this.rpcCall(getAnnotationSpec, $root.google.cloud.automl.v1beta1.GetAnnotationSpecRequest, $root.google.cloud.automl.v1beta1.AnnotationSpec, request, callback); + }, "name", { value: "GetAnnotationSpec" }); + + /** + * Calls GetAnnotationSpec. + * @function getAnnotationSpec + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetAnnotationSpecRequest} request GetAnnotationSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getTableSpec}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef GetTableSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.TableSpec} [response] TableSpec + */ + + /** + * Calls GetTableSpec. + * @function getTableSpec + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetTableSpecRequest} request GetTableSpecRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.GetTableSpecCallback} callback Node-style callback called with the error, if any, and TableSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getTableSpec = function getTableSpec(request, callback) { + return this.rpcCall(getTableSpec, $root.google.cloud.automl.v1beta1.GetTableSpecRequest, $root.google.cloud.automl.v1beta1.TableSpec, request, callback); + }, "name", { value: "GetTableSpec" }); + + /** + * Calls GetTableSpec. + * @function getTableSpec + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetTableSpecRequest} request GetTableSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|listTableSpecs}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef ListTableSpecsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.ListTableSpecsResponse} [response] ListTableSpecsResponse + */ + + /** + * Calls ListTableSpecs. + * @function listTableSpecs + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IListTableSpecsRequest} request ListTableSpecsRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.ListTableSpecsCallback} callback Node-style callback called with the error, if any, and ListTableSpecsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.listTableSpecs = function listTableSpecs(request, callback) { + return this.rpcCall(listTableSpecs, $root.google.cloud.automl.v1beta1.ListTableSpecsRequest, $root.google.cloud.automl.v1beta1.ListTableSpecsResponse, request, callback); + }, "name", { value: "ListTableSpecs" }); + + /** + * Calls ListTableSpecs. + * @function listTableSpecs + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IListTableSpecsRequest} request ListTableSpecsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|updateTableSpec}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef UpdateTableSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.TableSpec} [response] TableSpec + */ + + /** + * Calls UpdateTableSpec. + * @function updateTableSpec + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IUpdateTableSpecRequest} request UpdateTableSpecRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.UpdateTableSpecCallback} callback Node-style callback called with the error, if any, and TableSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.updateTableSpec = function updateTableSpec(request, callback) { + return this.rpcCall(updateTableSpec, $root.google.cloud.automl.v1beta1.UpdateTableSpecRequest, $root.google.cloud.automl.v1beta1.TableSpec, request, callback); + }, "name", { value: "UpdateTableSpec" }); + + /** + * Calls UpdateTableSpec. + * @function updateTableSpec + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IUpdateTableSpecRequest} request UpdateTableSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getColumnSpec}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef GetColumnSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.ColumnSpec} [response] ColumnSpec + */ + + /** + * Calls GetColumnSpec. + * @function getColumnSpec + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetColumnSpecRequest} request GetColumnSpecRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.GetColumnSpecCallback} callback Node-style callback called with the error, if any, and ColumnSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getColumnSpec = function getColumnSpec(request, callback) { + return this.rpcCall(getColumnSpec, $root.google.cloud.automl.v1beta1.GetColumnSpecRequest, $root.google.cloud.automl.v1beta1.ColumnSpec, request, callback); + }, "name", { value: "GetColumnSpec" }); + + /** + * Calls GetColumnSpec. + * @function getColumnSpec + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetColumnSpecRequest} request GetColumnSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|listColumnSpecs}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef ListColumnSpecsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.ListColumnSpecsResponse} [response] ListColumnSpecsResponse + */ + + /** + * Calls ListColumnSpecs. + * @function listColumnSpecs + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IListColumnSpecsRequest} request ListColumnSpecsRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.ListColumnSpecsCallback} callback Node-style callback called with the error, if any, and ListColumnSpecsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.listColumnSpecs = function listColumnSpecs(request, callback) { + return this.rpcCall(listColumnSpecs, $root.google.cloud.automl.v1beta1.ListColumnSpecsRequest, $root.google.cloud.automl.v1beta1.ListColumnSpecsResponse, request, callback); + }, "name", { value: "ListColumnSpecs" }); + + /** + * Calls ListColumnSpecs. + * @function listColumnSpecs + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IListColumnSpecsRequest} request ListColumnSpecsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|updateColumnSpec}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef UpdateColumnSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.ColumnSpec} [response] ColumnSpec + */ + + /** + * Calls UpdateColumnSpec. + * @function updateColumnSpec + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IUpdateColumnSpecRequest} request UpdateColumnSpecRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.UpdateColumnSpecCallback} callback Node-style callback called with the error, if any, and ColumnSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.updateColumnSpec = function updateColumnSpec(request, callback) { + return this.rpcCall(updateColumnSpec, $root.google.cloud.automl.v1beta1.UpdateColumnSpecRequest, $root.google.cloud.automl.v1beta1.ColumnSpec, request, callback); + }, "name", { value: "UpdateColumnSpec" }); + + /** + * Calls UpdateColumnSpec. + * @function updateColumnSpec + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IUpdateColumnSpecRequest} request UpdateColumnSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|createModel}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef CreateModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateModel. + * @function createModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.ICreateModelRequest} request CreateModelRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.CreateModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.createModel = function createModel(request, callback) { + return this.rpcCall(createModel, $root.google.cloud.automl.v1beta1.CreateModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateModel" }); + + /** + * Calls CreateModel. + * @function createModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.ICreateModelRequest} request CreateModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getModel}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef GetModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.Model} [response] Model + */ + + /** + * Calls GetModel. + * @function getModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetModelRequest} request GetModelRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.GetModelCallback} callback Node-style callback called with the error, if any, and Model + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getModel = function getModel(request, callback) { + return this.rpcCall(getModel, $root.google.cloud.automl.v1beta1.GetModelRequest, $root.google.cloud.automl.v1beta1.Model, request, callback); + }, "name", { value: "GetModel" }); + + /** + * Calls GetModel. + * @function getModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetModelRequest} request GetModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|listModels}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef ListModelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.ListModelsResponse} [response] ListModelsResponse + */ + + /** + * Calls ListModels. + * @function listModels + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IListModelsRequest} request ListModelsRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.ListModelsCallback} callback Node-style callback called with the error, if any, and ListModelsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.listModels = function listModels(request, callback) { + return this.rpcCall(listModels, $root.google.cloud.automl.v1beta1.ListModelsRequest, $root.google.cloud.automl.v1beta1.ListModelsResponse, request, callback); + }, "name", { value: "ListModels" }); + + /** + * Calls ListModels. + * @function listModels + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IListModelsRequest} request ListModelsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|deleteModel}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef DeleteModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteModel. + * @function deleteModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IDeleteModelRequest} request DeleteModelRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.DeleteModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.deleteModel = function deleteModel(request, callback) { + return this.rpcCall(deleteModel, $root.google.cloud.automl.v1beta1.DeleteModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteModel" }); + + /** + * Calls DeleteModel. + * @function deleteModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IDeleteModelRequest} request DeleteModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|deployModel}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef DeployModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeployModel. + * @function deployModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IDeployModelRequest} request DeployModelRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.DeployModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.deployModel = function deployModel(request, callback) { + return this.rpcCall(deployModel, $root.google.cloud.automl.v1beta1.DeployModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeployModel" }); + + /** + * Calls DeployModel. + * @function deployModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IDeployModelRequest} request DeployModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|undeployModel}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef UndeployModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UndeployModel. + * @function undeployModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IUndeployModelRequest} request UndeployModelRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.UndeployModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.undeployModel = function undeployModel(request, callback) { + return this.rpcCall(undeployModel, $root.google.cloud.automl.v1beta1.UndeployModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UndeployModel" }); + + /** + * Calls UndeployModel. + * @function undeployModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IUndeployModelRequest} request UndeployModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|exportModel}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef ExportModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportModel. + * @function exportModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IExportModelRequest} request ExportModelRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.ExportModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.exportModel = function exportModel(request, callback) { + return this.rpcCall(exportModel, $root.google.cloud.automl.v1beta1.ExportModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportModel" }); + + /** + * Calls ExportModel. + * @function exportModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IExportModelRequest} request ExportModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|exportEvaluatedExamples}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef ExportEvaluatedExamplesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportEvaluatedExamples. + * @function exportEvaluatedExamples + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest} request ExportEvaluatedExamplesRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.ExportEvaluatedExamplesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.exportEvaluatedExamples = function exportEvaluatedExamples(request, callback) { + return this.rpcCall(exportEvaluatedExamples, $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportEvaluatedExamples" }); + + /** + * Calls ExportEvaluatedExamples. + * @function exportEvaluatedExamples + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest} request ExportEvaluatedExamplesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getModelEvaluation}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef GetModelEvaluationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.ModelEvaluation} [response] ModelEvaluation + */ + + /** + * Calls GetModelEvaluation. + * @function getModelEvaluation + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetModelEvaluationRequest} request GetModelEvaluationRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.GetModelEvaluationCallback} callback Node-style callback called with the error, if any, and ModelEvaluation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getModelEvaluation = function getModelEvaluation(request, callback) { + return this.rpcCall(getModelEvaluation, $root.google.cloud.automl.v1beta1.GetModelEvaluationRequest, $root.google.cloud.automl.v1beta1.ModelEvaluation, request, callback); + }, "name", { value: "GetModelEvaluation" }); + + /** + * Calls GetModelEvaluation. + * @function getModelEvaluation + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetModelEvaluationRequest} request GetModelEvaluationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|listModelEvaluations}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef ListModelEvaluationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.ListModelEvaluationsResponse} [response] ListModelEvaluationsResponse + */ + + /** + * Calls ListModelEvaluations. + * @function listModelEvaluations + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IListModelEvaluationsRequest} request ListModelEvaluationsRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.ListModelEvaluationsCallback} callback Node-style callback called with the error, if any, and ListModelEvaluationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.listModelEvaluations = function listModelEvaluations(request, callback) { + return this.rpcCall(listModelEvaluations, $root.google.cloud.automl.v1beta1.ListModelEvaluationsRequest, $root.google.cloud.automl.v1beta1.ListModelEvaluationsResponse, request, callback); + }, "name", { value: "ListModelEvaluations" }); + + /** + * Calls ListModelEvaluations. + * @function listModelEvaluations + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IListModelEvaluationsRequest} request ListModelEvaluationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AutoMl; + })(); + + v1beta1.CreateDatasetRequest = (function() { + + /** + * Properties of a CreateDatasetRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface ICreateDatasetRequest + * @property {string|null} [parent] CreateDatasetRequest parent + * @property {google.cloud.automl.v1beta1.IDataset|null} [dataset] CreateDatasetRequest dataset + */ + + /** + * Constructs a new CreateDatasetRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a CreateDatasetRequest. + * @implements ICreateDatasetRequest + * @constructor + * @param {google.cloud.automl.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.automl.v1beta1.CreateDatasetRequest + * @instance + */ + CreateDatasetRequest.prototype.parent = ""; + + /** + * CreateDatasetRequest dataset. + * @member {google.cloud.automl.v1beta1.IDataset|null|undefined} dataset + * @memberof google.cloud.automl.v1beta1.CreateDatasetRequest + * @instance + */ + CreateDatasetRequest.prototype.dataset = null; + + /** + * Creates a new CreateDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.CreateDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.ICreateDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.CreateDatasetRequest} CreateDatasetRequest instance + */ + CreateDatasetRequest.create = function create(properties) { + return new CreateDatasetRequest(properties); + }; + + /** + * Encodes the specified CreateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.CreateDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.CreateDatasetRequest + * @static + * @param {google.cloud.automl.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.automl.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.automl.v1beta1.CreateDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.CreateDatasetRequest + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.v1beta1.CreateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.CreateDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.CreateDatasetRequest} CreateDatasetRequest + */ + CreateDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.CreateDatasetRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.CreateDatasetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.dataset != null) { + if (typeof object.dataset !== "object") + throw TypeError(".google.cloud.automl.v1beta1.CreateDatasetRequest.dataset: object expected"); + message.dataset = $root.google.cloud.automl.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.automl.v1beta1.CreateDatasetRequest + * @static + * @param {google.cloud.automl.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.automl.v1beta1.Dataset.toObject(message.dataset, options); + return object; + }; + + /** + * Converts this CreateDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.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.automl.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.automl.v1beta1.CreateDatasetRequest"; + }; + + return CreateDatasetRequest; + })(); + + v1beta1.GetDatasetRequest = (function() { + + /** + * Properties of a GetDatasetRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IGetDatasetRequest + * @property {string|null} [name] GetDatasetRequest name + */ + + /** + * Constructs a new GetDatasetRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a GetDatasetRequest. + * @implements IGetDatasetRequest + * @constructor + * @param {google.cloud.automl.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.automl.v1beta1.GetDatasetRequest + * @instance + */ + GetDatasetRequest.prototype.name = ""; + + /** + * Creates a new GetDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.GetDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.GetDatasetRequest} GetDatasetRequest instance + */ + GetDatasetRequest.create = function create(properties) { + return new GetDatasetRequest(properties); + }; + + /** + * Encodes the specified GetDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.GetDatasetRequest + * @static + * @param {google.cloud.automl.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.automl.v1beta1.GetDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.GetDatasetRequest + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.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.automl.v1beta1.GetDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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.automl.v1beta1.GetDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.GetDatasetRequest} GetDatasetRequest + */ + GetDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.GetDatasetRequest) + return object; + var message = new $root.google.cloud.automl.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.automl.v1beta1.GetDatasetRequest + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.GetDatasetRequest"; + }; + + return GetDatasetRequest; + })(); + + v1beta1.ListDatasetsRequest = (function() { + + /** + * Properties of a ListDatasetsRequest. + * @memberof google.cloud.automl.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.automl.v1beta1 + * @classdesc Represents a ListDatasetsRequest. + * @implements IListDatasetsRequest + * @constructor + * @param {google.cloud.automl.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.automl.v1beta1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.parent = ""; + + /** + * ListDatasetsRequest filter. + * @member {string} filter + * @memberof google.cloud.automl.v1beta1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.filter = ""; + + /** + * ListDatasetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.automl.v1beta1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.pageSize = 0; + + /** + * ListDatasetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.automl.v1beta1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDatasetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ListDatasetsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListDatasetsRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ListDatasetsRequest} ListDatasetsRequest instance + */ + ListDatasetsRequest.create = function create(properties) { + return new ListDatasetsRequest(properties); + }; + + /** + * Encodes the specified ListDatasetsRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ListDatasetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ListDatasetsRequest + * @static + * @param {google.cloud.automl.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 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListDatasetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ListDatasetsRequest + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.ListDatasetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 6: { + 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.automl.v1beta1.ListDatasetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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.automl.v1beta1.ListDatasetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ListDatasetsRequest} ListDatasetsRequest + */ + ListDatasetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ListDatasetsRequest) + return object; + var message = new $root.google.cloud.automl.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.automl.v1beta1.ListDatasetsRequest + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.ListDatasetsRequest"; + }; + + return ListDatasetsRequest; + })(); + + v1beta1.ListDatasetsResponse = (function() { + + /** + * Properties of a ListDatasetsResponse. + * @memberof google.cloud.automl.v1beta1 + * @interface IListDatasetsResponse + * @property {Array.|null} [datasets] ListDatasetsResponse datasets + * @property {string|null} [nextPageToken] ListDatasetsResponse nextPageToken + */ + + /** + * Constructs a new ListDatasetsResponse. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ListDatasetsResponse. + * @implements IListDatasetsResponse + * @constructor + * @param {google.cloud.automl.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.automl.v1beta1.ListDatasetsResponse + * @instance + */ + ListDatasetsResponse.prototype.datasets = $util.emptyArray; + + /** + * ListDatasetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.automl.v1beta1.ListDatasetsResponse + * @instance + */ + ListDatasetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDatasetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ListDatasetsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListDatasetsResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ListDatasetsResponse} ListDatasetsResponse instance + */ + ListDatasetsResponse.create = function create(properties) { + return new ListDatasetsResponse(properties); + }; + + /** + * Encodes the specified ListDatasetsResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.ListDatasetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ListDatasetsResponse + * @static + * @param {google.cloud.automl.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.automl.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.automl.v1beta1.ListDatasetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ListDatasetsResponse + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.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.automl.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.automl.v1beta1.ListDatasetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.ListDatasetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ListDatasetsResponse} ListDatasetsResponse + */ + ListDatasetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ListDatasetsResponse) + return object; + var message = new $root.google.cloud.automl.v1beta1.ListDatasetsResponse(); + if (object.datasets) { + if (!Array.isArray(object.datasets)) + throw TypeError(".google.cloud.automl.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.automl.v1beta1.ListDatasetsResponse.datasets: object expected"); + message.datasets[i] = $root.google.cloud.automl.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.automl.v1beta1.ListDatasetsResponse + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.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.automl.v1beta1.ListDatasetsResponse"; + }; + + return ListDatasetsResponse; + })(); + + v1beta1.UpdateDatasetRequest = (function() { + + /** + * Properties of an UpdateDatasetRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IUpdateDatasetRequest + * @property {google.cloud.automl.v1beta1.IDataset|null} [dataset] UpdateDatasetRequest dataset + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDatasetRequest updateMask + */ + + /** + * Constructs a new UpdateDatasetRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an UpdateDatasetRequest. + * @implements IUpdateDatasetRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IUpdateDatasetRequest=} [properties] Properties to set + */ + function UpdateDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDatasetRequest dataset. + * @member {google.cloud.automl.v1beta1.IDataset|null|undefined} dataset + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @instance + */ + UpdateDatasetRequest.prototype.dataset = null; + + /** + * UpdateDatasetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @instance + */ + UpdateDatasetRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.IUpdateDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.UpdateDatasetRequest} UpdateDatasetRequest instance + */ + UpdateDatasetRequest.create = function create(properties) { + return new UpdateDatasetRequest(properties); + }; + + /** + * Encodes the specified UpdateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.IUpdateDatasetRequest} message UpdateDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatasetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + $root.google.cloud.automl.v1beta1.Dataset.encode(message.dataset, 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 UpdateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.IUpdateDatasetRequest} message UpdateDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.UpdateDatasetRequest} UpdateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatasetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.UpdateDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataset = $root.google.cloud.automl.v1beta1.Dataset.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 UpdateDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.UpdateDatasetRequest} UpdateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDatasetRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDatasetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) { + var error = $root.google.cloud.automl.v1beta1.Dataset.verify(message.dataset); + if (error) + return "dataset." + 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 UpdateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.UpdateDatasetRequest} UpdateDatasetRequest + */ + UpdateDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.UpdateDatasetRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.UpdateDatasetRequest(); + if (object.dataset != null) { + if (typeof object.dataset !== "object") + throw TypeError(".google.cloud.automl.v1beta1.UpdateDatasetRequest.dataset: object expected"); + message.dataset = $root.google.cloud.automl.v1beta1.Dataset.fromObject(object.dataset); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.automl.v1beta1.UpdateDatasetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.UpdateDatasetRequest} message UpdateDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDatasetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = null; + object.updateMask = null; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = $root.google.cloud.automl.v1beta1.Dataset.toObject(message.dataset, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.UpdateDatasetRequest"; + }; + + return UpdateDatasetRequest; + })(); + + v1beta1.DeleteDatasetRequest = (function() { + + /** + * Properties of a DeleteDatasetRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IDeleteDatasetRequest + * @property {string|null} [name] DeleteDatasetRequest name + */ + + /** + * Constructs a new DeleteDatasetRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a DeleteDatasetRequest. + * @implements IDeleteDatasetRequest + * @constructor + * @param {google.cloud.automl.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.automl.v1beta1.DeleteDatasetRequest + * @instance + */ + DeleteDatasetRequest.prototype.name = ""; + + /** + * Creates a new DeleteDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.DeleteDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.IDeleteDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.DeleteDatasetRequest} DeleteDatasetRequest instance + */ + DeleteDatasetRequest.create = function create(properties) { + return new DeleteDatasetRequest(properties); + }; + + /** + * Encodes the specified DeleteDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.DeleteDatasetRequest + * @static + * @param {google.cloud.automl.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.automl.v1beta1.DeleteDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.DeleteDatasetRequest + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.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.automl.v1beta1.DeleteDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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.automl.v1beta1.DeleteDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.DeleteDatasetRequest} DeleteDatasetRequest + */ + DeleteDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.DeleteDatasetRequest) + return object; + var message = new $root.google.cloud.automl.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.automl.v1beta1.DeleteDatasetRequest + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.DeleteDatasetRequest"; + }; + + return DeleteDatasetRequest; + })(); + + v1beta1.ImportDataRequest = (function() { + + /** + * Properties of an ImportDataRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IImportDataRequest + * @property {string|null} [name] ImportDataRequest name + * @property {google.cloud.automl.v1beta1.IInputConfig|null} [inputConfig] ImportDataRequest inputConfig + */ + + /** + * Constructs a new ImportDataRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ImportDataRequest. + * @implements IImportDataRequest + * @constructor + * @param {google.cloud.automl.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.automl.v1beta1.ImportDataRequest + * @instance + */ + ImportDataRequest.prototype.name = ""; + + /** + * ImportDataRequest inputConfig. + * @member {google.cloud.automl.v1beta1.IInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1beta1.ImportDataRequest + * @instance + */ + ImportDataRequest.prototype.inputConfig = null; + + /** + * Creates a new ImportDataRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ImportDataRequest + * @static + * @param {google.cloud.automl.v1beta1.IImportDataRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ImportDataRequest} ImportDataRequest instance + */ + ImportDataRequest.create = function create(properties) { + return new ImportDataRequest(properties); + }; + + /** + * Encodes the specified ImportDataRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ImportDataRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ImportDataRequest + * @static + * @param {google.cloud.automl.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.automl.v1beta1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImportDataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ImportDataRequest + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.ImportDataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.inputConfig = $root.google.cloud.automl.v1beta1.InputConfig.decode(reader, reader.uint32()); + 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.automl.v1beta1.ImportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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.automl.v1beta1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + return null; + }; + + /** + * Creates an ImportDataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ImportDataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ImportDataRequest} ImportDataRequest + */ + ImportDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ImportDataRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.ImportDataRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ImportDataRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1beta1.InputConfig.fromObject(object.inputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ImportDataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ImportDataRequest + * @static + * @param {google.cloud.automl.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; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.automl.v1beta1.InputConfig.toObject(message.inputConfig, options); + return object; + }; + + /** + * Converts this ImportDataRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.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.automl.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.automl.v1beta1.ImportDataRequest"; + }; + + return ImportDataRequest; + })(); + + v1beta1.ExportDataRequest = (function() { + + /** + * Properties of an ExportDataRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IExportDataRequest + * @property {string|null} [name] ExportDataRequest name + * @property {google.cloud.automl.v1beta1.IOutputConfig|null} [outputConfig] ExportDataRequest outputConfig + */ + + /** + * Constructs a new ExportDataRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ExportDataRequest. + * @implements IExportDataRequest + * @constructor + * @param {google.cloud.automl.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.automl.v1beta1.ExportDataRequest + * @instance + */ + ExportDataRequest.prototype.name = ""; + + /** + * ExportDataRequest outputConfig. + * @member {google.cloud.automl.v1beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.automl.v1beta1.ExportDataRequest + * @instance + */ + ExportDataRequest.prototype.outputConfig = null; + + /** + * Creates a new ExportDataRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExportDataRequest + * @static + * @param {google.cloud.automl.v1beta1.IExportDataRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExportDataRequest} ExportDataRequest instance + */ + ExportDataRequest.create = function create(properties) { + return new ExportDataRequest(properties); + }; + + /** + * Encodes the specified ExportDataRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportDataRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExportDataRequest + * @static + * @param {google.cloud.automl.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.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.automl.v1beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportDataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportDataRequest + * @static + * @param {google.cloud.automl.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.automl.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.automl.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.automl.v1beta1.ExportDataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.outputConfig = $root.google.cloud.automl.v1beta1.OutputConfig.decode(reader, reader.uint32()); + 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.automl.v1beta1.ExportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.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.automl.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.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.automl.v1beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportDataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExportDataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExportDataRequest} ExportDataRequest + */ + ExportDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExportDataRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExportDataRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExportDataRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.automl.v1beta1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportDataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExportDataRequest + * @static + * @param {google.cloud.automl.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.outputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.automl.v1beta1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportDataRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.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.automl.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.automl.v1beta1.ExportDataRequest"; + }; + + return ExportDataRequest; + })(); + + v1beta1.GetAnnotationSpecRequest = (function() { + + /** + * Properties of a GetAnnotationSpecRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IGetAnnotationSpecRequest + * @property {string|null} [name] GetAnnotationSpecRequest name + */ + + /** + * Constructs a new GetAnnotationSpecRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a GetAnnotationSpecRequest. + * @implements IGetAnnotationSpecRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IGetAnnotationSpecRequest=} [properties] Properties to set + */ + function GetAnnotationSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAnnotationSpecRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @instance + */ + GetAnnotationSpecRequest.prototype.name = ""; + + /** + * Creates a new GetAnnotationSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetAnnotationSpecRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.GetAnnotationSpecRequest} GetAnnotationSpecRequest instance + */ + GetAnnotationSpecRequest.create = function create(properties) { + return new GetAnnotationSpecRequest(properties); + }; + + /** + * Encodes the specified GetAnnotationSpecRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetAnnotationSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetAnnotationSpecRequest} message GetAnnotationSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnnotationSpecRequest.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 GetAnnotationSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetAnnotationSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetAnnotationSpecRequest} message GetAnnotationSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnnotationSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAnnotationSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.GetAnnotationSpecRequest} GetAnnotationSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnnotationSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.GetAnnotationSpecRequest(); + 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 GetAnnotationSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.GetAnnotationSpecRequest} GetAnnotationSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnnotationSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAnnotationSpecRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAnnotationSpecRequest.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 GetAnnotationSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.GetAnnotationSpecRequest} GetAnnotationSpecRequest + */ + GetAnnotationSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.GetAnnotationSpecRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.GetAnnotationSpecRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAnnotationSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.GetAnnotationSpecRequest} message GetAnnotationSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAnnotationSpecRequest.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 GetAnnotationSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @instance + * @returns {Object.} JSON object + */ + GetAnnotationSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAnnotationSpecRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAnnotationSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.GetAnnotationSpecRequest"; + }; + + return GetAnnotationSpecRequest; + })(); + + v1beta1.GetTableSpecRequest = (function() { + + /** + * Properties of a GetTableSpecRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IGetTableSpecRequest + * @property {string|null} [name] GetTableSpecRequest name + * @property {google.protobuf.IFieldMask|null} [fieldMask] GetTableSpecRequest fieldMask + */ + + /** + * Constructs a new GetTableSpecRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a GetTableSpecRequest. + * @implements IGetTableSpecRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IGetTableSpecRequest=} [properties] Properties to set + */ + function GetTableSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTableSpecRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @instance + */ + GetTableSpecRequest.prototype.name = ""; + + /** + * GetTableSpecRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @instance + */ + GetTableSpecRequest.prototype.fieldMask = null; + + /** + * Creates a new GetTableSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetTableSpecRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.GetTableSpecRequest} GetTableSpecRequest instance + */ + GetTableSpecRequest.create = function create(properties) { + return new GetTableSpecRequest(properties); + }; + + /** + * Encodes the specified GetTableSpecRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetTableSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetTableSpecRequest} message GetTableSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTableSpecRequest.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.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTableSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetTableSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetTableSpecRequest} message GetTableSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTableSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTableSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.GetTableSpecRequest} GetTableSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTableSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.GetTableSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTableSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.GetTableSpecRequest} GetTableSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTableSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTableSpecRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTableSpecRequest.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.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + return null; + }; + + /** + * Creates a GetTableSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.GetTableSpecRequest} GetTableSpecRequest + */ + GetTableSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.GetTableSpecRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.GetTableSpecRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.automl.v1beta1.GetTableSpecRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + return message; + }; + + /** + * Creates a plain object from a GetTableSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.GetTableSpecRequest} message GetTableSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTableSpecRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.fieldMask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + return object; + }; + + /** + * Converts this GetTableSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @instance + * @returns {Object.} JSON object + */ + GetTableSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTableSpecRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTableSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.GetTableSpecRequest"; + }; + + return GetTableSpecRequest; + })(); + + v1beta1.ListTableSpecsRequest = (function() { + + /** + * Properties of a ListTableSpecsRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IListTableSpecsRequest + * @property {string|null} [parent] ListTableSpecsRequest parent + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListTableSpecsRequest fieldMask + * @property {string|null} [filter] ListTableSpecsRequest filter + * @property {number|null} [pageSize] ListTableSpecsRequest pageSize + * @property {string|null} [pageToken] ListTableSpecsRequest pageToken + */ + + /** + * Constructs a new ListTableSpecsRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ListTableSpecsRequest. + * @implements IListTableSpecsRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IListTableSpecsRequest=} [properties] Properties to set + */ + function ListTableSpecsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTableSpecsRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @instance + */ + ListTableSpecsRequest.prototype.parent = ""; + + /** + * ListTableSpecsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @instance + */ + ListTableSpecsRequest.prototype.fieldMask = null; + + /** + * ListTableSpecsRequest filter. + * @member {string} filter + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @instance + */ + ListTableSpecsRequest.prototype.filter = ""; + + /** + * ListTableSpecsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @instance + */ + ListTableSpecsRequest.prototype.pageSize = 0; + + /** + * ListTableSpecsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @instance + */ + ListTableSpecsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTableSpecsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListTableSpecsRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ListTableSpecsRequest} ListTableSpecsRequest instance + */ + ListTableSpecsRequest.create = function create(properties) { + return new ListTableSpecsRequest(properties); + }; + + /** + * Encodes the specified ListTableSpecsRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ListTableSpecsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListTableSpecsRequest} message ListTableSpecsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTableSpecsRequest.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.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListTableSpecsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListTableSpecsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListTableSpecsRequest} message ListTableSpecsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTableSpecsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTableSpecsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ListTableSpecsRequest} ListTableSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTableSpecsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ListTableSpecsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTableSpecsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ListTableSpecsRequest} ListTableSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTableSpecsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTableSpecsRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTableSpecsRequest.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.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + 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 ListTableSpecsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ListTableSpecsRequest} ListTableSpecsRequest + */ + ListTableSpecsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ListTableSpecsRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.ListTableSpecsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ListTableSpecsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + 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 ListTableSpecsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @static + * @param {google.cloud.automl.v1beta1.ListTableSpecsRequest} message ListTableSpecsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTableSpecsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.fieldMask = null; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + 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 ListTableSpecsRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTableSpecsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTableSpecsRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTableSpecsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ListTableSpecsRequest"; + }; + + return ListTableSpecsRequest; + })(); + + v1beta1.ListTableSpecsResponse = (function() { + + /** + * Properties of a ListTableSpecsResponse. + * @memberof google.cloud.automl.v1beta1 + * @interface IListTableSpecsResponse + * @property {Array.|null} [tableSpecs] ListTableSpecsResponse tableSpecs + * @property {string|null} [nextPageToken] ListTableSpecsResponse nextPageToken + */ + + /** + * Constructs a new ListTableSpecsResponse. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ListTableSpecsResponse. + * @implements IListTableSpecsResponse + * @constructor + * @param {google.cloud.automl.v1beta1.IListTableSpecsResponse=} [properties] Properties to set + */ + function ListTableSpecsResponse(properties) { + this.tableSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTableSpecsResponse tableSpecs. + * @member {Array.} tableSpecs + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @instance + */ + ListTableSpecsResponse.prototype.tableSpecs = $util.emptyArray; + + /** + * ListTableSpecsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @instance + */ + ListTableSpecsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTableSpecsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListTableSpecsResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ListTableSpecsResponse} ListTableSpecsResponse instance + */ + ListTableSpecsResponse.create = function create(properties) { + return new ListTableSpecsResponse(properties); + }; + + /** + * Encodes the specified ListTableSpecsResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.ListTableSpecsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListTableSpecsResponse} message ListTableSpecsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTableSpecsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableSpecs != null && message.tableSpecs.length) + for (var i = 0; i < message.tableSpecs.length; ++i) + $root.google.cloud.automl.v1beta1.TableSpec.encode(message.tableSpecs[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 ListTableSpecsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListTableSpecsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListTableSpecsResponse} message ListTableSpecsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTableSpecsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTableSpecsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ListTableSpecsResponse} ListTableSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTableSpecsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ListTableSpecsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tableSpecs && message.tableSpecs.length)) + message.tableSpecs = []; + message.tableSpecs.push($root.google.cloud.automl.v1beta1.TableSpec.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTableSpecsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ListTableSpecsResponse} ListTableSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTableSpecsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTableSpecsResponse message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTableSpecsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tableSpecs != null && message.hasOwnProperty("tableSpecs")) { + if (!Array.isArray(message.tableSpecs)) + return "tableSpecs: array expected"; + for (var i = 0; i < message.tableSpecs.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.TableSpec.verify(message.tableSpecs[i]); + if (error) + return "tableSpecs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTableSpecsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ListTableSpecsResponse} ListTableSpecsResponse + */ + ListTableSpecsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ListTableSpecsResponse) + return object; + var message = new $root.google.cloud.automl.v1beta1.ListTableSpecsResponse(); + if (object.tableSpecs) { + if (!Array.isArray(object.tableSpecs)) + throw TypeError(".google.cloud.automl.v1beta1.ListTableSpecsResponse.tableSpecs: array expected"); + message.tableSpecs = []; + for (var i = 0; i < object.tableSpecs.length; ++i) { + if (typeof object.tableSpecs[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ListTableSpecsResponse.tableSpecs: object expected"); + message.tableSpecs[i] = $root.google.cloud.automl.v1beta1.TableSpec.fromObject(object.tableSpecs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTableSpecsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @static + * @param {google.cloud.automl.v1beta1.ListTableSpecsResponse} message ListTableSpecsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTableSpecsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tableSpecs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.tableSpecs && message.tableSpecs.length) { + object.tableSpecs = []; + for (var j = 0; j < message.tableSpecs.length; ++j) + object.tableSpecs[j] = $root.google.cloud.automl.v1beta1.TableSpec.toObject(message.tableSpecs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTableSpecsResponse to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTableSpecsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTableSpecsResponse + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTableSpecsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ListTableSpecsResponse"; + }; + + return ListTableSpecsResponse; + })(); + + v1beta1.UpdateTableSpecRequest = (function() { + + /** + * Properties of an UpdateTableSpecRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IUpdateTableSpecRequest + * @property {google.cloud.automl.v1beta1.ITableSpec|null} [tableSpec] UpdateTableSpecRequest tableSpec + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTableSpecRequest updateMask + */ + + /** + * Constructs a new UpdateTableSpecRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an UpdateTableSpecRequest. + * @implements IUpdateTableSpecRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IUpdateTableSpecRequest=} [properties] Properties to set + */ + function UpdateTableSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTableSpecRequest tableSpec. + * @member {google.cloud.automl.v1beta1.ITableSpec|null|undefined} tableSpec + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @instance + */ + UpdateTableSpecRequest.prototype.tableSpec = null; + + /** + * UpdateTableSpecRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @instance + */ + UpdateTableSpecRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateTableSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IUpdateTableSpecRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.UpdateTableSpecRequest} UpdateTableSpecRequest instance + */ + UpdateTableSpecRequest.create = function create(properties) { + return new UpdateTableSpecRequest(properties); + }; + + /** + * Encodes the specified UpdateTableSpecRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateTableSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IUpdateTableSpecRequest} message UpdateTableSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTableSpecRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableSpec != null && Object.hasOwnProperty.call(message, "tableSpec")) + $root.google.cloud.automl.v1beta1.TableSpec.encode(message.tableSpec, 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 UpdateTableSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateTableSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IUpdateTableSpecRequest} message UpdateTableSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTableSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTableSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.UpdateTableSpecRequest} UpdateTableSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTableSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.UpdateTableSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tableSpec = $root.google.cloud.automl.v1beta1.TableSpec.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 UpdateTableSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.UpdateTableSpecRequest} UpdateTableSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTableSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTableSpecRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTableSpecRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tableSpec != null && message.hasOwnProperty("tableSpec")) { + var error = $root.google.cloud.automl.v1beta1.TableSpec.verify(message.tableSpec); + if (error) + return "tableSpec." + 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 UpdateTableSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.UpdateTableSpecRequest} UpdateTableSpecRequest + */ + UpdateTableSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.UpdateTableSpecRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.UpdateTableSpecRequest(); + if (object.tableSpec != null) { + if (typeof object.tableSpec !== "object") + throw TypeError(".google.cloud.automl.v1beta1.UpdateTableSpecRequest.tableSpec: object expected"); + message.tableSpec = $root.google.cloud.automl.v1beta1.TableSpec.fromObject(object.tableSpec); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.automl.v1beta1.UpdateTableSpecRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateTableSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.UpdateTableSpecRequest} message UpdateTableSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTableSpecRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tableSpec = null; + object.updateMask = null; + } + if (message.tableSpec != null && message.hasOwnProperty("tableSpec")) + object.tableSpec = $root.google.cloud.automl.v1beta1.TableSpec.toObject(message.tableSpec, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateTableSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTableSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTableSpecRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTableSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.UpdateTableSpecRequest"; + }; + + return UpdateTableSpecRequest; + })(); + + v1beta1.GetColumnSpecRequest = (function() { + + /** + * Properties of a GetColumnSpecRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IGetColumnSpecRequest + * @property {string|null} [name] GetColumnSpecRequest name + * @property {google.protobuf.IFieldMask|null} [fieldMask] GetColumnSpecRequest fieldMask + */ + + /** + * Constructs a new GetColumnSpecRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a GetColumnSpecRequest. + * @implements IGetColumnSpecRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IGetColumnSpecRequest=} [properties] Properties to set + */ + function GetColumnSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetColumnSpecRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @instance + */ + GetColumnSpecRequest.prototype.name = ""; + + /** + * GetColumnSpecRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @instance + */ + GetColumnSpecRequest.prototype.fieldMask = null; + + /** + * Creates a new GetColumnSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetColumnSpecRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.GetColumnSpecRequest} GetColumnSpecRequest instance + */ + GetColumnSpecRequest.create = function create(properties) { + return new GetColumnSpecRequest(properties); + }; + + /** + * Encodes the specified GetColumnSpecRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetColumnSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetColumnSpecRequest} message GetColumnSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetColumnSpecRequest.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.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetColumnSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetColumnSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetColumnSpecRequest} message GetColumnSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetColumnSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetColumnSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.GetColumnSpecRequest} GetColumnSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetColumnSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.GetColumnSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetColumnSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.GetColumnSpecRequest} GetColumnSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetColumnSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetColumnSpecRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetColumnSpecRequest.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.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + return null; + }; + + /** + * Creates a GetColumnSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.GetColumnSpecRequest} GetColumnSpecRequest + */ + GetColumnSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.GetColumnSpecRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.GetColumnSpecRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.automl.v1beta1.GetColumnSpecRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + return message; + }; + + /** + * Creates a plain object from a GetColumnSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.GetColumnSpecRequest} message GetColumnSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetColumnSpecRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.fieldMask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + return object; + }; + + /** + * Converts this GetColumnSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @instance + * @returns {Object.} JSON object + */ + GetColumnSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetColumnSpecRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetColumnSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.GetColumnSpecRequest"; + }; + + return GetColumnSpecRequest; + })(); + + v1beta1.ListColumnSpecsRequest = (function() { + + /** + * Properties of a ListColumnSpecsRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IListColumnSpecsRequest + * @property {string|null} [parent] ListColumnSpecsRequest parent + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListColumnSpecsRequest fieldMask + * @property {string|null} [filter] ListColumnSpecsRequest filter + * @property {number|null} [pageSize] ListColumnSpecsRequest pageSize + * @property {string|null} [pageToken] ListColumnSpecsRequest pageToken + */ + + /** + * Constructs a new ListColumnSpecsRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ListColumnSpecsRequest. + * @implements IListColumnSpecsRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IListColumnSpecsRequest=} [properties] Properties to set + */ + function ListColumnSpecsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListColumnSpecsRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @instance + */ + ListColumnSpecsRequest.prototype.parent = ""; + + /** + * ListColumnSpecsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @instance + */ + ListColumnSpecsRequest.prototype.fieldMask = null; + + /** + * ListColumnSpecsRequest filter. + * @member {string} filter + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @instance + */ + ListColumnSpecsRequest.prototype.filter = ""; + + /** + * ListColumnSpecsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @instance + */ + ListColumnSpecsRequest.prototype.pageSize = 0; + + /** + * ListColumnSpecsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @instance + */ + ListColumnSpecsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListColumnSpecsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListColumnSpecsRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ListColumnSpecsRequest} ListColumnSpecsRequest instance + */ + ListColumnSpecsRequest.create = function create(properties) { + return new ListColumnSpecsRequest(properties); + }; + + /** + * Encodes the specified ListColumnSpecsRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ListColumnSpecsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListColumnSpecsRequest} message ListColumnSpecsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListColumnSpecsRequest.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.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListColumnSpecsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListColumnSpecsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListColumnSpecsRequest} message ListColumnSpecsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListColumnSpecsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListColumnSpecsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ListColumnSpecsRequest} ListColumnSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListColumnSpecsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ListColumnSpecsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListColumnSpecsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ListColumnSpecsRequest} ListColumnSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListColumnSpecsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListColumnSpecsRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListColumnSpecsRequest.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.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + 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 ListColumnSpecsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ListColumnSpecsRequest} ListColumnSpecsRequest + */ + ListColumnSpecsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ListColumnSpecsRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.ListColumnSpecsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ListColumnSpecsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + 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 ListColumnSpecsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @static + * @param {google.cloud.automl.v1beta1.ListColumnSpecsRequest} message ListColumnSpecsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListColumnSpecsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.fieldMask = null; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + 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 ListColumnSpecsRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @instance + * @returns {Object.} JSON object + */ + ListColumnSpecsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListColumnSpecsRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListColumnSpecsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ListColumnSpecsRequest"; + }; + + return ListColumnSpecsRequest; + })(); + + v1beta1.ListColumnSpecsResponse = (function() { + + /** + * Properties of a ListColumnSpecsResponse. + * @memberof google.cloud.automl.v1beta1 + * @interface IListColumnSpecsResponse + * @property {Array.|null} [columnSpecs] ListColumnSpecsResponse columnSpecs + * @property {string|null} [nextPageToken] ListColumnSpecsResponse nextPageToken + */ + + /** + * Constructs a new ListColumnSpecsResponse. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ListColumnSpecsResponse. + * @implements IListColumnSpecsResponse + * @constructor + * @param {google.cloud.automl.v1beta1.IListColumnSpecsResponse=} [properties] Properties to set + */ + function ListColumnSpecsResponse(properties) { + this.columnSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListColumnSpecsResponse columnSpecs. + * @member {Array.} columnSpecs + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @instance + */ + ListColumnSpecsResponse.prototype.columnSpecs = $util.emptyArray; + + /** + * ListColumnSpecsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @instance + */ + ListColumnSpecsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListColumnSpecsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListColumnSpecsResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ListColumnSpecsResponse} ListColumnSpecsResponse instance + */ + ListColumnSpecsResponse.create = function create(properties) { + return new ListColumnSpecsResponse(properties); + }; + + /** + * Encodes the specified ListColumnSpecsResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.ListColumnSpecsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListColumnSpecsResponse} message ListColumnSpecsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListColumnSpecsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columnSpecs != null && message.columnSpecs.length) + for (var i = 0; i < message.columnSpecs.length; ++i) + $root.google.cloud.automl.v1beta1.ColumnSpec.encode(message.columnSpecs[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 ListColumnSpecsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListColumnSpecsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListColumnSpecsResponse} message ListColumnSpecsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListColumnSpecsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListColumnSpecsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ListColumnSpecsResponse} ListColumnSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListColumnSpecsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ListColumnSpecsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.columnSpecs && message.columnSpecs.length)) + message.columnSpecs = []; + message.columnSpecs.push($root.google.cloud.automl.v1beta1.ColumnSpec.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListColumnSpecsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ListColumnSpecsResponse} ListColumnSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListColumnSpecsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListColumnSpecsResponse message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListColumnSpecsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columnSpecs != null && message.hasOwnProperty("columnSpecs")) { + if (!Array.isArray(message.columnSpecs)) + return "columnSpecs: array expected"; + for (var i = 0; i < message.columnSpecs.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.ColumnSpec.verify(message.columnSpecs[i]); + if (error) + return "columnSpecs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListColumnSpecsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ListColumnSpecsResponse} ListColumnSpecsResponse + */ + ListColumnSpecsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ListColumnSpecsResponse) + return object; + var message = new $root.google.cloud.automl.v1beta1.ListColumnSpecsResponse(); + if (object.columnSpecs) { + if (!Array.isArray(object.columnSpecs)) + throw TypeError(".google.cloud.automl.v1beta1.ListColumnSpecsResponse.columnSpecs: array expected"); + message.columnSpecs = []; + for (var i = 0; i < object.columnSpecs.length; ++i) { + if (typeof object.columnSpecs[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ListColumnSpecsResponse.columnSpecs: object expected"); + message.columnSpecs[i] = $root.google.cloud.automl.v1beta1.ColumnSpec.fromObject(object.columnSpecs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListColumnSpecsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @static + * @param {google.cloud.automl.v1beta1.ListColumnSpecsResponse} message ListColumnSpecsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListColumnSpecsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.columnSpecs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.columnSpecs && message.columnSpecs.length) { + object.columnSpecs = []; + for (var j = 0; j < message.columnSpecs.length; ++j) + object.columnSpecs[j] = $root.google.cloud.automl.v1beta1.ColumnSpec.toObject(message.columnSpecs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListColumnSpecsResponse to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @instance + * @returns {Object.} JSON object + */ + ListColumnSpecsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListColumnSpecsResponse + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListColumnSpecsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ListColumnSpecsResponse"; + }; + + return ListColumnSpecsResponse; + })(); + + v1beta1.UpdateColumnSpecRequest = (function() { + + /** + * Properties of an UpdateColumnSpecRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IUpdateColumnSpecRequest + * @property {google.cloud.automl.v1beta1.IColumnSpec|null} [columnSpec] UpdateColumnSpecRequest columnSpec + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateColumnSpecRequest updateMask + */ + + /** + * Constructs a new UpdateColumnSpecRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an UpdateColumnSpecRequest. + * @implements IUpdateColumnSpecRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IUpdateColumnSpecRequest=} [properties] Properties to set + */ + function UpdateColumnSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateColumnSpecRequest columnSpec. + * @member {google.cloud.automl.v1beta1.IColumnSpec|null|undefined} columnSpec + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @instance + */ + UpdateColumnSpecRequest.prototype.columnSpec = null; + + /** + * UpdateColumnSpecRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @instance + */ + UpdateColumnSpecRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateColumnSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IUpdateColumnSpecRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.UpdateColumnSpecRequest} UpdateColumnSpecRequest instance + */ + UpdateColumnSpecRequest.create = function create(properties) { + return new UpdateColumnSpecRequest(properties); + }; + + /** + * Encodes the specified UpdateColumnSpecRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateColumnSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IUpdateColumnSpecRequest} message UpdateColumnSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateColumnSpecRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columnSpec != null && Object.hasOwnProperty.call(message, "columnSpec")) + $root.google.cloud.automl.v1beta1.ColumnSpec.encode(message.columnSpec, 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 UpdateColumnSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateColumnSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IUpdateColumnSpecRequest} message UpdateColumnSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateColumnSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateColumnSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.UpdateColumnSpecRequest} UpdateColumnSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateColumnSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.UpdateColumnSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.columnSpec = $root.google.cloud.automl.v1beta1.ColumnSpec.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 UpdateColumnSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.UpdateColumnSpecRequest} UpdateColumnSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateColumnSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateColumnSpecRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateColumnSpecRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columnSpec != null && message.hasOwnProperty("columnSpec")) { + var error = $root.google.cloud.automl.v1beta1.ColumnSpec.verify(message.columnSpec); + if (error) + return "columnSpec." + 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 UpdateColumnSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.UpdateColumnSpecRequest} UpdateColumnSpecRequest + */ + UpdateColumnSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.UpdateColumnSpecRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.UpdateColumnSpecRequest(); + if (object.columnSpec != null) { + if (typeof object.columnSpec !== "object") + throw TypeError(".google.cloud.automl.v1beta1.UpdateColumnSpecRequest.columnSpec: object expected"); + message.columnSpec = $root.google.cloud.automl.v1beta1.ColumnSpec.fromObject(object.columnSpec); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.automl.v1beta1.UpdateColumnSpecRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateColumnSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.UpdateColumnSpecRequest} message UpdateColumnSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateColumnSpecRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.columnSpec = null; + object.updateMask = null; + } + if (message.columnSpec != null && message.hasOwnProperty("columnSpec")) + object.columnSpec = $root.google.cloud.automl.v1beta1.ColumnSpec.toObject(message.columnSpec, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateColumnSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateColumnSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateColumnSpecRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateColumnSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.UpdateColumnSpecRequest"; + }; + + return UpdateColumnSpecRequest; + })(); + + v1beta1.CreateModelRequest = (function() { + + /** + * Properties of a CreateModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface ICreateModelRequest + * @property {string|null} [parent] CreateModelRequest parent + * @property {google.cloud.automl.v1beta1.IModel|null} [model] CreateModelRequest model + */ + + /** + * Constructs a new CreateModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a CreateModelRequest. + * @implements ICreateModelRequest + * @constructor + * @param {google.cloud.automl.v1beta1.ICreateModelRequest=} [properties] Properties to set + */ + function CreateModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateModelRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @instance + */ + CreateModelRequest.prototype.parent = ""; + + /** + * CreateModelRequest model. + * @member {google.cloud.automl.v1beta1.IModel|null|undefined} model + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @instance + */ + CreateModelRequest.prototype.model = null; + + /** + * Creates a new CreateModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @static + * @param {google.cloud.automl.v1beta1.ICreateModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.CreateModelRequest} CreateModelRequest instance + */ + CreateModelRequest.create = function create(properties) { + return new CreateModelRequest(properties); + }; + + /** + * Encodes the specified CreateModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.CreateModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @static + * @param {google.cloud.automl.v1beta1.ICreateModelRequest} message CreateModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateModelRequest.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.model != null && Object.hasOwnProperty.call(message, "model")) + $root.google.cloud.automl.v1beta1.Model.encode(message.model, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CreateModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @static + * @param {google.cloud.automl.v1beta1.ICreateModelRequest} message CreateModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.CreateModelRequest} CreateModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.CreateModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 4: { + message.model = $root.google.cloud.automl.v1beta1.Model.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.CreateModelRequest} CreateModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateModelRequest.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.model != null && message.hasOwnProperty("model")) { + var error = $root.google.cloud.automl.v1beta1.Model.verify(message.model); + if (error) + return "model." + error; + } + return null; + }; + + /** + * Creates a CreateModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.CreateModelRequest} CreateModelRequest + */ + CreateModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.CreateModelRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.CreateModelRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.model != null) { + if (typeof object.model !== "object") + throw TypeError(".google.cloud.automl.v1beta1.CreateModelRequest.model: object expected"); + message.model = $root.google.cloud.automl.v1beta1.Model.fromObject(object.model); + } + return message; + }; + + /** + * Creates a plain object from a CreateModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @static + * @param {google.cloud.automl.v1beta1.CreateModelRequest} message CreateModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.model = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.model != null && message.hasOwnProperty("model")) + object.model = $root.google.cloud.automl.v1beta1.Model.toObject(message.model, options); + return object; + }; + + /** + * Converts this CreateModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @instance + * @returns {Object.} JSON object + */ + CreateModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.CreateModelRequest"; + }; + + return CreateModelRequest; + })(); + + v1beta1.GetModelRequest = (function() { + + /** + * Properties of a GetModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IGetModelRequest + * @property {string|null} [name] GetModelRequest name + */ + + /** + * Constructs a new GetModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a GetModelRequest. + * @implements IGetModelRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IGetModelRequest=} [properties] Properties to set + */ + function GetModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @instance + */ + GetModelRequest.prototype.name = ""; + + /** + * Creates a new GetModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.GetModelRequest} GetModelRequest instance + */ + GetModelRequest.create = function create(properties) { + return new GetModelRequest(properties); + }; + + /** + * Encodes the specified GetModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetModelRequest} message GetModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelRequest.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 GetModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetModelRequest} message GetModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.GetModelRequest} GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.GetModelRequest(); + 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 GetModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.GetModelRequest} GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetModelRequest.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 GetModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.GetModelRequest} GetModelRequest + */ + GetModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.GetModelRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.GetModelRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @static + * @param {google.cloud.automl.v1beta1.GetModelRequest} message GetModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetModelRequest.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 GetModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @instance + * @returns {Object.} JSON object + */ + GetModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.GetModelRequest"; + }; + + return GetModelRequest; + })(); + + v1beta1.ListModelsRequest = (function() { + + /** + * Properties of a ListModelsRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IListModelsRequest + * @property {string|null} [parent] ListModelsRequest parent + * @property {string|null} [filter] ListModelsRequest filter + * @property {number|null} [pageSize] ListModelsRequest pageSize + * @property {string|null} [pageToken] ListModelsRequest pageToken + */ + + /** + * Constructs a new ListModelsRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ListModelsRequest. + * @implements IListModelsRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IListModelsRequest=} [properties] Properties to set + */ + function ListModelsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelsRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.parent = ""; + + /** + * ListModelsRequest filter. + * @member {string} filter + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.filter = ""; + + /** + * ListModelsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.pageSize = 0; + + /** + * ListModelsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListModelsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListModelsRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ListModelsRequest} ListModelsRequest instance + */ + ListModelsRequest.create = function create(properties) { + return new ListModelsRequest(properties); + }; + + /** + * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListModelsRequest} message ListModelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsRequest.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 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListModelsRequest} message ListModelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ListModelsRequest} ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ListModelsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ListModelsRequest} ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelsRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelsRequest.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 ListModelsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ListModelsRequest} ListModelsRequest + */ + ListModelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ListModelsRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.ListModelsRequest(); + 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 ListModelsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @static + * @param {google.cloud.automl.v1beta1.ListModelsRequest} message ListModelsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelsRequest.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 ListModelsRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @instance + * @returns {Object.} JSON object + */ + ListModelsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelsRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ListModelsRequest"; + }; + + return ListModelsRequest; + })(); + + v1beta1.ListModelsResponse = (function() { + + /** + * Properties of a ListModelsResponse. + * @memberof google.cloud.automl.v1beta1 + * @interface IListModelsResponse + * @property {Array.|null} [model] ListModelsResponse model + * @property {string|null} [nextPageToken] ListModelsResponse nextPageToken + */ + + /** + * Constructs a new ListModelsResponse. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ListModelsResponse. + * @implements IListModelsResponse + * @constructor + * @param {google.cloud.automl.v1beta1.IListModelsResponse=} [properties] Properties to set + */ + function ListModelsResponse(properties) { + this.model = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelsResponse model. + * @member {Array.} model + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @instance + */ + ListModelsResponse.prototype.model = $util.emptyArray; + + /** + * ListModelsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @instance + */ + ListModelsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListModelsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListModelsResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ListModelsResponse} ListModelsResponse instance + */ + ListModelsResponse.create = function create(properties) { + return new ListModelsResponse(properties); + }; + + /** + * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListModelsResponse} message ListModelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && message.model.length) + for (var i = 0; i < message.model.length; ++i) + $root.google.cloud.automl.v1beta1.Model.encode(message.model[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 ListModelsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListModelsResponse} message ListModelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ListModelsResponse} ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ListModelsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.model && message.model.length)) + message.model = []; + message.model.push($root.google.cloud.automl.v1beta1.Model.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ListModelsResponse} ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelsResponse message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) { + if (!Array.isArray(message.model)) + return "model: array expected"; + for (var i = 0; i < message.model.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.Model.verify(message.model[i]); + if (error) + return "model." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ListModelsResponse} ListModelsResponse + */ + ListModelsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ListModelsResponse) + return object; + var message = new $root.google.cloud.automl.v1beta1.ListModelsResponse(); + if (object.model) { + if (!Array.isArray(object.model)) + throw TypeError(".google.cloud.automl.v1beta1.ListModelsResponse.model: array expected"); + message.model = []; + for (var i = 0; i < object.model.length; ++i) { + if (typeof object.model[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ListModelsResponse.model: object expected"); + message.model[i] = $root.google.cloud.automl.v1beta1.Model.fromObject(object.model[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @static + * @param {google.cloud.automl.v1beta1.ListModelsResponse} message ListModelsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.model = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.model && message.model.length) { + object.model = []; + for (var j = 0; j < message.model.length; ++j) + object.model[j] = $root.google.cloud.automl.v1beta1.Model.toObject(message.model[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListModelsResponse to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @instance + * @returns {Object.} JSON object + */ + ListModelsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelsResponse + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ListModelsResponse"; + }; + + return ListModelsResponse; + })(); + + v1beta1.DeleteModelRequest = (function() { + + /** + * Properties of a DeleteModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IDeleteModelRequest + * @property {string|null} [name] DeleteModelRequest name + */ + + /** + * Constructs a new DeleteModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a DeleteModelRequest. + * @implements IDeleteModelRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IDeleteModelRequest=} [properties] Properties to set + */ + function DeleteModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @instance + */ + DeleteModelRequest.prototype.name = ""; + + /** + * Creates a new DeleteModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IDeleteModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.DeleteModelRequest} DeleteModelRequest instance + */ + DeleteModelRequest.create = function create(properties) { + return new DeleteModelRequest(properties); + }; + + /** + * Encodes the specified DeleteModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteModelRequest.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 DeleteModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.DeleteModelRequest} DeleteModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.DeleteModelRequest(); + 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 DeleteModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.DeleteModelRequest} DeleteModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteModelRequest.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 DeleteModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.DeleteModelRequest} DeleteModelRequest + */ + DeleteModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.DeleteModelRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.DeleteModelRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @static + * @param {google.cloud.automl.v1beta1.DeleteModelRequest} message DeleteModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteModelRequest.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 DeleteModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.DeleteModelRequest"; + }; + + return DeleteModelRequest; + })(); + + v1beta1.DeployModelRequest = (function() { + + /** + * Properties of a DeployModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IDeployModelRequest + * @property {google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata|null} [imageObjectDetectionModelDeploymentMetadata] DeployModelRequest imageObjectDetectionModelDeploymentMetadata + * @property {google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata|null} [imageClassificationModelDeploymentMetadata] DeployModelRequest imageClassificationModelDeploymentMetadata + * @property {string|null} [name] DeployModelRequest name + */ + + /** + * Constructs a new DeployModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a DeployModelRequest. + * @implements IDeployModelRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IDeployModelRequest=} [properties] Properties to set + */ + function DeployModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployModelRequest imageObjectDetectionModelDeploymentMetadata. + * @member {google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata|null|undefined} imageObjectDetectionModelDeploymentMetadata + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @instance + */ + DeployModelRequest.prototype.imageObjectDetectionModelDeploymentMetadata = null; + + /** + * DeployModelRequest imageClassificationModelDeploymentMetadata. + * @member {google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata|null|undefined} imageClassificationModelDeploymentMetadata + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @instance + */ + DeployModelRequest.prototype.imageClassificationModelDeploymentMetadata = null; + + /** + * DeployModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @instance + */ + DeployModelRequest.prototype.name = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeployModelRequest modelDeploymentMetadata. + * @member {"imageObjectDetectionModelDeploymentMetadata"|"imageClassificationModelDeploymentMetadata"|undefined} modelDeploymentMetadata + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @instance + */ + Object.defineProperty(DeployModelRequest.prototype, "modelDeploymentMetadata", { + get: $util.oneOfGetter($oneOfFields = ["imageObjectDetectionModelDeploymentMetadata", "imageClassificationModelDeploymentMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeployModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IDeployModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.DeployModelRequest} DeployModelRequest instance + */ + DeployModelRequest.create = function create(properties) { + return new DeployModelRequest(properties); + }; + + /** + * Encodes the specified DeployModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.DeployModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IDeployModelRequest} message DeployModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployModelRequest.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.imageObjectDetectionModelDeploymentMetadata != null && Object.hasOwnProperty.call(message, "imageObjectDetectionModelDeploymentMetadata")) + $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.encode(message.imageObjectDetectionModelDeploymentMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageClassificationModelDeploymentMetadata != null && Object.hasOwnProperty.call(message, "imageClassificationModelDeploymentMetadata")) + $root.google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata.encode(message.imageClassificationModelDeploymentMetadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DeployModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IDeployModelRequest} message DeployModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.DeployModelRequest} DeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.DeployModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.imageObjectDetectionModelDeploymentMetadata = $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.decode(reader, reader.uint32()); + break; + } + case 4: { + message.imageClassificationModelDeploymentMetadata = $root.google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.DeployModelRequest} DeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployModelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.imageObjectDetectionModelDeploymentMetadata != null && message.hasOwnProperty("imageObjectDetectionModelDeploymentMetadata")) { + properties.modelDeploymentMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.verify(message.imageObjectDetectionModelDeploymentMetadata); + if (error) + return "imageObjectDetectionModelDeploymentMetadata." + error; + } + } + if (message.imageClassificationModelDeploymentMetadata != null && message.hasOwnProperty("imageClassificationModelDeploymentMetadata")) { + if (properties.modelDeploymentMetadata === 1) + return "modelDeploymentMetadata: multiple values"; + properties.modelDeploymentMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata.verify(message.imageClassificationModelDeploymentMetadata); + if (error) + return "imageClassificationModelDeploymentMetadata." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeployModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.DeployModelRequest} DeployModelRequest + */ + DeployModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.DeployModelRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.DeployModelRequest(); + if (object.imageObjectDetectionModelDeploymentMetadata != null) { + if (typeof object.imageObjectDetectionModelDeploymentMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DeployModelRequest.imageObjectDetectionModelDeploymentMetadata: object expected"); + message.imageObjectDetectionModelDeploymentMetadata = $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.fromObject(object.imageObjectDetectionModelDeploymentMetadata); + } + if (object.imageClassificationModelDeploymentMetadata != null) { + if (typeof object.imageClassificationModelDeploymentMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DeployModelRequest.imageClassificationModelDeploymentMetadata: object expected"); + message.imageClassificationModelDeploymentMetadata = $root.google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata.fromObject(object.imageClassificationModelDeploymentMetadata); + } + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeployModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @static + * @param {google.cloud.automl.v1beta1.DeployModelRequest} message DeployModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployModelRequest.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.imageObjectDetectionModelDeploymentMetadata != null && message.hasOwnProperty("imageObjectDetectionModelDeploymentMetadata")) { + object.imageObjectDetectionModelDeploymentMetadata = $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.toObject(message.imageObjectDetectionModelDeploymentMetadata, options); + if (options.oneofs) + object.modelDeploymentMetadata = "imageObjectDetectionModelDeploymentMetadata"; + } + if (message.imageClassificationModelDeploymentMetadata != null && message.hasOwnProperty("imageClassificationModelDeploymentMetadata")) { + object.imageClassificationModelDeploymentMetadata = $root.google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata.toObject(message.imageClassificationModelDeploymentMetadata, options); + if (options.oneofs) + object.modelDeploymentMetadata = "imageClassificationModelDeploymentMetadata"; + } + return object; + }; + + /** + * Converts this DeployModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @instance + * @returns {Object.} JSON object + */ + DeployModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.DeployModelRequest"; + }; + + return DeployModelRequest; + })(); + + v1beta1.UndeployModelRequest = (function() { + + /** + * Properties of an UndeployModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IUndeployModelRequest + * @property {string|null} [name] UndeployModelRequest name + */ + + /** + * Constructs a new UndeployModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an UndeployModelRequest. + * @implements IUndeployModelRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IUndeployModelRequest=} [properties] Properties to set + */ + function UndeployModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeployModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @instance + */ + UndeployModelRequest.prototype.name = ""; + + /** + * Creates a new UndeployModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IUndeployModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.UndeployModelRequest} UndeployModelRequest instance + */ + UndeployModelRequest.create = function create(properties) { + return new UndeployModelRequest(properties); + }; + + /** + * Encodes the specified UndeployModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.UndeployModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IUndeployModelRequest} message UndeployModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployModelRequest.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 UndeployModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.UndeployModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IUndeployModelRequest} message UndeployModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeployModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.UndeployModelRequest} UndeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.UndeployModelRequest(); + 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 an UndeployModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.UndeployModelRequest} UndeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeployModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeployModelRequest.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 an UndeployModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.UndeployModelRequest} UndeployModelRequest + */ + UndeployModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.UndeployModelRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.UndeployModelRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an UndeployModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @static + * @param {google.cloud.automl.v1beta1.UndeployModelRequest} message UndeployModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeployModelRequest.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 UndeployModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @instance + * @returns {Object.} JSON object + */ + UndeployModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeployModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeployModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.UndeployModelRequest"; + }; + + return UndeployModelRequest; + })(); + + v1beta1.ExportModelRequest = (function() { + + /** + * Properties of an ExportModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IExportModelRequest + * @property {string|null} [name] ExportModelRequest name + * @property {google.cloud.automl.v1beta1.IModelExportOutputConfig|null} [outputConfig] ExportModelRequest outputConfig + */ + + /** + * Constructs a new ExportModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ExportModelRequest. + * @implements IExportModelRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IExportModelRequest=} [properties] Properties to set + */ + function ExportModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @instance + */ + ExportModelRequest.prototype.name = ""; + + /** + * ExportModelRequest outputConfig. + * @member {google.cloud.automl.v1beta1.IModelExportOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @instance + */ + ExportModelRequest.prototype.outputConfig = null; + + /** + * Creates a new ExportModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IExportModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExportModelRequest} ExportModelRequest instance + */ + ExportModelRequest.create = function create(properties) { + return new ExportModelRequest(properties); + }; + + /** + * Encodes the specified ExportModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IExportModelRequest} message ExportModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelRequest.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.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.automl.v1beta1.ModelExportOutputConfig.encode(message.outputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IExportModelRequest} message ExportModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ExportModelRequest} ExportModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ExportModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.outputConfig = $root.google.cloud.automl.v1beta1.ModelExportOutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ExportModelRequest} ExportModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportModelRequest.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.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.automl.v1beta1.ModelExportOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExportModelRequest} ExportModelRequest + */ + ExportModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExportModelRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExportModelRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExportModelRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.automl.v1beta1.ModelExportOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @static + * @param {google.cloud.automl.v1beta1.ExportModelRequest} message ExportModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.outputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.automl.v1beta1.ModelExportOutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @instance + * @returns {Object.} JSON object + */ + ExportModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ExportModelRequest"; + }; + + return ExportModelRequest; + })(); + + v1beta1.ExportEvaluatedExamplesRequest = (function() { + + /** + * Properties of an ExportEvaluatedExamplesRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IExportEvaluatedExamplesRequest + * @property {string|null} [name] ExportEvaluatedExamplesRequest name + * @property {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig|null} [outputConfig] ExportEvaluatedExamplesRequest outputConfig + */ + + /** + * Constructs a new ExportEvaluatedExamplesRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ExportEvaluatedExamplesRequest. + * @implements IExportEvaluatedExamplesRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest=} [properties] Properties to set + */ + function ExportEvaluatedExamplesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportEvaluatedExamplesRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @instance + */ + ExportEvaluatedExamplesRequest.prototype.name = ""; + + /** + * ExportEvaluatedExamplesRequest outputConfig. + * @member {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @instance + */ + ExportEvaluatedExamplesRequest.prototype.outputConfig = null; + + /** + * Creates a new ExportEvaluatedExamplesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @static + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest} ExportEvaluatedExamplesRequest instance + */ + ExportEvaluatedExamplesRequest.create = function create(properties) { + return new ExportEvaluatedExamplesRequest(properties); + }; + + /** + * Encodes the specified ExportEvaluatedExamplesRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @static + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest} message ExportEvaluatedExamplesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEvaluatedExamplesRequest.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.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.encode(message.outputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportEvaluatedExamplesRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @static + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest} message ExportEvaluatedExamplesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEvaluatedExamplesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportEvaluatedExamplesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest} ExportEvaluatedExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEvaluatedExamplesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.outputConfig = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportEvaluatedExamplesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest} ExportEvaluatedExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEvaluatedExamplesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportEvaluatedExamplesRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEvaluatedExamplesRequest.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.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportEvaluatedExamplesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest} ExportEvaluatedExamplesRequest + */ + ExportEvaluatedExamplesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportEvaluatedExamplesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @static + * @param {google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest} message ExportEvaluatedExamplesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEvaluatedExamplesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.outputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportEvaluatedExamplesRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @instance + * @returns {Object.} JSON object + */ + ExportEvaluatedExamplesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportEvaluatedExamplesRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportEvaluatedExamplesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest"; + }; + + return ExportEvaluatedExamplesRequest; + })(); + + v1beta1.GetModelEvaluationRequest = (function() { + + /** + * Properties of a GetModelEvaluationRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IGetModelEvaluationRequest + * @property {string|null} [name] GetModelEvaluationRequest name + */ + + /** + * Constructs a new GetModelEvaluationRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a GetModelEvaluationRequest. + * @implements IGetModelEvaluationRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IGetModelEvaluationRequest=} [properties] Properties to set + */ + function GetModelEvaluationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetModelEvaluationRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @instance + */ + GetModelEvaluationRequest.prototype.name = ""; + + /** + * Creates a new GetModelEvaluationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetModelEvaluationRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.GetModelEvaluationRequest} GetModelEvaluationRequest instance + */ + GetModelEvaluationRequest.create = function create(properties) { + return new GetModelEvaluationRequest(properties); + }; + + /** + * Encodes the specified GetModelEvaluationRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetModelEvaluationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetModelEvaluationRequest} message GetModelEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelEvaluationRequest.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 GetModelEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetModelEvaluationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetModelEvaluationRequest} message GetModelEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetModelEvaluationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.GetModelEvaluationRequest} GetModelEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelEvaluationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.GetModelEvaluationRequest(); + 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 GetModelEvaluationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.GetModelEvaluationRequest} GetModelEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetModelEvaluationRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetModelEvaluationRequest.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 GetModelEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.GetModelEvaluationRequest} GetModelEvaluationRequest + */ + GetModelEvaluationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.GetModelEvaluationRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.GetModelEvaluationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetModelEvaluationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @static + * @param {google.cloud.automl.v1beta1.GetModelEvaluationRequest} message GetModelEvaluationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetModelEvaluationRequest.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 GetModelEvaluationRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @instance + * @returns {Object.} JSON object + */ + GetModelEvaluationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetModelEvaluationRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetModelEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.GetModelEvaluationRequest"; + }; + + return GetModelEvaluationRequest; + })(); + + v1beta1.ListModelEvaluationsRequest = (function() { + + /** + * Properties of a ListModelEvaluationsRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IListModelEvaluationsRequest + * @property {string|null} [parent] ListModelEvaluationsRequest parent + * @property {string|null} [filter] ListModelEvaluationsRequest filter + * @property {number|null} [pageSize] ListModelEvaluationsRequest pageSize + * @property {string|null} [pageToken] ListModelEvaluationsRequest pageToken + */ + + /** + * Constructs a new ListModelEvaluationsRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ListModelEvaluationsRequest. + * @implements IListModelEvaluationsRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IListModelEvaluationsRequest=} [properties] Properties to set + */ + function ListModelEvaluationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelEvaluationsRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @instance + */ + ListModelEvaluationsRequest.prototype.parent = ""; + + /** + * ListModelEvaluationsRequest filter. + * @member {string} filter + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @instance + */ + ListModelEvaluationsRequest.prototype.filter = ""; + + /** + * ListModelEvaluationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @instance + */ + ListModelEvaluationsRequest.prototype.pageSize = 0; + + /** + * ListModelEvaluationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @instance + */ + ListModelEvaluationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListModelEvaluationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListModelEvaluationsRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ListModelEvaluationsRequest} ListModelEvaluationsRequest instance + */ + ListModelEvaluationsRequest.create = function create(properties) { + return new ListModelEvaluationsRequest(properties); + }; + + /** + * Encodes the specified ListModelEvaluationsRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelEvaluationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListModelEvaluationsRequest} message ListModelEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelEvaluationsRequest.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 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListModelEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelEvaluationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListModelEvaluationsRequest} message ListModelEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelEvaluationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ListModelEvaluationsRequest} ListModelEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelEvaluationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ListModelEvaluationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ListModelEvaluationsRequest} ListModelEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelEvaluationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelEvaluationsRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelEvaluationsRequest.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 ListModelEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ListModelEvaluationsRequest} ListModelEvaluationsRequest + */ + ListModelEvaluationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ListModelEvaluationsRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.ListModelEvaluationsRequest(); + 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 ListModelEvaluationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @static + * @param {google.cloud.automl.v1beta1.ListModelEvaluationsRequest} message ListModelEvaluationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelEvaluationsRequest.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 ListModelEvaluationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListModelEvaluationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelEvaluationsRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelEvaluationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ListModelEvaluationsRequest"; + }; + + return ListModelEvaluationsRequest; + })(); + + v1beta1.ListModelEvaluationsResponse = (function() { + + /** + * Properties of a ListModelEvaluationsResponse. + * @memberof google.cloud.automl.v1beta1 + * @interface IListModelEvaluationsResponse + * @property {Array.|null} [modelEvaluation] ListModelEvaluationsResponse modelEvaluation + * @property {string|null} [nextPageToken] ListModelEvaluationsResponse nextPageToken + */ + + /** + * Constructs a new ListModelEvaluationsResponse. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ListModelEvaluationsResponse. + * @implements IListModelEvaluationsResponse + * @constructor + * @param {google.cloud.automl.v1beta1.IListModelEvaluationsResponse=} [properties] Properties to set + */ + function ListModelEvaluationsResponse(properties) { + this.modelEvaluation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelEvaluationsResponse modelEvaluation. + * @member {Array.} modelEvaluation + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @instance + */ + ListModelEvaluationsResponse.prototype.modelEvaluation = $util.emptyArray; + + /** + * ListModelEvaluationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @instance + */ + ListModelEvaluationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListModelEvaluationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListModelEvaluationsResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ListModelEvaluationsResponse} ListModelEvaluationsResponse instance + */ + ListModelEvaluationsResponse.create = function create(properties) { + return new ListModelEvaluationsResponse(properties); + }; + + /** + * Encodes the specified ListModelEvaluationsResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelEvaluationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListModelEvaluationsResponse} message ListModelEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelEvaluationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelEvaluation != null && message.modelEvaluation.length) + for (var i = 0; i < message.modelEvaluation.length; ++i) + $root.google.cloud.automl.v1beta1.ModelEvaluation.encode(message.modelEvaluation[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 ListModelEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelEvaluationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListModelEvaluationsResponse} message ListModelEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelEvaluationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ListModelEvaluationsResponse} ListModelEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelEvaluationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ListModelEvaluationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.modelEvaluation && message.modelEvaluation.length)) + message.modelEvaluation = []; + message.modelEvaluation.push($root.google.cloud.automl.v1beta1.ModelEvaluation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ListModelEvaluationsResponse} ListModelEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelEvaluationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelEvaluationsResponse message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelEvaluationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelEvaluation != null && message.hasOwnProperty("modelEvaluation")) { + if (!Array.isArray(message.modelEvaluation)) + return "modelEvaluation: array expected"; + for (var i = 0; i < message.modelEvaluation.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.ModelEvaluation.verify(message.modelEvaluation[i]); + if (error) + return "modelEvaluation." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListModelEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ListModelEvaluationsResponse} ListModelEvaluationsResponse + */ + ListModelEvaluationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ListModelEvaluationsResponse) + return object; + var message = new $root.google.cloud.automl.v1beta1.ListModelEvaluationsResponse(); + if (object.modelEvaluation) { + if (!Array.isArray(object.modelEvaluation)) + throw TypeError(".google.cloud.automl.v1beta1.ListModelEvaluationsResponse.modelEvaluation: array expected"); + message.modelEvaluation = []; + for (var i = 0; i < object.modelEvaluation.length; ++i) { + if (typeof object.modelEvaluation[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ListModelEvaluationsResponse.modelEvaluation: object expected"); + message.modelEvaluation[i] = $root.google.cloud.automl.v1beta1.ModelEvaluation.fromObject(object.modelEvaluation[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListModelEvaluationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @static + * @param {google.cloud.automl.v1beta1.ListModelEvaluationsResponse} message ListModelEvaluationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelEvaluationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.modelEvaluation = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.modelEvaluation && message.modelEvaluation.length) { + object.modelEvaluation = []; + for (var j = 0; j < message.modelEvaluation.length; ++j) + object.modelEvaluation[j] = $root.google.cloud.automl.v1beta1.ModelEvaluation.toObject(message.modelEvaluation[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListModelEvaluationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListModelEvaluationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelEvaluationsResponse + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelEvaluationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ListModelEvaluationsResponse"; + }; + + return ListModelEvaluationsResponse; + })(); + + v1beta1.TableSpec = (function() { + + /** + * Properties of a TableSpec. + * @memberof google.cloud.automl.v1beta1 + * @interface ITableSpec + * @property {string|null} [name] TableSpec name + * @property {string|null} [timeColumnSpecId] TableSpec timeColumnSpecId + * @property {number|Long|null} [rowCount] TableSpec rowCount + * @property {number|Long|null} [validRowCount] TableSpec validRowCount + * @property {number|Long|null} [columnCount] TableSpec columnCount + * @property {Array.|null} [inputConfigs] TableSpec inputConfigs + * @property {string|null} [etag] TableSpec etag + */ + + /** + * Constructs a new TableSpec. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TableSpec. + * @implements ITableSpec + * @constructor + * @param {google.cloud.automl.v1beta1.ITableSpec=} [properties] Properties to set + */ + function TableSpec(properties) { + this.inputConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableSpec name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.TableSpec + * @instance + */ + TableSpec.prototype.name = ""; + + /** + * TableSpec timeColumnSpecId. + * @member {string} timeColumnSpecId + * @memberof google.cloud.automl.v1beta1.TableSpec + * @instance + */ + TableSpec.prototype.timeColumnSpecId = ""; + + /** + * TableSpec rowCount. + * @member {number|Long} rowCount + * @memberof google.cloud.automl.v1beta1.TableSpec + * @instance + */ + TableSpec.prototype.rowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TableSpec validRowCount. + * @member {number|Long} validRowCount + * @memberof google.cloud.automl.v1beta1.TableSpec + * @instance + */ + TableSpec.prototype.validRowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TableSpec columnCount. + * @member {number|Long} columnCount + * @memberof google.cloud.automl.v1beta1.TableSpec + * @instance + */ + TableSpec.prototype.columnCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TableSpec inputConfigs. + * @member {Array.} inputConfigs + * @memberof google.cloud.automl.v1beta1.TableSpec + * @instance + */ + TableSpec.prototype.inputConfigs = $util.emptyArray; + + /** + * TableSpec etag. + * @member {string} etag + * @memberof google.cloud.automl.v1beta1.TableSpec + * @instance + */ + TableSpec.prototype.etag = ""; + + /** + * Creates a new TableSpec instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TableSpec + * @static + * @param {google.cloud.automl.v1beta1.ITableSpec=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TableSpec} TableSpec instance + */ + TableSpec.create = function create(properties) { + return new TableSpec(properties); + }; + + /** + * Encodes the specified TableSpec message. Does not implicitly {@link google.cloud.automl.v1beta1.TableSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TableSpec + * @static + * @param {google.cloud.automl.v1beta1.ITableSpec} message TableSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableSpec.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.timeColumnSpecId != null && Object.hasOwnProperty.call(message, "timeColumnSpecId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.timeColumnSpecId); + if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.rowCount); + if (message.validRowCount != null && Object.hasOwnProperty.call(message, "validRowCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.validRowCount); + if (message.inputConfigs != null && message.inputConfigs.length) + for (var i = 0; i < message.inputConfigs.length; ++i) + $root.google.cloud.automl.v1beta1.InputConfig.encode(message.inputConfigs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + if (message.columnCount != null && Object.hasOwnProperty.call(message, "columnCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.columnCount); + return writer; + }; + + /** + * Encodes the specified TableSpec message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TableSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TableSpec + * @static + * @param {google.cloud.automl.v1beta1.ITableSpec} message TableSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TableSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TableSpec} TableSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TableSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeColumnSpecId = reader.string(); + break; + } + case 3: { + message.rowCount = reader.int64(); + break; + } + case 4: { + message.validRowCount = reader.int64(); + break; + } + case 7: { + message.columnCount = reader.int64(); + break; + } + case 5: { + if (!(message.inputConfigs && message.inputConfigs.length)) + message.inputConfigs = []; + message.inputConfigs.push($root.google.cloud.automl.v1beta1.InputConfig.decode(reader, reader.uint32())); + break; + } + case 6: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TableSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TableSpec} TableSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableSpec message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TableSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableSpec.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.timeColumnSpecId != null && message.hasOwnProperty("timeColumnSpecId")) + if (!$util.isString(message.timeColumnSpecId)) + return "timeColumnSpecId: string expected"; + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (!$util.isInteger(message.rowCount) && !(message.rowCount && $util.isInteger(message.rowCount.low) && $util.isInteger(message.rowCount.high))) + return "rowCount: integer|Long expected"; + if (message.validRowCount != null && message.hasOwnProperty("validRowCount")) + if (!$util.isInteger(message.validRowCount) && !(message.validRowCount && $util.isInteger(message.validRowCount.low) && $util.isInteger(message.validRowCount.high))) + return "validRowCount: integer|Long expected"; + if (message.columnCount != null && message.hasOwnProperty("columnCount")) + if (!$util.isInteger(message.columnCount) && !(message.columnCount && $util.isInteger(message.columnCount.low) && $util.isInteger(message.columnCount.high))) + return "columnCount: integer|Long expected"; + 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.automl.v1beta1.InputConfig.verify(message.inputConfigs[i]); + if (error) + return "inputConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a TableSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TableSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TableSpec} TableSpec + */ + TableSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TableSpec) + return object; + var message = new $root.google.cloud.automl.v1beta1.TableSpec(); + if (object.name != null) + message.name = String(object.name); + if (object.timeColumnSpecId != null) + message.timeColumnSpecId = String(object.timeColumnSpecId); + if (object.rowCount != null) + if ($util.Long) + (message.rowCount = $util.Long.fromValue(object.rowCount)).unsigned = false; + else if (typeof object.rowCount === "string") + message.rowCount = parseInt(object.rowCount, 10); + else if (typeof object.rowCount === "number") + message.rowCount = object.rowCount; + else if (typeof object.rowCount === "object") + message.rowCount = new $util.LongBits(object.rowCount.low >>> 0, object.rowCount.high >>> 0).toNumber(); + if (object.validRowCount != null) + if ($util.Long) + (message.validRowCount = $util.Long.fromValue(object.validRowCount)).unsigned = false; + else if (typeof object.validRowCount === "string") + message.validRowCount = parseInt(object.validRowCount, 10); + else if (typeof object.validRowCount === "number") + message.validRowCount = object.validRowCount; + else if (typeof object.validRowCount === "object") + message.validRowCount = new $util.LongBits(object.validRowCount.low >>> 0, object.validRowCount.high >>> 0).toNumber(); + if (object.columnCount != null) + if ($util.Long) + (message.columnCount = $util.Long.fromValue(object.columnCount)).unsigned = false; + else if (typeof object.columnCount === "string") + message.columnCount = parseInt(object.columnCount, 10); + else if (typeof object.columnCount === "number") + message.columnCount = object.columnCount; + else if (typeof object.columnCount === "object") + message.columnCount = new $util.LongBits(object.columnCount.low >>> 0, object.columnCount.high >>> 0).toNumber(); + if (object.inputConfigs) { + if (!Array.isArray(object.inputConfigs)) + throw TypeError(".google.cloud.automl.v1beta1.TableSpec.inputConfigs: array expected"); + message.inputConfigs = []; + for (var i = 0; i < object.inputConfigs.length; ++i) { + if (typeof object.inputConfigs[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TableSpec.inputConfigs: object expected"); + message.inputConfigs[i] = $root.google.cloud.automl.v1beta1.InputConfig.fromObject(object.inputConfigs[i]); + } + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a TableSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TableSpec + * @static + * @param {google.cloud.automl.v1beta1.TableSpec} message TableSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.inputConfigs = []; + if (options.defaults) { + object.name = ""; + object.timeColumnSpecId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.validRowCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.validRowCount = options.longs === String ? "0" : 0; + object.etag = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.columnCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.columnCount = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeColumnSpecId != null && message.hasOwnProperty("timeColumnSpecId")) + object.timeColumnSpecId = message.timeColumnSpecId; + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (typeof message.rowCount === "number") + object.rowCount = options.longs === String ? String(message.rowCount) : message.rowCount; + else + object.rowCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowCount) : options.longs === Number ? new $util.LongBits(message.rowCount.low >>> 0, message.rowCount.high >>> 0).toNumber() : message.rowCount; + if (message.validRowCount != null && message.hasOwnProperty("validRowCount")) + if (typeof message.validRowCount === "number") + object.validRowCount = options.longs === String ? String(message.validRowCount) : message.validRowCount; + else + object.validRowCount = options.longs === String ? $util.Long.prototype.toString.call(message.validRowCount) : options.longs === Number ? new $util.LongBits(message.validRowCount.low >>> 0, message.validRowCount.high >>> 0).toNumber() : message.validRowCount; + if (message.inputConfigs && message.inputConfigs.length) { + object.inputConfigs = []; + for (var j = 0; j < message.inputConfigs.length; ++j) + object.inputConfigs[j] = $root.google.cloud.automl.v1beta1.InputConfig.toObject(message.inputConfigs[j], options); + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.columnCount != null && message.hasOwnProperty("columnCount")) + if (typeof message.columnCount === "number") + object.columnCount = options.longs === String ? String(message.columnCount) : message.columnCount; + else + object.columnCount = options.longs === String ? $util.Long.prototype.toString.call(message.columnCount) : options.longs === Number ? new $util.LongBits(message.columnCount.low >>> 0, message.columnCount.high >>> 0).toNumber() : message.columnCount; + return object; + }; + + /** + * Converts this TableSpec to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TableSpec + * @instance + * @returns {Object.} JSON object + */ + TableSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableSpec + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TableSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TableSpec"; + }; + + return TableSpec; + })(); + + return v1beta1; + })(); + + return automl; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function 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.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function 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.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function 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.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function 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.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + 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.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function 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.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function 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.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function 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.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function 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.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function 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.DotnetSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function 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.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function 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.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.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.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function 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.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function 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.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + 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 {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @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 deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = 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.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + 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 11: { + message.deprecatedLegacyJsonFieldConflicts = 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: 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.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + 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.deprecatedLegacyJsonFieldConflicts = 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + 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 {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {google.protobuf.FieldOptions.OptionTargetType|null} [target] FieldOptions target + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions target. + * @member {google.protobuf.FieldOptions.OptionTargetType} target + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.target = 0; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.target); + 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 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 18: { + message.target = 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 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.target != null && message.hasOwnProperty("target")) + switch (message.target) { + default: + return "target: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + 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.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + switch (object.target) { + default: + if (typeof object.target === "number") { + message.target = object.target; + break; + } + break; + case "TARGET_TYPE_UNKNOWN": + case 0: + message.target = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.target = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.target = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.target = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.target = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.target = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.target = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.target = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.target = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.target = 9; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.target = options.enums === String ? "TARGET_TYPE_UNKNOWN" : 0; + 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.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.target != null && message.hasOwnProperty("target")) + object.target = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.target] === undefined ? message.target : $root.google.protobuf.FieldOptions.OptionTargetType[message.target] : message.target; + 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; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + 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 {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @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 deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = 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.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + 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 6: { + message.deprecatedLegacyJsonFieldConflicts = 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: 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.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + 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; + object.deprecatedLegacyJsonFieldConflicts = 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.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; + })(); + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + 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-automl/protos/protos.json b/packages/google-cloud-automl/protos/protos.json new file mode 100644 index 00000000000..ab60cadef7d --- /dev/null +++ b/packages/google-cloud-automl/protos/protos.json @@ -0,0 +1,7157 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "automl": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.AutoML.V1", + "go_package": "cloud.google.com/go/automl/apiv1/automlpb;automlpb", + "java_multiple_files": true, + "java_package": "com.google.cloud.automl.v1", + "php_namespace": "Google\\Cloud\\AutoMl\\V1", + "ruby_package": "Google::Cloud::AutoML::V1", + "java_outer_classname": "AutoMlProto" + }, + "nested": { + "AnnotationPayload": { + "oneofs": { + "detail": { + "oneof": [ + "translation", + "classification", + "imageObjectDetection", + "textExtraction", + "textSentiment" + ] + } + }, + "fields": { + "translation": { + "type": "TranslationAnnotation", + "id": 2 + }, + "classification": { + "type": "ClassificationAnnotation", + "id": 3 + }, + "imageObjectDetection": { + "type": "ImageObjectDetectionAnnotation", + "id": 4 + }, + "textExtraction": { + "type": "TextExtractionAnnotation", + "id": 6 + }, + "textSentiment": { + "type": "TextSentimentAnnotation", + "id": 7 + }, + "annotationSpecId": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 5 + } + } + }, + "ClassificationType": { + "values": { + "CLASSIFICATION_TYPE_UNSPECIFIED": 0, + "MULTICLASS": 1, + "MULTILABEL": 2 + } + }, + "ClassificationAnnotation": { + "fields": { + "score": { + "type": "float", + "id": 1 + } + } + }, + "ClassificationEvaluationMetrics": { + "fields": { + "auPrc": { + "type": "float", + "id": 1 + }, + "auRoc": { + "type": "float", + "id": 6 + }, + "logLoss": { + "type": "float", + "id": 7 + }, + "confidenceMetricsEntry": { + "rule": "repeated", + "type": "ConfidenceMetricsEntry", + "id": 3 + }, + "confusionMatrix": { + "type": "ConfusionMatrix", + "id": 4 + }, + "annotationSpecId": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "ConfidenceMetricsEntry": { + "fields": { + "confidenceThreshold": { + "type": "float", + "id": 1 + }, + "positionThreshold": { + "type": "int32", + "id": 14 + }, + "recall": { + "type": "float", + "id": 2 + }, + "precision": { + "type": "float", + "id": 3 + }, + "falsePositiveRate": { + "type": "float", + "id": 8 + }, + "f1Score": { + "type": "float", + "id": 4 + }, + "recallAt1": { + "type": "float", + "id": 5 + }, + "precisionAt1": { + "type": "float", + "id": 6 + }, + "falsePositiveRateAt1": { + "type": "float", + "id": 9 + }, + "f1ScoreAt1": { + "type": "float", + "id": 7 + }, + "truePositiveCount": { + "type": "int64", + "id": 10 + }, + "falsePositiveCount": { + "type": "int64", + "id": 11 + }, + "falseNegativeCount": { + "type": "int64", + "id": 12 + }, + "trueNegativeCount": { + "type": "int64", + "id": 13 + } + } + }, + "ConfusionMatrix": { + "fields": { + "annotationSpecId": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "displayName": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "row": { + "rule": "repeated", + "type": "Row", + "id": 2 + } + }, + "nested": { + "Row": { + "fields": { + "exampleCount": { + "rule": "repeated", + "type": "int32", + "id": 1 + } + } + } + } + } + } + }, + "ImageObjectDetectionAnnotation": { + "fields": { + "boundingBox": { + "type": "BoundingPoly", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + } + } + }, + "BoundingBoxMetricsEntry": { + "fields": { + "iouThreshold": { + "type": "float", + "id": 1 + }, + "meanAveragePrecision": { + "type": "float", + "id": 2 + }, + "confidenceMetricsEntries": { + "rule": "repeated", + "type": "ConfidenceMetricsEntry", + "id": 3 + } + }, + "nested": { + "ConfidenceMetricsEntry": { + "fields": { + "confidenceThreshold": { + "type": "float", + "id": 1 + }, + "recall": { + "type": "float", + "id": 2 + }, + "precision": { + "type": "float", + "id": 3 + }, + "f1Score": { + "type": "float", + "id": 4 + } + } + } + } + }, + "ImageObjectDetectionEvaluationMetrics": { + "fields": { + "evaluatedBoundingBoxCount": { + "type": "int32", + "id": 1 + }, + "boundingBoxMetricsEntries": { + "rule": "repeated", + "type": "BoundingBoxMetricsEntry", + "id": 2 + }, + "boundingBoxMeanAveragePrecision": { + "type": "float", + "id": 3 + } + } + }, + "NormalizedVertex": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + } + } + }, + "BoundingPoly": { + "fields": { + "normalizedVertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 2 + } + } + }, + "TextExtractionAnnotation": { + "oneofs": { + "annotation": { + "oneof": [ + "textSegment" + ] + } + }, + "fields": { + "textSegment": { + "type": "TextSegment", + "id": 3 + }, + "score": { + "type": "float", + "id": 1 + } + } + }, + "TextExtractionEvaluationMetrics": { + "fields": { + "auPrc": { + "type": "float", + "id": 1 + }, + "confidenceMetricsEntries": { + "rule": "repeated", + "type": "ConfidenceMetricsEntry", + "id": 2 + } + }, + "nested": { + "ConfidenceMetricsEntry": { + "fields": { + "confidenceThreshold": { + "type": "float", + "id": 1 + }, + "recall": { + "type": "float", + "id": 3 + }, + "precision": { + "type": "float", + "id": 4 + }, + "f1Score": { + "type": "float", + "id": 5 + } + } + } + } + }, + "TextSegment": { + "fields": { + "content": { + "type": "string", + "id": 3 + }, + "startOffset": { + "type": "int64", + "id": 1 + }, + "endOffset": { + "type": "int64", + "id": 2 + } + } + }, + "TextSentimentAnnotation": { + "fields": { + "sentiment": { + "type": "int32", + "id": 1 + } + } + }, + "TextSentimentEvaluationMetrics": { + "fields": { + "precision": { + "type": "float", + "id": 1 + }, + "recall": { + "type": "float", + "id": 2 + }, + "f1Score": { + "type": "float", + "id": 3 + }, + "meanAbsoluteError": { + "type": "float", + "id": 4 + }, + "meanSquaredError": { + "type": "float", + "id": 5 + }, + "linearKappa": { + "type": "float", + "id": 6 + }, + "quadraticKappa": { + "type": "float", + "id": 7 + }, + "confusionMatrix": { + "type": "ClassificationEvaluationMetrics.ConfusionMatrix", + "id": 8 + } + } + }, + "TranslationDatasetMetadata": { + "fields": { + "sourceLanguageCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetLanguageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TranslationEvaluationMetrics": { + "fields": { + "bleuScore": { + "type": "double", + "id": 1 + }, + "baseBleuScore": { + "type": "double", + "id": 2 + } + } + }, + "TranslationModelMetadata": { + "fields": { + "baseModel": { + "type": "string", + "id": 1 + }, + "sourceLanguageCode": { + "type": "string", + "id": 2 + }, + "targetLanguageCode": { + "type": "string", + "id": 3 + } + } + }, + "TranslationAnnotation": { + "fields": { + "translatedContent": { + "type": "TextSnippet", + "id": 1 + } + } + }, + "Image": { + "oneofs": { + "data": { + "oneof": [ + "imageBytes" + ] + } + }, + "fields": { + "imageBytes": { + "type": "bytes", + "id": 1 + }, + "thumbnailUri": { + "type": "string", + "id": 4 + } + } + }, + "TextSnippet": { + "fields": { + "content": { + "type": "string", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 2 + }, + "contentUri": { + "type": "string", + "id": 4 + } + } + }, + "DocumentDimensions": { + "fields": { + "unit": { + "type": "DocumentDimensionUnit", + "id": 1 + }, + "width": { + "type": "float", + "id": 2 + }, + "height": { + "type": "float", + "id": 3 + } + }, + "nested": { + "DocumentDimensionUnit": { + "values": { + "DOCUMENT_DIMENSION_UNIT_UNSPECIFIED": 0, + "INCH": 1, + "CENTIMETER": 2, + "POINT": 3 + } + } + } + }, + "Document": { + "fields": { + "inputConfig": { + "type": "DocumentInputConfig", + "id": 1 + }, + "documentText": { + "type": "TextSnippet", + "id": 2 + }, + "layout": { + "rule": "repeated", + "type": "Layout", + "id": 3 + }, + "documentDimensions": { + "type": "DocumentDimensions", + "id": 4 + }, + "pageCount": { + "type": "int32", + "id": 5 + } + }, + "nested": { + "Layout": { + "fields": { + "textSegment": { + "type": "TextSegment", + "id": 1 + }, + "pageNumber": { + "type": "int32", + "id": 2 + }, + "boundingPoly": { + "type": "BoundingPoly", + "id": 3 + }, + "textSegmentType": { + "type": "TextSegmentType", + "id": 4 + } + }, + "nested": { + "TextSegmentType": { + "values": { + "TEXT_SEGMENT_TYPE_UNSPECIFIED": 0, + "TOKEN": 1, + "PARAGRAPH": 2, + "FORM_FIELD": 3, + "FORM_FIELD_NAME": 4, + "FORM_FIELD_CONTENTS": 5, + "TABLE": 6, + "TABLE_HEADER": 7, + "TABLE_ROW": 8, + "TABLE_CELL": 9 + } + } + } + } + } + }, + "ExamplePayload": { + "oneofs": { + "payload": { + "oneof": [ + "image", + "textSnippet", + "document" + ] + } + }, + "fields": { + "image": { + "type": "Image", + "id": 1 + }, + "textSnippet": { + "type": "TextSnippet", + "id": 2 + }, + "document": { + "type": "Document", + "id": 4 + } + } + }, + "InputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource" + ] + } + }, + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + }, + "params": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "BatchPredictInputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource" + ] + } + }, + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DocumentInputConfig": { + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + } + } + }, + "OutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchPredictOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ModelExportOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "modelFormat": { + "type": "string", + "id": 4 + }, + "params": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "GcsSource": { + "fields": { + "inputUris": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GcsDestination": { + "fields": { + "outputUriPrefix": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AnnotationSpec": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/AnnotationSpec", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "exampleCount": { + "type": "int32", + "id": 9 + } + } + }, + "Dataset": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/Dataset", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/datasets/{dataset}" + }, + "oneofs": { + "datasetMetadata": { + "oneof": [ + "translationDatasetMetadata", + "imageClassificationDatasetMetadata", + "textClassificationDatasetMetadata", + "imageObjectDetectionDatasetMetadata", + "textExtractionDatasetMetadata", + "textSentimentDatasetMetadata" + ] + } + }, + "fields": { + "translationDatasetMetadata": { + "type": "TranslationDatasetMetadata", + "id": 23 + }, + "imageClassificationDatasetMetadata": { + "type": "ImageClassificationDatasetMetadata", + "id": 24 + }, + "textClassificationDatasetMetadata": { + "type": "TextClassificationDatasetMetadata", + "id": 25 + }, + "imageObjectDetectionDatasetMetadata": { + "type": "ImageObjectDetectionDatasetMetadata", + "id": 26 + }, + "textExtractionDatasetMetadata": { + "type": "TextExtractionDatasetMetadata", + "id": 28 + }, + "textSentimentDatasetMetadata": { + "type": "TextSentimentDatasetMetadata", + "id": 30 + }, + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "exampleCount": { + "type": "int32", + "id": 21 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 14 + }, + "etag": { + "type": "string", + "id": 17 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 39 + } + } + }, + "ImageClassificationDatasetMetadata": { + "fields": { + "classificationType": { + "type": "ClassificationType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ImageObjectDetectionDatasetMetadata": { + "fields": {} + }, + "ImageClassificationModelMetadata": { + "fields": { + "baseModelId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "trainBudgetMilliNodeHours": { + "type": "int64", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "trainCostMilliNodeHours": { + "type": "int64", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stopReason": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "modelType": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nodeQps": { + "type": "double", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nodeCount": { + "type": "int64", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ImageObjectDetectionModelMetadata": { + "fields": { + "modelType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nodeCount": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nodeQps": { + "type": "double", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stopReason": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "trainBudgetMilliNodeHours": { + "type": "int64", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "trainCostMilliNodeHours": { + "type": "int64", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ImageClassificationModelDeploymentMetadata": { + "fields": { + "nodeCount": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + } + }, + "ImageObjectDetectionModelDeploymentMetadata": { + "fields": { + "nodeCount": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + } + }, + "TextClassificationDatasetMetadata": { + "fields": { + "classificationType": { + "type": "ClassificationType", + "id": 1 + } + } + }, + "TextClassificationModelMetadata": { + "fields": { + "classificationType": { + "type": "ClassificationType", + "id": 3 + } + } + }, + "TextExtractionDatasetMetadata": { + "fields": {} + }, + "TextExtractionModelMetadata": { + "fields": {} + }, + "TextSentimentDatasetMetadata": { + "fields": { + "sentimentMax": { + "type": "int32", + "id": 1 + } + } + }, + "TextSentimentModelMetadata": { + "fields": {} + }, + "Model": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/Model", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/models/{model}" + }, + "oneofs": { + "modelMetadata": { + "oneof": [ + "translationModelMetadata", + "imageClassificationModelMetadata", + "textClassificationModelMetadata", + "imageObjectDetectionModelMetadata", + "textExtractionModelMetadata", + "textSentimentModelMetadata" + ] + } + }, + "fields": { + "translationModelMetadata": { + "type": "TranslationModelMetadata", + "id": 15 + }, + "imageClassificationModelMetadata": { + "type": "ImageClassificationModelMetadata", + "id": 13 + }, + "textClassificationModelMetadata": { + "type": "TextClassificationModelMetadata", + "id": 14 + }, + "imageObjectDetectionModelMetadata": { + "type": "ImageObjectDetectionModelMetadata", + "id": 20 + }, + "textExtractionModelMetadata": { + "type": "TextExtractionModelMetadata", + "id": 19 + }, + "textSentimentModelMetadata": { + "type": "TextSentimentModelMetadata", + "id": 22 + }, + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "datasetId": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 11 + }, + "deploymentState": { + "type": "DeploymentState", + "id": 8 + }, + "etag": { + "type": "string", + "id": 10 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 34 + } + }, + "nested": { + "DeploymentState": { + "values": { + "DEPLOYMENT_STATE_UNSPECIFIED": 0, + "DEPLOYED": 1, + "UNDEPLOYED": 2 + } + } + } + }, + "ModelEvaluation": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/ModelEvaluation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}" + }, + "oneofs": { + "metrics": { + "oneof": [ + "classificationEvaluationMetrics", + "translationEvaluationMetrics", + "imageObjectDetectionEvaluationMetrics", + "textSentimentEvaluationMetrics", + "textExtractionEvaluationMetrics" + ] + } + }, + "fields": { + "classificationEvaluationMetrics": { + "type": "ClassificationEvaluationMetrics", + "id": 8 + }, + "translationEvaluationMetrics": { + "type": "TranslationEvaluationMetrics", + "id": 9 + }, + "imageObjectDetectionEvaluationMetrics": { + "type": "ImageObjectDetectionEvaluationMetrics", + "id": 12 + }, + "textSentimentEvaluationMetrics": { + "type": "TextSentimentEvaluationMetrics", + "id": 11 + }, + "textExtractionEvaluationMetrics": { + "type": "TextExtractionEvaluationMetrics", + "id": 13 + }, + "name": { + "type": "string", + "id": 1 + }, + "annotationSpecId": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 15 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "evaluatedExampleCount": { + "type": "int32", + "id": 6 + } + } + }, + "OperationMetadata": { + "oneofs": { + "details": { + "oneof": [ + "deleteDetails", + "deployModelDetails", + "undeployModelDetails", + "createModelDetails", + "createDatasetDetails", + "importDataDetails", + "batchPredictDetails", + "exportDataDetails", + "exportModelDetails" + ] + } + }, + "fields": { + "deleteDetails": { + "type": "DeleteOperationMetadata", + "id": 8 + }, + "deployModelDetails": { + "type": "DeployModelOperationMetadata", + "id": 24 + }, + "undeployModelDetails": { + "type": "UndeployModelOperationMetadata", + "id": 25 + }, + "createModelDetails": { + "type": "CreateModelOperationMetadata", + "id": 10 + }, + "createDatasetDetails": { + "type": "CreateDatasetOperationMetadata", + "id": 30 + }, + "importDataDetails": { + "type": "ImportDataOperationMetadata", + "id": 15 + }, + "batchPredictDetails": { + "type": "BatchPredictOperationMetadata", + "id": 16 + }, + "exportDataDetails": { + "type": "ExportDataOperationMetadata", + "id": 21 + }, + "exportModelDetails": { + "type": "ExportModelOperationMetadata", + "id": 22 + }, + "progressPercent": { + "type": "int32", + "id": 13 + }, + "partialFailures": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "DeleteOperationMetadata": { + "fields": {} + }, + "DeployModelOperationMetadata": { + "fields": {} + }, + "UndeployModelOperationMetadata": { + "fields": {} + }, + "CreateDatasetOperationMetadata": { + "fields": {} + }, + "CreateModelOperationMetadata": { + "fields": {} + }, + "ImportDataOperationMetadata": { + "fields": {} + }, + "ExportDataOperationMetadata": { + "fields": { + "outputInfo": { + "type": "ExportDataOutputInfo", + "id": 1 + } + }, + "nested": { + "ExportDataOutputInfo": { + "oneofs": { + "outputLocation": { + "oneof": [ + "gcsOutputDirectory" + ] + } + }, + "fields": { + "gcsOutputDirectory": { + "type": "string", + "id": 1 + } + } + } + } + }, + "BatchPredictOperationMetadata": { + "fields": { + "inputConfig": { + "type": "BatchPredictInputConfig", + "id": 1 + }, + "outputInfo": { + "type": "BatchPredictOutputInfo", + "id": 2 + } + }, + "nested": { + "BatchPredictOutputInfo": { + "oneofs": { + "outputLocation": { + "oneof": [ + "gcsOutputDirectory" + ] + } + }, + "fields": { + "gcsOutputDirectory": { + "type": "string", + "id": 1 + } + } + } + } + }, + "ExportModelOperationMetadata": { + "fields": { + "outputInfo": { + "type": "ExportModelOutputInfo", + "id": 2 + } + }, + "nested": { + "ExportModelOutputInfo": { + "fields": { + "gcsOutputDirectory": { + "type": "string", + "id": 1 + } + } + } + } + }, + "PredictionService": { + "options": { + "(google.api.default_host)": "automl.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Predict": { + "requestType": "PredictRequest", + "responseType": "PredictResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/models/*}:predict", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,payload,params" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/models/*}:predict", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,payload,params" + } + ] + }, + "BatchPredict": { + "requestType": "BatchPredictRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/models/*}:batchPredict", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,input_config,output_config,params", + "(google.longrunning.operation_info).response_type": "BatchPredictResult", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/models/*}:batchPredict", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,input_config,output_config,params" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchPredictResult", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "PredictRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + }, + "payload": { + "type": "ExamplePayload", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "params": { + "keyType": "string", + "type": "string", + "id": 3 + } + } + }, + "PredictResponse": { + "fields": { + "payload": { + "rule": "repeated", + "type": "AnnotationPayload", + "id": 1 + }, + "preprocessedInput": { + "type": "ExamplePayload", + "id": 3 + }, + "metadata": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "BatchPredictRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + }, + "inputConfig": { + "type": "BatchPredictInputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputConfig": { + "type": "BatchPredictOutputConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "params": { + "keyType": "string", + "type": "string", + "id": 5 + } + } + }, + "BatchPredictResult": { + "fields": { + "metadata": { + "keyType": "string", + "type": "string", + "id": 1 + } + } + }, + "AutoMl": { + "options": { + "(google.api.default_host)": "automl.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateDataset": { + "requestType": "CreateDatasetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/datasets", + "(google.api.http).body": "dataset", + "(google.api.method_signature)": "parent,dataset", + "(google.longrunning.operation_info).response_type": "Dataset", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/datasets", + "body": "dataset" + } + }, + { + "(google.api.method_signature)": "parent,dataset" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Dataset", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetDataset": { + "requestType": "GetDatasetRequest", + "responseType": "Dataset", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/datasets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/datasets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDatasets": { + "requestType": "ListDatasetsRequest", + "responseType": "ListDatasetsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/datasets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/datasets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateDataset": { + "requestType": "UpdateDatasetRequest", + "responseType": "Dataset", + "options": { + "(google.api.http).patch": "/v1/{dataset.name=projects/*/locations/*/datasets/*}", + "(google.api.http).body": "dataset", + "(google.api.method_signature)": "dataset,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{dataset.name=projects/*/locations/*/datasets/*}", + "body": "dataset" + } + }, + { + "(google.api.method_signature)": "dataset,update_mask" + } + ] + }, + "DeleteDataset": { + "requestType": "DeleteDatasetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/datasets/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/datasets/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ImportData": { + "requestType": "ImportDataRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/datasets/*}:importData", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,input_config", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/datasets/*}:importData", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,input_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ExportData": { + "requestType": "ExportDataRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/datasets/*}:exportData", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,output_config", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/datasets/*}:exportData", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,output_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetAnnotationSpec": { + "requestType": "GetAnnotationSpecRequest", + "responseType": "AnnotationSpec", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateModel": { + "requestType": "CreateModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/models", + "(google.api.http).body": "model", + "(google.api.method_signature)": "parent,model", + "(google.longrunning.operation_info).response_type": "Model", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/models", + "body": "model" + } + }, + { + "(google.api.method_signature)": "parent,model" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Model", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetModel": { + "requestType": "GetModelRequest", + "responseType": "Model", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/models/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/models/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListModels": { + "requestType": "ListModelsRequest", + "responseType": "ListModelsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/models", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/models" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteModel": { + "requestType": "DeleteModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/models/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/models/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateModel": { + "requestType": "UpdateModelRequest", + "responseType": "Model", + "options": { + "(google.api.http).patch": "/v1/{model.name=projects/*/locations/*/models/*}", + "(google.api.http).body": "model", + "(google.api.method_signature)": "model,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{model.name=projects/*/locations/*/models/*}", + "body": "model" + } + }, + { + "(google.api.method_signature)": "model,update_mask" + } + ] + }, + "DeployModel": { + "requestType": "DeployModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/models/*}:deploy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/models/*}:deploy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UndeployModel": { + "requestType": "UndeployModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/models/*}:undeploy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/models/*}:undeploy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ExportModel": { + "requestType": "ExportModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/models/*}:export", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,output_config", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/models/*}:export", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,output_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetModelEvaluation": { + "requestType": "GetModelEvaluationRequest", + "responseType": "ModelEvaluation", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/models/*/modelEvaluations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/models/*/modelEvaluations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListModelEvaluations": { + "requestType": "ListModelEvaluationsRequest", + "responseType": "ListModelEvaluationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/models/*}/modelEvaluations", + "(google.api.method_signature)": "parent,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/models/*}/modelEvaluations" + } + }, + { + "(google.api.method_signature)": "parent,filter" + } + ] + } + } + }, + "CreateDatasetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "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": "automl.googleapis.com/Dataset" + } + } + } + }, + "ListDatasetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 6 + } + } + }, + "ListDatasetsResponse": { + "fields": { + "datasets": { + "rule": "repeated", + "type": "Dataset", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateDatasetRequest": { + "fields": { + "dataset": { + "type": "Dataset", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteDatasetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Dataset" + } + } + } + }, + "ImportDataRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Dataset" + } + }, + "inputConfig": { + "type": "InputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ExportDataRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Dataset" + } + }, + "outputConfig": { + "type": "OutputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetAnnotationSpecRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/AnnotationSpec" + } + } + } + }, + "CreateModelRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "model": { + "type": "Model", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + } + } + }, + "ListModelsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 6 + } + } + }, + "ListModelsResponse": { + "fields": { + "model": { + "rule": "repeated", + "type": "Model", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + } + } + }, + "UpdateModelRequest": { + "fields": { + "model": { + "type": "Model", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeployModelRequest": { + "oneofs": { + "modelDeploymentMetadata": { + "oneof": [ + "imageObjectDetectionModelDeploymentMetadata", + "imageClassificationModelDeploymentMetadata" + ] + } + }, + "fields": { + "imageObjectDetectionModelDeploymentMetadata": { + "type": "ImageObjectDetectionModelDeploymentMetadata", + "id": 2 + }, + "imageClassificationModelDeploymentMetadata": { + "type": "ImageClassificationModelDeploymentMetadata", + "id": 4 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + } + } + }, + "UndeployModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + } + } + }, + "ExportModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + }, + "outputConfig": { + "type": "ModelExportOutputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetModelEvaluationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/ModelEvaluation" + } + } + } + }, + "ListModelEvaluationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + }, + "filter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 6 + } + } + }, + "ListModelEvaluationsResponse": { + "fields": { + "modelEvaluation": { + "rule": "repeated", + "type": "ModelEvaluation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + } + } + }, + "v1beta1": { + "options": { + "go_package": "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb", + "java_multiple_files": true, + "java_package": "com.google.cloud.automl.v1beta1", + "php_namespace": "Google\\Cloud\\AutoMl\\V1beta1", + "ruby_package": "Google::Cloud::AutoML::V1beta1", + "java_outer_classname": "AutoMlProto" + }, + "nested": { + "AnnotationPayload": { + "oneofs": { + "detail": { + "oneof": [ + "translation", + "classification", + "imageObjectDetection", + "videoClassification", + "videoObjectTracking", + "textExtraction", + "textSentiment", + "tables" + ] + } + }, + "fields": { + "translation": { + "type": "TranslationAnnotation", + "id": 2 + }, + "classification": { + "type": "ClassificationAnnotation", + "id": 3 + }, + "imageObjectDetection": { + "type": "ImageObjectDetectionAnnotation", + "id": 4 + }, + "videoClassification": { + "type": "VideoClassificationAnnotation", + "id": 9 + }, + "videoObjectTracking": { + "type": "VideoObjectTrackingAnnotation", + "id": 8 + }, + "textExtraction": { + "type": "TextExtractionAnnotation", + "id": 6 + }, + "textSentiment": { + "type": "TextSentimentAnnotation", + "id": 7 + }, + "tables": { + "type": "TablesAnnotation", + "id": 10 + }, + "annotationSpecId": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 5 + } + } + }, + "ClassificationType": { + "values": { + "CLASSIFICATION_TYPE_UNSPECIFIED": 0, + "MULTICLASS": 1, + "MULTILABEL": 2 + } + }, + "ClassificationAnnotation": { + "fields": { + "score": { + "type": "float", + "id": 1 + } + } + }, + "VideoClassificationAnnotation": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "classificationAnnotation": { + "type": "ClassificationAnnotation", + "id": 2 + }, + "timeSegment": { + "type": "TimeSegment", + "id": 3 + } + } + }, + "ClassificationEvaluationMetrics": { + "fields": { + "auPrc": { + "type": "float", + "id": 1 + }, + "baseAuPrc": { + "type": "float", + "id": 2, + "options": { + "deprecated": true + } + }, + "auRoc": { + "type": "float", + "id": 6 + }, + "logLoss": { + "type": "float", + "id": 7 + }, + "confidenceMetricsEntry": { + "rule": "repeated", + "type": "ConfidenceMetricsEntry", + "id": 3 + }, + "confusionMatrix": { + "type": "ConfusionMatrix", + "id": 4 + }, + "annotationSpecId": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "ConfidenceMetricsEntry": { + "fields": { + "confidenceThreshold": { + "type": "float", + "id": 1 + }, + "positionThreshold": { + "type": "int32", + "id": 14 + }, + "recall": { + "type": "float", + "id": 2 + }, + "precision": { + "type": "float", + "id": 3 + }, + "falsePositiveRate": { + "type": "float", + "id": 8 + }, + "f1Score": { + "type": "float", + "id": 4 + }, + "recallAt1": { + "type": "float", + "id": 5 + }, + "precisionAt1": { + "type": "float", + "id": 6 + }, + "falsePositiveRateAt1": { + "type": "float", + "id": 9 + }, + "f1ScoreAt1": { + "type": "float", + "id": 7 + }, + "truePositiveCount": { + "type": "int64", + "id": 10 + }, + "falsePositiveCount": { + "type": "int64", + "id": 11 + }, + "falseNegativeCount": { + "type": "int64", + "id": 12 + }, + "trueNegativeCount": { + "type": "int64", + "id": 13 + } + } + }, + "ConfusionMatrix": { + "fields": { + "annotationSpecId": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "displayName": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "row": { + "rule": "repeated", + "type": "Row", + "id": 2 + } + }, + "nested": { + "Row": { + "fields": { + "exampleCount": { + "rule": "repeated", + "type": "int32", + "id": 1 + } + } + } + } + } + } + }, + "TimeSegment": { + "fields": { + "startTimeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTimeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "ImageObjectDetectionAnnotation": { + "fields": { + "boundingBox": { + "type": "BoundingPoly", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + } + } + }, + "VideoObjectTrackingAnnotation": { + "fields": { + "instanceId": { + "type": "string", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 3 + }, + "score": { + "type": "float", + "id": 4 + } + } + }, + "BoundingBoxMetricsEntry": { + "fields": { + "iouThreshold": { + "type": "float", + "id": 1 + }, + "meanAveragePrecision": { + "type": "float", + "id": 2 + }, + "confidenceMetricsEntries": { + "rule": "repeated", + "type": "ConfidenceMetricsEntry", + "id": 3 + } + }, + "nested": { + "ConfidenceMetricsEntry": { + "fields": { + "confidenceThreshold": { + "type": "float", + "id": 1 + }, + "recall": { + "type": "float", + "id": 2 + }, + "precision": { + "type": "float", + "id": 3 + }, + "f1Score": { + "type": "float", + "id": 4 + } + } + } + } + }, + "ImageObjectDetectionEvaluationMetrics": { + "fields": { + "evaluatedBoundingBoxCount": { + "type": "int32", + "id": 1 + }, + "boundingBoxMetricsEntries": { + "rule": "repeated", + "type": "BoundingBoxMetricsEntry", + "id": 2 + }, + "boundingBoxMeanAveragePrecision": { + "type": "float", + "id": 3 + } + } + }, + "VideoObjectTrackingEvaluationMetrics": { + "fields": { + "evaluatedFrameCount": { + "type": "int32", + "id": 1 + }, + "evaluatedBoundingBoxCount": { + "type": "int32", + "id": 2 + }, + "boundingBoxMetricsEntries": { + "rule": "repeated", + "type": "BoundingBoxMetricsEntry", + "id": 4 + }, + "boundingBoxMeanAveragePrecision": { + "type": "float", + "id": 6 + } + } + }, + "NormalizedVertex": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + } + } + }, + "BoundingPoly": { + "fields": { + "normalizedVertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 2 + } + } + }, + "TablesDatasetMetadata": { + "fields": { + "primaryTableSpecId": { + "type": "string", + "id": 1 + }, + "targetColumnSpecId": { + "type": "string", + "id": 2 + }, + "weightColumnSpecId": { + "type": "string", + "id": 3 + }, + "mlUseColumnSpecId": { + "type": "string", + "id": 4 + }, + "targetColumnCorrelations": { + "keyType": "string", + "type": "CorrelationStats", + "id": 6 + }, + "statsUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + } + } + }, + "TablesModelMetadata": { + "oneofs": { + "additionalOptimizationObjectiveConfig": { + "oneof": [ + "optimizationObjectiveRecallValue", + "optimizationObjectivePrecisionValue" + ] + } + }, + "fields": { + "optimizationObjectiveRecallValue": { + "type": "float", + "id": 17 + }, + "optimizationObjectivePrecisionValue": { + "type": "float", + "id": 18 + }, + "targetColumnSpec": { + "type": "ColumnSpec", + "id": 2 + }, + "inputFeatureColumnSpecs": { + "rule": "repeated", + "type": "ColumnSpec", + "id": 3 + }, + "optimizationObjective": { + "type": "string", + "id": 4 + }, + "tablesModelColumnInfo": { + "rule": "repeated", + "type": "TablesModelColumnInfo", + "id": 5 + }, + "trainBudgetMilliNodeHours": { + "type": "int64", + "id": 6 + }, + "trainCostMilliNodeHours": { + "type": "int64", + "id": 7 + }, + "disableEarlyStopping": { + "type": "bool", + "id": 12 + } + } + }, + "TablesAnnotation": { + "fields": { + "score": { + "type": "float", + "id": 1 + }, + "predictionInterval": { + "type": "DoubleRange", + "id": 4 + }, + "value": { + "type": "google.protobuf.Value", + "id": 2 + }, + "tablesModelColumnInfo": { + "rule": "repeated", + "type": "TablesModelColumnInfo", + "id": 3 + }, + "baselineScore": { + "type": "float", + "id": 5 + } + } + }, + "TablesModelColumnInfo": { + "fields": { + "columnSpecName": { + "type": "string", + "id": 1 + }, + "columnDisplayName": { + "type": "string", + "id": 2 + }, + "featureImportance": { + "type": "float", + "id": 3 + } + } + }, + "ColumnSpec": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/ColumnSpec", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}/columnSpecs/{column_spec}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "dataType": { + "type": "DataType", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + }, + "dataStats": { + "type": "DataStats", + "id": 4 + }, + "topCorrelatedColumns": { + "rule": "repeated", + "type": "CorrelatedColumn", + "id": 5 + }, + "etag": { + "type": "string", + "id": 6 + } + }, + "nested": { + "CorrelatedColumn": { + "fields": { + "columnSpecId": { + "type": "string", + "id": 1 + }, + "correlationStats": { + "type": "CorrelationStats", + "id": 2 + } + } + } + } + }, + "DataStats": { + "oneofs": { + "stats": { + "oneof": [ + "float64Stats", + "stringStats", + "timestampStats", + "arrayStats", + "structStats", + "categoryStats" + ] + } + }, + "fields": { + "float64Stats": { + "type": "Float64Stats", + "id": 3 + }, + "stringStats": { + "type": "StringStats", + "id": 4 + }, + "timestampStats": { + "type": "TimestampStats", + "id": 5 + }, + "arrayStats": { + "type": "ArrayStats", + "id": 6 + }, + "structStats": { + "type": "StructStats", + "id": 7 + }, + "categoryStats": { + "type": "CategoryStats", + "id": 8 + }, + "distinctValueCount": { + "type": "int64", + "id": 1 + }, + "nullValueCount": { + "type": "int64", + "id": 2 + }, + "validValueCount": { + "type": "int64", + "id": 9 + } + } + }, + "Float64Stats": { + "fields": { + "mean": { + "type": "double", + "id": 1 + }, + "standardDeviation": { + "type": "double", + "id": 2 + }, + "quantiles": { + "rule": "repeated", + "type": "double", + "id": 3 + }, + "histogramBuckets": { + "rule": "repeated", + "type": "HistogramBucket", + "id": 4 + } + }, + "nested": { + "HistogramBucket": { + "fields": { + "min": { + "type": "double", + "id": 1 + }, + "max": { + "type": "double", + "id": 2 + }, + "count": { + "type": "int64", + "id": 3 + } + } + } + } + }, + "StringStats": { + "fields": { + "topUnigramStats": { + "rule": "repeated", + "type": "UnigramStats", + "id": 1 + } + }, + "nested": { + "UnigramStats": { + "fields": { + "value": { + "type": "string", + "id": 1 + }, + "count": { + "type": "int64", + "id": 2 + } + } + } + } + }, + "TimestampStats": { + "fields": { + "granularStats": { + "keyType": "string", + "type": "GranularStats", + "id": 1 + } + }, + "nested": { + "GranularStats": { + "fields": { + "buckets": { + "keyType": "int32", + "type": "int64", + "id": 1 + } + } + } + } + }, + "ArrayStats": { + "fields": { + "memberStats": { + "type": "DataStats", + "id": 2 + } + } + }, + "StructStats": { + "fields": { + "fieldStats": { + "keyType": "string", + "type": "DataStats", + "id": 1 + } + } + }, + "CategoryStats": { + "fields": { + "topCategoryStats": { + "rule": "repeated", + "type": "SingleCategoryStats", + "id": 1 + } + }, + "nested": { + "SingleCategoryStats": { + "fields": { + "value": { + "type": "string", + "id": 1 + }, + "count": { + "type": "int64", + "id": 2 + } + } + } + } + }, + "CorrelationStats": { + "fields": { + "cramersV": { + "type": "double", + "id": 1 + } + } + }, + "TypeCode": { + "values": { + "TYPE_CODE_UNSPECIFIED": 0, + "FLOAT64": 3, + "TIMESTAMP": 4, + "STRING": 6, + "ARRAY": 8, + "STRUCT": 9, + "CATEGORY": 10 + } + }, + "DataType": { + "oneofs": { + "details": { + "oneof": [ + "listElementType", + "structType", + "timeFormat" + ] + } + }, + "fields": { + "listElementType": { + "type": "DataType", + "id": 2 + }, + "structType": { + "type": "StructType", + "id": 3 + }, + "timeFormat": { + "type": "string", + "id": 5 + }, + "typeCode": { + "type": "TypeCode", + "id": 1 + }, + "nullable": { + "type": "bool", + "id": 4 + } + } + }, + "StructType": { + "fields": { + "fields": { + "keyType": "string", + "type": "DataType", + "id": 1 + } + } + }, + "Image": { + "oneofs": { + "data": { + "oneof": [ + "imageBytes", + "inputConfig" + ] + } + }, + "fields": { + "imageBytes": { + "type": "bytes", + "id": 1 + }, + "inputConfig": { + "type": "InputConfig", + "id": 6 + }, + "thumbnailUri": { + "type": "string", + "id": 4 + } + } + }, + "TextSnippet": { + "fields": { + "content": { + "type": "string", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 2 + }, + "contentUri": { + "type": "string", + "id": 4 + } + } + }, + "DocumentDimensions": { + "fields": { + "unit": { + "type": "DocumentDimensionUnit", + "id": 1 + }, + "width": { + "type": "float", + "id": 2 + }, + "height": { + "type": "float", + "id": 3 + } + }, + "nested": { + "DocumentDimensionUnit": { + "values": { + "DOCUMENT_DIMENSION_UNIT_UNSPECIFIED": 0, + "INCH": 1, + "CENTIMETER": 2, + "POINT": 3 + } + } + } + }, + "Document": { + "fields": { + "inputConfig": { + "type": "DocumentInputConfig", + "id": 1 + }, + "documentText": { + "type": "TextSnippet", + "id": 2 + }, + "layout": { + "rule": "repeated", + "type": "Layout", + "id": 3 + }, + "documentDimensions": { + "type": "DocumentDimensions", + "id": 4 + }, + "pageCount": { + "type": "int32", + "id": 5 + } + }, + "nested": { + "Layout": { + "fields": { + "textSegment": { + "type": "TextSegment", + "id": 1 + }, + "pageNumber": { + "type": "int32", + "id": 2 + }, + "boundingPoly": { + "type": "BoundingPoly", + "id": 3 + }, + "textSegmentType": { + "type": "TextSegmentType", + "id": 4 + } + }, + "nested": { + "TextSegmentType": { + "values": { + "TEXT_SEGMENT_TYPE_UNSPECIFIED": 0, + "TOKEN": 1, + "PARAGRAPH": 2, + "FORM_FIELD": 3, + "FORM_FIELD_NAME": 4, + "FORM_FIELD_CONTENTS": 5, + "TABLE": 6, + "TABLE_HEADER": 7, + "TABLE_ROW": 8, + "TABLE_CELL": 9 + } + } + } + } + } + }, + "Row": { + "fields": { + "columnSpecIds": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "values": { + "rule": "repeated", + "type": "google.protobuf.Value", + "id": 3 + } + } + }, + "ExamplePayload": { + "oneofs": { + "payload": { + "oneof": [ + "image", + "textSnippet", + "document", + "row" + ] + } + }, + "fields": { + "image": { + "type": "Image", + "id": 1 + }, + "textSnippet": { + "type": "TextSnippet", + "id": 2 + }, + "document": { + "type": "Document", + "id": 4 + }, + "row": { + "type": "Row", + "id": 3 + } + } + }, + "InputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource", + "bigquerySource" + ] + } + }, + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + }, + "bigquerySource": { + "type": "BigQuerySource", + "id": 3 + }, + "params": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "BatchPredictInputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource", + "bigquerySource" + ] + } + }, + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + }, + "bigquerySource": { + "type": "BigQuerySource", + "id": 2 + } + } + }, + "DocumentInputConfig": { + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + } + } + }, + "OutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination", + "bigqueryDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + }, + "bigqueryDestination": { + "type": "BigQueryDestination", + "id": 2 + } + } + }, + "BatchPredictOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination", + "bigqueryDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + }, + "bigqueryDestination": { + "type": "BigQueryDestination", + "id": 2 + } + } + }, + "ModelExportOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination", + "gcrDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + }, + "gcrDestination": { + "type": "GcrDestination", + "id": 3 + }, + "modelFormat": { + "type": "string", + "id": 4 + }, + "params": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "ExportEvaluatedExamplesOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "bigqueryDestination" + ] + } + }, + "fields": { + "bigqueryDestination": { + "type": "BigQueryDestination", + "id": 2 + } + } + }, + "GcsSource": { + "fields": { + "inputUris": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "BigQuerySource": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + } + } + }, + "GcsDestination": { + "fields": { + "outputUriPrefix": { + "type": "string", + "id": 1 + } + } + }, + "BigQueryDestination": { + "fields": { + "outputUri": { + "type": "string", + "id": 1 + } + } + }, + "GcrDestination": { + "fields": { + "outputUri": { + "type": "string", + "id": 1 + } + } + }, + "TextSegment": { + "fields": { + "content": { + "type": "string", + "id": 3 + }, + "startOffset": { + "type": "int64", + "id": 1 + }, + "endOffset": { + "type": "int64", + "id": 2 + } + } + }, + "DoubleRange": { + "fields": { + "start": { + "type": "double", + "id": 1 + }, + "end": { + "type": "double", + "id": 2 + } + } + }, + "RegressionEvaluationMetrics": { + "fields": { + "rootMeanSquaredError": { + "type": "float", + "id": 1 + }, + "meanAbsoluteError": { + "type": "float", + "id": 2 + }, + "meanAbsolutePercentageError": { + "type": "float", + "id": 3 + }, + "rSquared": { + "type": "float", + "id": 4 + }, + "rootMeanSquaredLogError": { + "type": "float", + "id": 5 + } + } + }, + "TextExtractionAnnotation": { + "oneofs": { + "annotation": { + "oneof": [ + "textSegment" + ] + } + }, + "fields": { + "textSegment": { + "type": "TextSegment", + "id": 3 + }, + "score": { + "type": "float", + "id": 1 + } + } + }, + "TextExtractionEvaluationMetrics": { + "fields": { + "auPrc": { + "type": "float", + "id": 1 + }, + "confidenceMetricsEntries": { + "rule": "repeated", + "type": "ConfidenceMetricsEntry", + "id": 2 + } + }, + "nested": { + "ConfidenceMetricsEntry": { + "fields": { + "confidenceThreshold": { + "type": "float", + "id": 1 + }, + "recall": { + "type": "float", + "id": 3 + }, + "precision": { + "type": "float", + "id": 4 + }, + "f1Score": { + "type": "float", + "id": 5 + } + } + } + } + }, + "TextSentimentAnnotation": { + "fields": { + "sentiment": { + "type": "int32", + "id": 1 + } + } + }, + "TextSentimentEvaluationMetrics": { + "fields": { + "precision": { + "type": "float", + "id": 1 + }, + "recall": { + "type": "float", + "id": 2 + }, + "f1Score": { + "type": "float", + "id": 3 + }, + "meanAbsoluteError": { + "type": "float", + "id": 4 + }, + "meanSquaredError": { + "type": "float", + "id": 5 + }, + "linearKappa": { + "type": "float", + "id": 6 + }, + "quadraticKappa": { + "type": "float", + "id": 7 + }, + "confusionMatrix": { + "type": "ClassificationEvaluationMetrics.ConfusionMatrix", + "id": 8 + }, + "annotationSpecId": { + "rule": "repeated", + "type": "string", + "id": 9, + "options": { + "deprecated": true + } + } + } + }, + "TranslationDatasetMetadata": { + "fields": { + "sourceLanguageCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetLanguageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TranslationEvaluationMetrics": { + "fields": { + "bleuScore": { + "type": "double", + "id": 1 + }, + "baseBleuScore": { + "type": "double", + "id": 2 + } + } + }, + "TranslationModelMetadata": { + "fields": { + "baseModel": { + "type": "string", + "id": 1 + }, + "sourceLanguageCode": { + "type": "string", + "id": 2 + }, + "targetLanguageCode": { + "type": "string", + "id": 3 + } + } + }, + "TranslationAnnotation": { + "fields": { + "translatedContent": { + "type": "TextSnippet", + "id": 1 + } + } + }, + "AnnotationSpec": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/AnnotationSpec", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "exampleCount": { + "type": "int32", + "id": 9 + } + } + }, + "Dataset": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/Dataset", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/datasets/{dataset}" + }, + "oneofs": { + "datasetMetadata": { + "oneof": [ + "translationDatasetMetadata", + "imageClassificationDatasetMetadata", + "textClassificationDatasetMetadata", + "imageObjectDetectionDatasetMetadata", + "videoClassificationDatasetMetadata", + "videoObjectTrackingDatasetMetadata", + "textExtractionDatasetMetadata", + "textSentimentDatasetMetadata", + "tablesDatasetMetadata" + ] + } + }, + "fields": { + "translationDatasetMetadata": { + "type": "TranslationDatasetMetadata", + "id": 23 + }, + "imageClassificationDatasetMetadata": { + "type": "ImageClassificationDatasetMetadata", + "id": 24 + }, + "textClassificationDatasetMetadata": { + "type": "TextClassificationDatasetMetadata", + "id": 25 + }, + "imageObjectDetectionDatasetMetadata": { + "type": "ImageObjectDetectionDatasetMetadata", + "id": 26 + }, + "videoClassificationDatasetMetadata": { + "type": "VideoClassificationDatasetMetadata", + "id": 31 + }, + "videoObjectTrackingDatasetMetadata": { + "type": "VideoObjectTrackingDatasetMetadata", + "id": 29 + }, + "textExtractionDatasetMetadata": { + "type": "TextExtractionDatasetMetadata", + "id": 28 + }, + "textSentimentDatasetMetadata": { + "type": "TextSentimentDatasetMetadata", + "id": 30 + }, + "tablesDatasetMetadata": { + "type": "TablesDatasetMetadata", + "id": 33 + }, + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "exampleCount": { + "type": "int32", + "id": 21 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 14 + }, + "etag": { + "type": "string", + "id": 17 + } + } + }, + "ImageClassificationDatasetMetadata": { + "fields": { + "classificationType": { + "type": "ClassificationType", + "id": 1 + } + } + }, + "ImageObjectDetectionDatasetMetadata": { + "fields": {} + }, + "ImageClassificationModelMetadata": { + "fields": { + "baseModelId": { + "type": "string", + "id": 1 + }, + "trainBudget": { + "type": "int64", + "id": 2 + }, + "trainCost": { + "type": "int64", + "id": 3 + }, + "stopReason": { + "type": "string", + "id": 5 + }, + "modelType": { + "type": "string", + "id": 7 + }, + "nodeQps": { + "type": "double", + "id": 13 + }, + "nodeCount": { + "type": "int64", + "id": 14 + } + } + }, + "ImageObjectDetectionModelMetadata": { + "fields": { + "modelType": { + "type": "string", + "id": 1 + }, + "nodeCount": { + "type": "int64", + "id": 3 + }, + "nodeQps": { + "type": "double", + "id": 4 + }, + "stopReason": { + "type": "string", + "id": 5 + }, + "trainBudgetMilliNodeHours": { + "type": "int64", + "id": 6 + }, + "trainCostMilliNodeHours": { + "type": "int64", + "id": 7 + } + } + }, + "ImageClassificationModelDeploymentMetadata": { + "fields": { + "nodeCount": { + "type": "int64", + "id": 1 + } + } + }, + "ImageObjectDetectionModelDeploymentMetadata": { + "fields": { + "nodeCount": { + "type": "int64", + "id": 1 + } + } + }, + "TextClassificationDatasetMetadata": { + "fields": { + "classificationType": { + "type": "ClassificationType", + "id": 1 + } + } + }, + "TextClassificationModelMetadata": { + "fields": { + "classificationType": { + "type": "ClassificationType", + "id": 3 + } + } + }, + "TextExtractionDatasetMetadata": { + "fields": {} + }, + "TextExtractionModelMetadata": { + "fields": { + "modelHint": { + "type": "string", + "id": 3 + } + } + }, + "TextSentimentDatasetMetadata": { + "fields": { + "sentimentMax": { + "type": "int32", + "id": 1 + } + } + }, + "TextSentimentModelMetadata": { + "fields": {} + }, + "VideoClassificationDatasetMetadata": { + "fields": {} + }, + "VideoObjectTrackingDatasetMetadata": { + "fields": {} + }, + "VideoClassificationModelMetadata": { + "fields": {} + }, + "VideoObjectTrackingModelMetadata": { + "fields": {} + }, + "Model": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/Model", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/models/{model}" + }, + "oneofs": { + "modelMetadata": { + "oneof": [ + "translationModelMetadata", + "imageClassificationModelMetadata", + "textClassificationModelMetadata", + "imageObjectDetectionModelMetadata", + "videoClassificationModelMetadata", + "videoObjectTrackingModelMetadata", + "textExtractionModelMetadata", + "tablesModelMetadata", + "textSentimentModelMetadata" + ] + } + }, + "fields": { + "translationModelMetadata": { + "type": "TranslationModelMetadata", + "id": 15 + }, + "imageClassificationModelMetadata": { + "type": "ImageClassificationModelMetadata", + "id": 13 + }, + "textClassificationModelMetadata": { + "type": "TextClassificationModelMetadata", + "id": 14 + }, + "imageObjectDetectionModelMetadata": { + "type": "ImageObjectDetectionModelMetadata", + "id": 20 + }, + "videoClassificationModelMetadata": { + "type": "VideoClassificationModelMetadata", + "id": 23 + }, + "videoObjectTrackingModelMetadata": { + "type": "VideoObjectTrackingModelMetadata", + "id": 21 + }, + "textExtractionModelMetadata": { + "type": "TextExtractionModelMetadata", + "id": 19 + }, + "tablesModelMetadata": { + "type": "TablesModelMetadata", + "id": 24 + }, + "textSentimentModelMetadata": { + "type": "TextSentimentModelMetadata", + "id": 22 + }, + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "datasetId": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 11 + }, + "deploymentState": { + "type": "DeploymentState", + "id": 8 + } + }, + "nested": { + "DeploymentState": { + "values": { + "DEPLOYMENT_STATE_UNSPECIFIED": 0, + "DEPLOYED": 1, + "UNDEPLOYED": 2 + } + } + } + }, + "ModelEvaluation": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/ModelEvaluation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}" + }, + "oneofs": { + "metrics": { + "oneof": [ + "classificationEvaluationMetrics", + "regressionEvaluationMetrics", + "translationEvaluationMetrics", + "imageObjectDetectionEvaluationMetrics", + "videoObjectTrackingEvaluationMetrics", + "textSentimentEvaluationMetrics", + "textExtractionEvaluationMetrics" + ] + } + }, + "fields": { + "classificationEvaluationMetrics": { + "type": "ClassificationEvaluationMetrics", + "id": 8 + }, + "regressionEvaluationMetrics": { + "type": "RegressionEvaluationMetrics", + "id": 24 + }, + "translationEvaluationMetrics": { + "type": "TranslationEvaluationMetrics", + "id": 9 + }, + "imageObjectDetectionEvaluationMetrics": { + "type": "ImageObjectDetectionEvaluationMetrics", + "id": 12 + }, + "videoObjectTrackingEvaluationMetrics": { + "type": "VideoObjectTrackingEvaluationMetrics", + "id": 14 + }, + "textSentimentEvaluationMetrics": { + "type": "TextSentimentEvaluationMetrics", + "id": 11 + }, + "textExtractionEvaluationMetrics": { + "type": "TextExtractionEvaluationMetrics", + "id": 13 + }, + "name": { + "type": "string", + "id": 1 + }, + "annotationSpecId": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 15 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "evaluatedExampleCount": { + "type": "int32", + "id": 6 + } + } + }, + "OperationMetadata": { + "oneofs": { + "details": { + "oneof": [ + "deleteDetails", + "deployModelDetails", + "undeployModelDetails", + "createModelDetails", + "importDataDetails", + "batchPredictDetails", + "exportDataDetails", + "exportModelDetails", + "exportEvaluatedExamplesDetails" + ] + } + }, + "fields": { + "deleteDetails": { + "type": "DeleteOperationMetadata", + "id": 8 + }, + "deployModelDetails": { + "type": "DeployModelOperationMetadata", + "id": 24 + }, + "undeployModelDetails": { + "type": "UndeployModelOperationMetadata", + "id": 25 + }, + "createModelDetails": { + "type": "CreateModelOperationMetadata", + "id": 10 + }, + "importDataDetails": { + "type": "ImportDataOperationMetadata", + "id": 15 + }, + "batchPredictDetails": { + "type": "BatchPredictOperationMetadata", + "id": 16 + }, + "exportDataDetails": { + "type": "ExportDataOperationMetadata", + "id": 21 + }, + "exportModelDetails": { + "type": "ExportModelOperationMetadata", + "id": 22 + }, + "exportEvaluatedExamplesDetails": { + "type": "ExportEvaluatedExamplesOperationMetadata", + "id": 26 + }, + "progressPercent": { + "type": "int32", + "id": 13 + }, + "partialFailures": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "DeleteOperationMetadata": { + "fields": {} + }, + "DeployModelOperationMetadata": { + "fields": {} + }, + "UndeployModelOperationMetadata": { + "fields": {} + }, + "CreateModelOperationMetadata": { + "fields": {} + }, + "ImportDataOperationMetadata": { + "fields": {} + }, + "ExportDataOperationMetadata": { + "fields": { + "outputInfo": { + "type": "ExportDataOutputInfo", + "id": 1 + } + }, + "nested": { + "ExportDataOutputInfo": { + "oneofs": { + "outputLocation": { + "oneof": [ + "gcsOutputDirectory", + "bigqueryOutputDataset" + ] + } + }, + "fields": { + "gcsOutputDirectory": { + "type": "string", + "id": 1 + }, + "bigqueryOutputDataset": { + "type": "string", + "id": 2 + } + } + } + } + }, + "BatchPredictOperationMetadata": { + "fields": { + "inputConfig": { + "type": "BatchPredictInputConfig", + "id": 1 + }, + "outputInfo": { + "type": "BatchPredictOutputInfo", + "id": 2 + } + }, + "nested": { + "BatchPredictOutputInfo": { + "oneofs": { + "outputLocation": { + "oneof": [ + "gcsOutputDirectory", + "bigqueryOutputDataset" + ] + } + }, + "fields": { + "gcsOutputDirectory": { + "type": "string", + "id": 1 + }, + "bigqueryOutputDataset": { + "type": "string", + "id": 2 + } + } + } + } + }, + "ExportModelOperationMetadata": { + "fields": { + "outputInfo": { + "type": "ExportModelOutputInfo", + "id": 2 + } + }, + "nested": { + "ExportModelOutputInfo": { + "fields": { + "gcsOutputDirectory": { + "type": "string", + "id": 1 + } + } + } + } + }, + "ExportEvaluatedExamplesOperationMetadata": { + "fields": { + "outputInfo": { + "type": "ExportEvaluatedExamplesOutputInfo", + "id": 2 + } + }, + "nested": { + "ExportEvaluatedExamplesOutputInfo": { + "fields": { + "bigqueryOutputDataset": { + "type": "string", + "id": 2 + } + } + } + } + }, + "PredictionService": { + "options": { + "(google.api.default_host)": "automl.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Predict": { + "requestType": "PredictRequest", + "responseType": "PredictResponse", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/models/*}:predict", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,payload,params" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/models/*}:predict", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,payload,params" + } + ] + }, + "BatchPredict": { + "requestType": "BatchPredictRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/models/*}:batchPredict", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,input_config,output_config,params", + "(google.longrunning.operation_info).response_type": "BatchPredictResult", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/models/*}:batchPredict", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,input_config,output_config,params" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchPredictResult", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "PredictRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + }, + "payload": { + "type": "ExamplePayload", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "params": { + "keyType": "string", + "type": "string", + "id": 3 + } + } + }, + "PredictResponse": { + "fields": { + "payload": { + "rule": "repeated", + "type": "AnnotationPayload", + "id": 1 + }, + "preprocessedInput": { + "type": "ExamplePayload", + "id": 3 + }, + "metadata": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "BatchPredictRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + }, + "inputConfig": { + "type": "BatchPredictInputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputConfig": { + "type": "BatchPredictOutputConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "params": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchPredictResult": { + "fields": { + "metadata": { + "keyType": "string", + "type": "string", + "id": 1 + } + } + }, + "AutoMl": { + "options": { + "(google.api.default_host)": "automl.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/*/locations/*}/datasets", + "(google.api.http).body": "dataset", + "(google.api.method_signature)": "parent,dataset" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/*}/datasets", + "body": "dataset" + } + }, + { + "(google.api.method_signature)": "parent,dataset" + } + ] + }, + "GetDataset": { + "requestType": "GetDatasetRequest", + "responseType": "Dataset", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/datasets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/datasets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDatasets": { + "requestType": "ListDatasetsRequest", + "responseType": "ListDatasetsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*}/datasets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*}/datasets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateDataset": { + "requestType": "UpdateDatasetRequest", + "responseType": "Dataset", + "options": { + "(google.api.http).patch": "/v1beta1/{dataset.name=projects/*/locations/*/datasets/*}", + "(google.api.http).body": "dataset", + "(google.api.method_signature)": "dataset" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{dataset.name=projects/*/locations/*/datasets/*}", + "body": "dataset" + } + }, + { + "(google.api.method_signature)": "dataset" + } + ] + }, + "DeleteDataset": { + "requestType": "DeleteDatasetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta1/{name=projects/*/locations/*/datasets/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=projects/*/locations/*/datasets/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ImportData": { + "requestType": "ImportDataRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/datasets/*}:importData", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,input_config", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/datasets/*}:importData", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,input_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ExportData": { + "requestType": "ExportDataRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/datasets/*}:exportData", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,output_config", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/datasets/*}:exportData", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,output_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetAnnotationSpec": { + "requestType": "GetAnnotationSpecRequest", + "responseType": "AnnotationSpec", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetTableSpec": { + "requestType": "GetTableSpecRequest", + "responseType": "TableSpec", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/datasets/*/tableSpecs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/datasets/*/tableSpecs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListTableSpecs": { + "requestType": "ListTableSpecsRequest", + "responseType": "ListTableSpecsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*/datasets/*}/tableSpecs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*/datasets/*}/tableSpecs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateTableSpec": { + "requestType": "UpdateTableSpecRequest", + "responseType": "TableSpec", + "options": { + "(google.api.http).patch": "/v1beta1/{table_spec.name=projects/*/locations/*/datasets/*/tableSpecs/*}", + "(google.api.http).body": "table_spec", + "(google.api.method_signature)": "table_spec" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{table_spec.name=projects/*/locations/*/datasets/*/tableSpecs/*}", + "body": "table_spec" + } + }, + { + "(google.api.method_signature)": "table_spec" + } + ] + }, + "GetColumnSpec": { + "requestType": "GetColumnSpecRequest", + "responseType": "ColumnSpec", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/datasets/*/tableSpecs/*/columnSpecs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/datasets/*/tableSpecs/*/columnSpecs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListColumnSpecs": { + "requestType": "ListColumnSpecsRequest", + "responseType": "ListColumnSpecsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*/datasets/*/tableSpecs/*}/columnSpecs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*/datasets/*/tableSpecs/*}/columnSpecs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateColumnSpec": { + "requestType": "UpdateColumnSpecRequest", + "responseType": "ColumnSpec", + "options": { + "(google.api.http).patch": "/v1beta1/{column_spec.name=projects/*/locations/*/datasets/*/tableSpecs/*/columnSpecs/*}", + "(google.api.http).body": "column_spec", + "(google.api.method_signature)": "column_spec" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{column_spec.name=projects/*/locations/*/datasets/*/tableSpecs/*/columnSpecs/*}", + "body": "column_spec" + } + }, + { + "(google.api.method_signature)": "column_spec" + } + ] + }, + "CreateModel": { + "requestType": "CreateModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*}/models", + "(google.api.http).body": "model", + "(google.api.method_signature)": "parent,model", + "(google.longrunning.operation_info).response_type": "Model", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/*}/models", + "body": "model" + } + }, + { + "(google.api.method_signature)": "parent,model" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Model", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetModel": { + "requestType": "GetModelRequest", + "responseType": "Model", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/models/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/models/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListModels": { + "requestType": "ListModelsRequest", + "responseType": "ListModelsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*}/models", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*}/models" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteModel": { + "requestType": "DeleteModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta1/{name=projects/*/locations/*/models/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=projects/*/locations/*/models/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeployModel": { + "requestType": "DeployModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/models/*}:deploy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/models/*}:deploy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UndeployModel": { + "requestType": "UndeployModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/models/*}:undeploy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/models/*}:undeploy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ExportModel": { + "requestType": "ExportModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/models/*}:export", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,output_config", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/models/*}:export", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,output_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ExportEvaluatedExamples": { + "requestType": "ExportEvaluatedExamplesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/models/*}:exportEvaluatedExamples", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,output_config", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/models/*}:exportEvaluatedExamples", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,output_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetModelEvaluation": { + "requestType": "GetModelEvaluationRequest", + "responseType": "ModelEvaluation", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/models/*/modelEvaluations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/models/*/modelEvaluations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListModelEvaluations": { + "requestType": "ListModelEvaluationsRequest", + "responseType": "ListModelEvaluationsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*/models/*}/modelEvaluations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*/models/*}/modelEvaluations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateDatasetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "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": "automl.googleapis.com/Dataset" + } + } + } + }, + "ListDatasetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 6 + } + } + }, + "ListDatasetsResponse": { + "fields": { + "datasets": { + "rule": "repeated", + "type": "Dataset", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateDatasetRequest": { + "fields": { + "dataset": { + "type": "Dataset", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteDatasetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Dataset" + } + } + } + }, + "ImportDataRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Dataset" + } + }, + "inputConfig": { + "type": "InputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ExportDataRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Dataset" + } + }, + "outputConfig": { + "type": "OutputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetAnnotationSpecRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/AnnotationSpec" + } + } + } + }, + "GetTableSpecRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/TableSpec" + } + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "ListTableSpecsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Dataset" + } + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 6 + } + } + }, + "ListTableSpecsResponse": { + "fields": { + "tableSpecs": { + "rule": "repeated", + "type": "TableSpec", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateTableSpecRequest": { + "fields": { + "tableSpec": { + "type": "TableSpec", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "GetColumnSpecRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/ColumnSpec" + } + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "ListColumnSpecsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/TableSpec" + } + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 6 + } + } + }, + "ListColumnSpecsResponse": { + "fields": { + "columnSpecs": { + "rule": "repeated", + "type": "ColumnSpec", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateColumnSpecRequest": { + "fields": { + "columnSpec": { + "type": "ColumnSpec", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "CreateModelRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "model": { + "type": "Model", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + } + } + }, + "ListModelsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 6 + } + } + }, + "ListModelsResponse": { + "fields": { + "model": { + "rule": "repeated", + "type": "Model", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + } + } + }, + "DeployModelRequest": { + "oneofs": { + "modelDeploymentMetadata": { + "oneof": [ + "imageObjectDetectionModelDeploymentMetadata", + "imageClassificationModelDeploymentMetadata" + ] + } + }, + "fields": { + "imageObjectDetectionModelDeploymentMetadata": { + "type": "ImageObjectDetectionModelDeploymentMetadata", + "id": 2 + }, + "imageClassificationModelDeploymentMetadata": { + "type": "ImageClassificationModelDeploymentMetadata", + "id": 4 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + } + } + }, + "UndeployModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + } + } + }, + "ExportModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + }, + "outputConfig": { + "type": "ModelExportOutputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ExportEvaluatedExamplesRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + }, + "outputConfig": { + "type": "ExportEvaluatedExamplesOutputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetModelEvaluationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/ModelEvaluation" + } + } + } + }, + "ListModelEvaluationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 6 + } + } + }, + "ListModelEvaluationsResponse": { + "fields": { + "modelEvaluation": { + "rule": "repeated", + "type": "ModelEvaluation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "TableSpec": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/TableSpec", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeColumnSpecId": { + "type": "string", + "id": 2 + }, + "rowCount": { + "type": "int64", + "id": 3 + }, + "validRowCount": { + "type": "int64", + "id": 4 + }, + "columnCount": { + "type": "int64", + "id": 7 + }, + "inputConfigs": { + "rule": "repeated", + "type": "InputConfig", + "id": 5 + }, + "etag": { + "type": "string", + "id": 6 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api;api", + "java_multiple_files": true, + "java_outer_classname": "LaunchStageProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + } + } + }, + "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 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "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 + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "target": { + "type": "OptionTargetType", + "id": 18 + }, + "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 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + } + } + }, + "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 + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + } + } + }, + "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-automl/samples/.eslintrc.yml b/packages/google-cloud-automl/samples/.eslintrc.yml new file mode 100644 index 00000000000..282535f55f6 --- /dev/null +++ b/packages/google-cloud-automl/samples/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/packages/google-cloud-automl/samples/README.md b/packages/google-cloud-automl/samples/README.md new file mode 100644 index 00000000000..461b945d23a --- /dev/null +++ b/packages/google-cloud-automl/samples/README.md @@ -0,0 +1,878 @@ +[//]: # "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 + +# [Cloud AutoML: 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) + * [Auto_ml.create_dataset](#auto_ml.create_dataset) + * [Auto_ml.create_model](#auto_ml.create_model) + * [Auto_ml.delete_dataset](#auto_ml.delete_dataset) + * [Auto_ml.delete_model](#auto_ml.delete_model) + * [Auto_ml.deploy_model](#auto_ml.deploy_model) + * [Auto_ml.export_data](#auto_ml.export_data) + * [Auto_ml.export_model](#auto_ml.export_model) + * [Auto_ml.get_annotation_spec](#auto_ml.get_annotation_spec) + * [Auto_ml.get_dataset](#auto_ml.get_dataset) + * [Auto_ml.get_model](#auto_ml.get_model) + * [Auto_ml.get_model_evaluation](#auto_ml.get_model_evaluation) + * [Auto_ml.import_data](#auto_ml.import_data) + * [Auto_ml.list_datasets](#auto_ml.list_datasets) + * [Auto_ml.list_model_evaluations](#auto_ml.list_model_evaluations) + * [Auto_ml.list_models](#auto_ml.list_models) + * [Auto_ml.undeploy_model](#auto_ml.undeploy_model) + * [Auto_ml.update_dataset](#auto_ml.update_dataset) + * [Auto_ml.update_model](#auto_ml.update_model) + * [Prediction_service.batch_predict](#prediction_service.batch_predict) + * [Prediction_service.predict](#prediction_service.predict) + * [Auto_ml.create_dataset](#auto_ml.create_dataset) + * [Auto_ml.create_model](#auto_ml.create_model) + * [Auto_ml.delete_dataset](#auto_ml.delete_dataset) + * [Auto_ml.delete_model](#auto_ml.delete_model) + * [Auto_ml.deploy_model](#auto_ml.deploy_model) + * [Auto_ml.export_data](#auto_ml.export_data) + * [Auto_ml.export_evaluated_examples](#auto_ml.export_evaluated_examples) + * [Auto_ml.export_model](#auto_ml.export_model) + * [Auto_ml.get_annotation_spec](#auto_ml.get_annotation_spec) + * [Auto_ml.get_column_spec](#auto_ml.get_column_spec) + * [Auto_ml.get_dataset](#auto_ml.get_dataset) + * [Auto_ml.get_model](#auto_ml.get_model) + * [Auto_ml.get_model_evaluation](#auto_ml.get_model_evaluation) + * [Auto_ml.get_table_spec](#auto_ml.get_table_spec) + * [Auto_ml.import_data](#auto_ml.import_data) + * [Auto_ml.list_column_specs](#auto_ml.list_column_specs) + * [Auto_ml.list_datasets](#auto_ml.list_datasets) + * [Auto_ml.list_model_evaluations](#auto_ml.list_model_evaluations) + * [Auto_ml.list_models](#auto_ml.list_models) + * [Auto_ml.list_table_specs](#auto_ml.list_table_specs) + * [Auto_ml.undeploy_model](#auto_ml.undeploy_model) + * [Auto_ml.update_column_spec](#auto_ml.update_column_spec) + * [Auto_ml.update_dataset](#auto_ml.update_dataset) + * [Auto_ml.update_table_spec](#auto_ml.update_table_spec) + * [Prediction_service.batch_predict](#prediction_service.batch_predict) + * [Prediction_service.predict](#prediction_service.predict) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Auto_ml.create_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.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-automl/samples/generated/v1/auto_ml.create_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.create_dataset.js` + + +----- + + + + +### Auto_ml.create_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_model.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-automl/samples/generated/v1/auto_ml.create_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.create_model.js` + + +----- + + + + +### Auto_ml.delete_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.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-automl/samples/generated/v1/auto_ml.delete_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_dataset.js` + + +----- + + + + +### Auto_ml.delete_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_model.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-automl/samples/generated/v1/auto_ml.delete_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_model.js` + + +----- + + + + +### Auto_ml.deploy_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.deploy_model.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-automl/samples/generated/v1/auto_ml.deploy_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.deploy_model.js` + + +----- + + + + +### Auto_ml.export_data + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.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-automl/samples/generated/v1/auto_ml.export_data.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.export_data.js` + + +----- + + + + +### Auto_ml.export_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_model.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-automl/samples/generated/v1/auto_ml.export_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.export_model.js` + + +----- + + + + +### Auto_ml.get_annotation_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_annotation_spec.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-automl/samples/generated/v1/auto_ml.get_annotation_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.get_annotation_spec.js` + + +----- + + + + +### Auto_ml.get_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.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-automl/samples/generated/v1/auto_ml.get_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.get_dataset.js` + + +----- + + + + +### Auto_ml.get_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model.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-automl/samples/generated/v1/auto_ml.get_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model.js` + + +----- + + + + +### Auto_ml.get_model_evaluation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model_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-automl/samples/generated/v1/auto_ml.get_model_evaluation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model_evaluation.js` + + +----- + + + + +### Auto_ml.import_data + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.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-automl/samples/generated/v1/auto_ml.import_data.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.import_data.js` + + +----- + + + + +### Auto_ml.list_datasets + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.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-automl/samples/generated/v1/auto_ml.list_datasets.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.list_datasets.js` + + +----- + + + + +### Auto_ml.list_model_evaluations + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_model_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-automl/samples/generated/v1/auto_ml.list_model_evaluations.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.list_model_evaluations.js` + + +----- + + + + +### Auto_ml.list_models + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_models.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-automl/samples/generated/v1/auto_ml.list_models.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.list_models.js` + + +----- + + + + +### Auto_ml.undeploy_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.undeploy_model.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-automl/samples/generated/v1/auto_ml.undeploy_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.undeploy_model.js` + + +----- + + + + +### Auto_ml.update_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_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-automl/samples/generated/v1/auto_ml.update_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.update_dataset.js` + + +----- + + + + +### Auto_ml.update_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_model.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-automl/samples/generated/v1/auto_ml.update_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.update_model.js` + + +----- + + + + +### Prediction_service.batch_predict + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/prediction_service.batch_predict.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-automl/samples/generated/v1/prediction_service.batch_predict.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/prediction_service.batch_predict.js` + + +----- + + + + +### Prediction_service.predict + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/prediction_service.predict.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-automl/samples/generated/v1/prediction_service.predict.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/prediction_service.predict.js` + + +----- + + + + +### Auto_ml.create_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.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-automl/samples/generated/v1beta1/auto_ml.create_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_dataset.js` + + +----- + + + + +### Auto_ml.create_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_model.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-automl/samples/generated/v1beta1/auto_ml.create_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_model.js` + + +----- + + + + +### Auto_ml.delete_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.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-automl/samples/generated/v1beta1/auto_ml.delete_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_dataset.js` + + +----- + + + + +### Auto_ml.delete_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_model.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-automl/samples/generated/v1beta1/auto_ml.delete_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_model.js` + + +----- + + + + +### Auto_ml.deploy_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.deploy_model.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-automl/samples/generated/v1beta1/auto_ml.deploy_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.deploy_model.js` + + +----- + + + + +### Auto_ml.export_data + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.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-automl/samples/generated/v1beta1/auto_ml.export_data.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_data.js` + + +----- + + + + +### Auto_ml.export_evaluated_examples + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_evaluated_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-automl/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js` + + +----- + + + + +### Auto_ml.export_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_model.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-automl/samples/generated/v1beta1/auto_ml.export_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_model.js` + + +----- + + + + +### Auto_ml.get_annotation_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_annotation_spec.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-automl/samples/generated/v1beta1/auto_ml.get_annotation_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_annotation_spec.js` + + +----- + + + + +### Auto_ml.get_column_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_column_spec.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-automl/samples/generated/v1beta1/auto_ml.get_column_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_column_spec.js` + + +----- + + + + +### Auto_ml.get_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.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-automl/samples/generated/v1beta1/auto_ml.get_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_dataset.js` + + +----- + + + + +### Auto_ml.get_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model.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-automl/samples/generated/v1beta1/auto_ml.get_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model.js` + + +----- + + + + +### Auto_ml.get_model_evaluation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model_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-automl/samples/generated/v1beta1/auto_ml.get_model_evaluation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model_evaluation.js` + + +----- + + + + +### Auto_ml.get_table_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_table_spec.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-automl/samples/generated/v1beta1/auto_ml.get_table_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_table_spec.js` + + +----- + + + + +### Auto_ml.import_data + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.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-automl/samples/generated/v1beta1/auto_ml.import_data.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.import_data.js` + + +----- + + + + +### Auto_ml.list_column_specs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_column_specs.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-automl/samples/generated/v1beta1/auto_ml.list_column_specs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_column_specs.js` + + +----- + + + + +### Auto_ml.list_datasets + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.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-automl/samples/generated/v1beta1/auto_ml.list_datasets.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_datasets.js` + + +----- + + + + +### Auto_ml.list_model_evaluations + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_model_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-automl/samples/generated/v1beta1/auto_ml.list_model_evaluations.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_model_evaluations.js` + + +----- + + + + +### Auto_ml.list_models + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_models.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-automl/samples/generated/v1beta1/auto_ml.list_models.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_models.js` + + +----- + + + + +### Auto_ml.list_table_specs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_table_specs.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-automl/samples/generated/v1beta1/auto_ml.list_table_specs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_table_specs.js` + + +----- + + + + +### Auto_ml.undeploy_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.undeploy_model.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-automl/samples/generated/v1beta1/auto_ml.undeploy_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.undeploy_model.js` + + +----- + + + + +### Auto_ml.update_column_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_column_spec.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-automl/samples/generated/v1beta1/auto_ml.update_column_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_column_spec.js` + + +----- + + + + +### Auto_ml.update_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_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-automl/samples/generated/v1beta1/auto_ml.update_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_dataset.js` + + +----- + + + + +### Auto_ml.update_table_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_table_spec.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-automl/samples/generated/v1beta1/auto_ml.update_table_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_table_spec.js` + + +----- + + + + +### Prediction_service.batch_predict + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.batch_predict.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-automl/samples/generated/v1beta1/prediction_service.batch_predict.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.batch_predict.js` + + +----- + + + + +### Prediction_service.predict + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.predict.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-automl/samples/generated/v1beta1/prediction_service.predict.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.predict.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/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-automl/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/automl/docs/ diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_dataset.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_dataset.js new file mode 100644 index 00000000000..c5d6d661208 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_dataset.js @@ -0,0 +1,67 @@ +// Copyright 2023 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 automl_v1_generated_AutoMl_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. The resource name of the project to create the dataset for. + */ + // const parent = 'abc123' + /** + * Required. The dataset to create. + */ + // const dataset = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callCreateDataset() { + // Construct request + const request = { + parent, + dataset, + }; + + // Run request + const [operation] = await automlClient.createDataset(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateDataset(); + // [END automl_v1_generated_AutoMl_CreateDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_model.js new file mode 100644 index 00000000000..05724437e2f --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_model.js @@ -0,0 +1,67 @@ +// Copyright 2023 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, model) { + // [START automl_v1_generated_AutoMl_CreateModel_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. Resource name of the parent project where the model is being created. + */ + // const parent = 'abc123' + /** + * Required. The model to create. + */ + // const model = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callCreateModel() { + // Construct request + const request = { + parent, + model, + }; + + // Run request + const [operation] = await automlClient.createModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateModel(); + // [END automl_v1_generated_AutoMl_CreateModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_dataset.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_dataset.js new file mode 100644 index 00000000000..f3789e6d4cd --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_dataset.js @@ -0,0 +1,62 @@ +// Copyright 2023 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 automl_v1_generated_AutoMl_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. The resource name of the dataset to delete. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callDeleteDataset() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.deleteDataset(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteDataset(); + // [END automl_v1_generated_AutoMl_DeleteDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_model.js new file mode 100644 index 00000000000..13112c16b63 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_model.js @@ -0,0 +1,62 @@ +// Copyright 2023 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 automl_v1_generated_AutoMl_DeleteModel_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. Resource name of the model being deleted. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callDeleteModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.deleteModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteModel(); + // [END automl_v1_generated_AutoMl_DeleteModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.deploy_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.deploy_model.js new file mode 100644 index 00000000000..2472497e808 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.deploy_model.js @@ -0,0 +1,70 @@ +// Copyright 2023 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 automl_v1_generated_AutoMl_DeployModel_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. + */ + /** + * Model deployment metadata specific to Image Object Detection. + */ + // const imageObjectDetectionModelDeploymentMetadata = {} + /** + * Model deployment metadata specific to Image Classification. + */ + // const imageClassificationModelDeploymentMetadata = {} + /** + * Required. Resource name of the model to deploy. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callDeployModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.deployModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeployModel(); + // [END automl_v1_generated_AutoMl_DeployModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_data.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_data.js new file mode 100644 index 00000000000..3933812fdc2 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_data.js @@ -0,0 +1,67 @@ +// Copyright 2023 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, outputConfig) { + // [START automl_v1_generated_AutoMl_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. The resource name of the dataset. + */ + // const name = 'abc123' + /** + * Required. The desired output location. + */ + // const outputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callExportData() { + // Construct request + const request = { + name, + outputConfig, + }; + + // Run request + const [operation] = await automlClient.exportData(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportData(); + // [END automl_v1_generated_AutoMl_ExportData_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_model.js new file mode 100644 index 00000000000..36bd57421d2 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_model.js @@ -0,0 +1,67 @@ +// Copyright 2023 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, outputConfig) { + // [START automl_v1_generated_AutoMl_ExportModel_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 resource name of the model to export. + */ + // const name = 'abc123' + /** + * Required. The desired output location and configuration. + */ + // const outputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callExportModel() { + // Construct request + const request = { + name, + outputConfig, + }; + + // Run request + const [operation] = await automlClient.exportModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportModel(); + // [END automl_v1_generated_AutoMl_ExportModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_annotation_spec.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_annotation_spec.js new file mode 100644 index 00000000000..23c0726abd1 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_annotation_spec.js @@ -0,0 +1,61 @@ +// Copyright 2023 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 automl_v1_generated_AutoMl_GetAnnotationSpec_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 resource name of the annotation spec to retrieve. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetAnnotationSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getAnnotationSpec(request); + console.log(response); + } + + callGetAnnotationSpec(); + // [END automl_v1_generated_AutoMl_GetAnnotationSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_dataset.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_dataset.js new file mode 100644 index 00000000000..524007fe949 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_dataset.js @@ -0,0 +1,61 @@ +// Copyright 2023 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 automl_v1_generated_AutoMl_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. The resource name of the dataset to retrieve. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetDataset() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getDataset(request); + console.log(response); + } + + callGetDataset(); + // [END automl_v1_generated_AutoMl_GetDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model.js new file mode 100644 index 00000000000..7195722493f --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model.js @@ -0,0 +1,61 @@ +// Copyright 2023 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 automl_v1_generated_AutoMl_GetModel_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. Resource name of the model. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetModel() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getModel(request); + console.log(response); + } + + callGetModel(); + // [END automl_v1_generated_AutoMl_GetModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model_evaluation.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model_evaluation.js new file mode 100644 index 00000000000..e0605c44151 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model_evaluation.js @@ -0,0 +1,61 @@ +// Copyright 2023 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 automl_v1_generated_AutoMl_GetModelEvaluation_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. Resource name for the model evaluation. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetModelEvaluation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getModelEvaluation(request); + console.log(response); + } + + callGetModelEvaluation(); + // [END automl_v1_generated_AutoMl_GetModelEvaluation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.import_data.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.import_data.js new file mode 100644 index 00000000000..f4d2963ef71 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.import_data.js @@ -0,0 +1,69 @@ +// Copyright 2023 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 automl_v1_generated_AutoMl_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 name. Dataset must already exist. All imported + * annotations and examples will be added. + */ + // const name = 'abc123' + /** + * Required. The desired input location and its domain specific semantics, + * if any. + */ + // const inputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callImportData() { + // Construct request + const request = { + name, + inputConfig, + }; + + // Run request + const [operation] = await automlClient.importData(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportData(); + // [END automl_v1_generated_AutoMl_ImportData_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_datasets.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_datasets.js new file mode 100644 index 00000000000..831fd54c9b9 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_datasets.js @@ -0,0 +1,83 @@ +// Copyright 2023 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 automl_v1_generated_AutoMl_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. The resource name of the project from which to list datasets. + */ + // const parent = 'abc123' + /** + * An expression for filtering the results of the request. + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of using the filter are: + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + */ + // const filter = 'abc123' + /** + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * ListDatasetsResponse.next_page_token google.cloud.automl.v1.ListDatasetsResponse.next_page_token of the previous + * AutoMl.ListDatasets google.cloud.automl.v1.AutoMl.ListDatasets call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListDatasets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listDatasetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDatasets(); + // [END automl_v1_generated_AutoMl_ListDatasets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_model_evaluations.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_model_evaluations.js new file mode 100644 index 00000000000..3431ee018bb --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_model_evaluations.js @@ -0,0 +1,88 @@ +// Copyright 2023 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, filter) { + // [START automl_v1_generated_AutoMl_ListModelEvaluations_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. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + */ + // const parent = 'abc123' + /** + * Required. An expression for filtering the results of the request. + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * Some examples of using the filter are: + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + */ + // const filter = 'abc123' + /** + * Requested page size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return. + * Typically obtained via + * ListModelEvaluationsResponse.next_page_token google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token of the previous + * AutoMl.ListModelEvaluations google.cloud.automl.v1.AutoMl.ListModelEvaluations call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListModelEvaluations() { + // Construct request + const request = { + parent, + filter, + }; + + // Run request + const iterable = await automlClient.listModelEvaluationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListModelEvaluations(); + // [END automl_v1_generated_AutoMl_ListModelEvaluations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_models.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_models.js new file mode 100644 index 00000000000..849df485f1b --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_models.js @@ -0,0 +1,84 @@ +// Copyright 2023 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 automl_v1_generated_AutoMl_ListModels_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. Resource name of the project, from which to list the models. + */ + // const parent = 'abc123' + /** + * An expression for filtering the results of the request. + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + */ + // const filter = 'abc123' + /** + * Requested page size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * ListModelsResponse.next_page_token google.cloud.automl.v1.ListModelsResponse.next_page_token of the previous + * AutoMl.ListModels google.cloud.automl.v1.AutoMl.ListModels call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListModels() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listModelsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListModels(); + // [END automl_v1_generated_AutoMl_ListModels_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.undeploy_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.undeploy_model.js new file mode 100644 index 00000000000..d8c6776f6e9 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.undeploy_model.js @@ -0,0 +1,62 @@ +// Copyright 2023 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 automl_v1_generated_AutoMl_UndeployModel_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. Resource name of the model to undeploy. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUndeployModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.undeployModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeployModel(); + // [END automl_v1_generated_AutoMl_UndeployModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_dataset.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_dataset.js new file mode 100644 index 00000000000..67cab9e687b --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_dataset.js @@ -0,0 +1,66 @@ +// Copyright 2023 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(dataset, updateMask) { + // [START automl_v1_generated_AutoMl_UpdateDataset_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 dataset which replaces the resource on the server. + */ + // const dataset = {} + /** + * Required. The update mask applies to the resource. + */ + // const updateMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUpdateDataset() { + // Construct request + const request = { + dataset, + updateMask, + }; + + // Run request + const response = await automlClient.updateDataset(request); + console.log(response); + } + + callUpdateDataset(); + // [END automl_v1_generated_AutoMl_UpdateDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_model.js new file mode 100644 index 00000000000..4116a8ceff9 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_model.js @@ -0,0 +1,66 @@ +// Copyright 2023 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(model, updateMask) { + // [START automl_v1_generated_AutoMl_UpdateModel_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 model which replaces the resource on the server. + */ + // const model = {} + /** + * Required. The update mask applies to the resource. + */ + // const updateMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUpdateModel() { + // Construct request + const request = { + model, + updateMask, + }; + + // Run request + const response = await automlClient.updateModel(request); + console.log(response); + } + + callUpdateModel(); + // [END automl_v1_generated_AutoMl_UpdateModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/prediction_service.batch_predict.js b/packages/google-cloud-automl/samples/generated/v1/prediction_service.batch_predict.js new file mode 100644 index 00000000000..b6b23e81cb0 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/prediction_service.batch_predict.js @@ -0,0 +1,141 @@ +// Copyright 2023 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, outputConfig) { + // [START automl_v1_generated_PredictionService_BatchPredict_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 model requested to serve the batch prediction. + */ + // const name = 'abc123' + /** + * Required. The input configuration for batch prediction. + */ + // const inputConfig = {} + /** + * Required. The Configuration specifying where output predictions should + * be written. + */ + // const outputConfig = {} + /** + * Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * AutoML Natural Language Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * AutoML Video Intelligence Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a video, it will only produce results that + * have at least this confidence score. The default is 0.5. + * `segment_classification` + * : (boolean) Set to true to request + * segment-level classification. AutoML Video Intelligence returns + * labels and their confidence scores for the entire segment of the + * video that user specified in the request configuration. + * The default is true. + * `shot_classification` + * : (boolean) Set to true to request shot-level + * classification. AutoML Video Intelligence determines the boundaries + * for each camera shot in the entire segment of the video that user + * specified in the request configuration. AutoML Video Intelligence + * then returns labels and their confidence scores for each detected + * shot, along with the start and end time of the shot. + * The default is false. + * WARNING: Model evaluation is not done for this classification type, + * the quality of it depends on training data, but there are no metrics + * provided to describe that quality. + * `1s_interval_classification` + * : (boolean) Set to true to request + * classification for a video at one-second intervals. AutoML Video + * Intelligence returns labels and their confidence scores for each + * second of the entire segment of the video that user specified in the + * request configuration. The default is false. + * WARNING: Model evaluation is not done for this classification + * type, the quality of it depends on training data, but there are no + * metrics provided to describe that quality. + * AutoML Video Intelligence Object Tracking + * `score_threshold` + * : (float) When Model detects objects on video frames, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * `min_bounding_box_size` + * : (float) Only bounding boxes with shortest edge + * at least that long as a relative value of video frame size are + * returned. Value in 0 to 1 range. Default is 0. + */ + // const params = [1,2,3,4] + + // Imports the Automl library + const {PredictionServiceClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new PredictionServiceClient(); + + async function callBatchPredict() { + // Construct request + const request = { + name, + inputConfig, + outputConfig, + }; + + // Run request + const [operation] = await automlClient.batchPredict(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchPredict(); + // [END automl_v1_generated_PredictionService_BatchPredict_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/prediction_service.predict.js b/packages/google-cloud-automl/samples/generated/v1/prediction_service.predict.js new file mode 100644 index 00000000000..1f5918695cb --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/prediction_service.predict.js @@ -0,0 +1,93 @@ +// Copyright 2023 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, payload) { + // [START automl_v1_generated_PredictionService_Predict_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 model requested to serve the prediction. + */ + // const name = 'abc123' + /** + * Required. Payload to perform a prediction on. The payload must match the + * problem type that the model was trained to solve. + */ + // const payload = {} + /** + * Additional domain-specific parameters, any string must be up to 25000 + * characters long. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned. The default is 100. The + * number of returned bounding boxes might be limited by the server. + * AutoML Tables + * `feature_importance` + * : (boolean) Whether + * feature_importance google.cloud.automl.v1.TablesModelColumnInfo.feature_importance + * is populated in the returned list of + * TablesAnnotation google.cloud.automl.v1.TablesAnnotation + * objects. The default is false. + */ + // const params = [1,2,3,4] + + // Imports the Automl library + const {PredictionServiceClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new PredictionServiceClient(); + + async function callPredict() { + // Construct request + const request = { + name, + payload, + }; + + // Run request + const response = await automlClient.predict(request); + console.log(response); + } + + callPredict(); + // [END automl_v1_generated_PredictionService_Predict_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/snippet_metadata.google.cloud.automl.v1.json b/packages/google-cloud-automl/samples/generated/v1/snippet_metadata.google.cloud.automl.v1.json new file mode 100644 index 00000000000..f9ada8483d5 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/snippet_metadata.google.cloud.automl.v1.json @@ -0,0 +1,907 @@ +{ + "clientLibrary": { + "name": "nodejs-automl", + "version": "4.0.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.automl.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "automl_v1_generated_AutoMl_CreateDataset_async", + "title": "automl createDataset Sample", + "origin": "API_DEFINITION", + "description": " Creates a dataset.", + "canonical": true, + "file": "auto_ml.create_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDataset", + "fullName": "google.cloud.automl.v1.AutoMl.CreateDataset", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "dataset", + "type": ".google.cloud.automl.v1.Dataset" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "CreateDataset", + "fullName": "google.cloud.automl.v1.AutoMl.CreateDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_GetDataset_async", + "title": "automl getDataset Sample", + "origin": "API_DEFINITION", + "description": " Gets a dataset.", + "canonical": true, + "file": "auto_ml.get_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataset", + "fullName": "google.cloud.automl.v1.AutoMl.GetDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.Dataset", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "GetDataset", + "fullName": "google.cloud.automl.v1.AutoMl.GetDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ListDatasets_async", + "title": "automl listDatasets Sample", + "origin": "API_DEFINITION", + "description": " Lists datasets in a project.", + "canonical": true, + "file": "auto_ml.list_datasets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDatasets", + "fullName": "google.cloud.automl.v1.AutoMl.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.automl.v1.ListDatasetsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ListDatasets", + "fullName": "google.cloud.automl.v1.AutoMl.ListDatasets", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_UpdateDataset_async", + "title": "automl updateDataset Sample", + "origin": "API_DEFINITION", + "description": " Updates a dataset.", + "canonical": true, + "file": "auto_ml.update_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDataset", + "fullName": "google.cloud.automl.v1.AutoMl.UpdateDataset", + "async": true, + "parameters": [ + { + "name": "dataset", + "type": ".google.cloud.automl.v1.Dataset" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1.Dataset", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "UpdateDataset", + "fullName": "google.cloud.automl.v1.AutoMl.UpdateDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_DeleteDataset_async", + "title": "automl deleteDataset Sample", + "origin": "API_DEFINITION", + "description": " Deletes a dataset and all of its contents. Returns empty response in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.", + "canonical": true, + "file": "auto_ml.delete_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDataset", + "fullName": "google.cloud.automl.v1.AutoMl.DeleteDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "DeleteDataset", + "fullName": "google.cloud.automl.v1.AutoMl.DeleteDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ImportData_async", + "title": "automl importData Sample", + "origin": "API_DEFINITION", + "description": " Imports data into a dataset. For Tables this method can only be called on an empty Dataset. For Tables: * A [schema_inference_version][google.cloud.automl.v1.InputConfig.params] parameter must be explicitly set. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.import_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportData", + "fullName": "google.cloud.automl.v1.AutoMl.ImportData", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "input_config", + "type": ".google.cloud.automl.v1.InputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ImportData", + "fullName": "google.cloud.automl.v1.AutoMl.ImportData", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ExportData_async", + "title": "automl exportData Sample", + "origin": "API_DEFINITION", + "description": " Exports dataset's data to the provided output location. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.export_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportData", + "fullName": "google.cloud.automl.v1.AutoMl.ExportData", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1.OutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ExportData", + "fullName": "google.cloud.automl.v1.AutoMl.ExportData", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_GetAnnotationSpec_async", + "title": "automl getAnnotationSpec Sample", + "origin": "API_DEFINITION", + "description": " Gets an annotation spec.", + "canonical": true, + "file": "auto_ml.get_annotation_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAnnotationSpec", + "fullName": "google.cloud.automl.v1.AutoMl.GetAnnotationSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.AnnotationSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "GetAnnotationSpec", + "fullName": "google.cloud.automl.v1.AutoMl.GetAnnotationSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_CreateModel_async", + "title": "automl createModel Sample", + "origin": "API_DEFINITION", + "description": " Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.", + "canonical": true, + "file": "auto_ml.create_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateModel", + "fullName": "google.cloud.automl.v1.AutoMl.CreateModel", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": ".google.cloud.automl.v1.Model" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "CreateModel", + "fullName": "google.cloud.automl.v1.AutoMl.CreateModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_GetModel_async", + "title": "automl getModel Sample", + "origin": "API_DEFINITION", + "description": " Gets a model.", + "canonical": true, + "file": "auto_ml.get_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetModel", + "fullName": "google.cloud.automl.v1.AutoMl.GetModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.Model", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "GetModel", + "fullName": "google.cloud.automl.v1.AutoMl.GetModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ListModels_async", + "title": "automl listModels Sample", + "origin": "API_DEFINITION", + "description": " Lists models.", + "canonical": true, + "file": "auto_ml.list_models.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListModels", + "fullName": "google.cloud.automl.v1.AutoMl.ListModels", + "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.automl.v1.ListModelsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ListModels", + "fullName": "google.cloud.automl.v1.AutoMl.ListModels", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_DeleteModel_async", + "title": "automl deleteModel Sample", + "origin": "API_DEFINITION", + "description": " Deletes a model. Returns `google.protobuf.Empty` in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.", + "canonical": true, + "file": "auto_ml.delete_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteModel", + "fullName": "google.cloud.automl.v1.AutoMl.DeleteModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "DeleteModel", + "fullName": "google.cloud.automl.v1.AutoMl.DeleteModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_UpdateModel_async", + "title": "automl updateModel Sample", + "origin": "API_DEFINITION", + "description": " Updates a model.", + "canonical": true, + "file": "auto_ml.update_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateModel", + "fullName": "google.cloud.automl.v1.AutoMl.UpdateModel", + "async": true, + "parameters": [ + { + "name": "model", + "type": ".google.cloud.automl.v1.Model" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1.Model", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "UpdateModel", + "fullName": "google.cloud.automl.v1.AutoMl.UpdateModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_DeployModel_async", + "title": "automl deployModel Sample", + "origin": "API_DEFINITION", + "description": " Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability. Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.deploy_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeployModel", + "fullName": "google.cloud.automl.v1.AutoMl.DeployModel", + "async": true, + "parameters": [ + { + "name": "image_object_detection_model_deployment_metadata", + "type": ".google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata" + }, + { + "name": "image_classification_model_deployment_metadata", + "type": ".google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "DeployModel", + "fullName": "google.cloud.automl.v1.AutoMl.DeployModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_UndeployModel_async", + "title": "automl undeployModel Sample", + "origin": "API_DEFINITION", + "description": " Undeploys a model. If the model is not deployed this method has no effect. Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.undeploy_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeployModel", + "fullName": "google.cloud.automl.v1.AutoMl.UndeployModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "UndeployModel", + "fullName": "google.cloud.automl.v1.AutoMl.UndeployModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ExportModel_async", + "title": "automl exportModel Sample", + "origin": "API_DEFINITION", + "description": " Exports a trained, \"export-able\", model to a user specified Google Cloud Storage location. A model is considered export-able if and only if it has an export format defined for it in [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.export_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportModel", + "fullName": "google.cloud.automl.v1.AutoMl.ExportModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1.ModelExportOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ExportModel", + "fullName": "google.cloud.automl.v1.AutoMl.ExportModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_GetModelEvaluation_async", + "title": "automl getModelEvaluation Sample", + "origin": "API_DEFINITION", + "description": " Gets a model evaluation.", + "canonical": true, + "file": "auto_ml.get_model_evaluation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetModelEvaluation", + "fullName": "google.cloud.automl.v1.AutoMl.GetModelEvaluation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.ModelEvaluation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "GetModelEvaluation", + "fullName": "google.cloud.automl.v1.AutoMl.GetModelEvaluation", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ListModelEvaluations_async", + "title": "automl listModelEvaluations Sample", + "origin": "API_DEFINITION", + "description": " Lists model evaluations.", + "canonical": true, + "file": "auto_ml.list_model_evaluations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListModelEvaluations", + "fullName": "google.cloud.automl.v1.AutoMl.ListModelEvaluations", + "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.automl.v1.ListModelEvaluationsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ListModelEvaluations", + "fullName": "google.cloud.automl.v1.AutoMl.ListModelEvaluations", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_PredictionService_Predict_async", + "title": "automl predict Sample", + "origin": "API_DEFINITION", + "description": " Perform an online prediction. The prediction result is directly returned in the response. Available for following ML scenarios, and their expected request payloads: AutoML Vision Classification * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. AutoML Vision Object Detection * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. AutoML Natural Language Classification * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in .PDF, .TIF or .TIFF format with size upto 2MB. AutoML Natural Language Entity Extraction * A TextSnippet up to 10,000 characters, UTF-8 NFC encoded or a document in .PDF, .TIF or .TIFF format with size upto 20MB. AutoML Natural Language Sentiment Analysis * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in .PDF, .TIF or .TIFF format with size upto 2MB. AutoML Translation * A TextSnippet up to 25,000 characters, UTF-8 encoded. AutoML Tables * A row with column values matching the columns of the model, up to 5MB. Not available for FORECASTING `prediction_type`.", + "canonical": true, + "file": "prediction_service.predict.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Predict", + "fullName": "google.cloud.automl.v1.PredictionService.Predict", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "payload", + "type": ".google.cloud.automl.v1.ExamplePayload" + }, + { + "name": "params", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.automl.v1.PredictResponse", + "client": { + "shortName": "PredictionServiceClient", + "fullName": "google.cloud.automl.v1.PredictionServiceClient" + }, + "method": { + "shortName": "Predict", + "fullName": "google.cloud.automl.v1.PredictionService.Predict", + "service": { + "shortName": "PredictionService", + "fullName": "google.cloud.automl.v1.PredictionService" + } + } + } + }, + { + "regionTag": "automl_v1_generated_PredictionService_BatchPredict_async", + "title": "automl batchPredict Sample", + "origin": "API_DEFINITION", + "description": " Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1.PredictionService.Predict], batch prediction result won't be immediately available in the response. Instead, a long running operation object is returned. User can poll the operation result via [GetOperation][google.longrunning.Operations.GetOperation] method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in the [response][google.longrunning.Operation.response] field. Available for following ML scenarios: * AutoML Vision Classification * AutoML Vision Object Detection * AutoML Video Intelligence Classification * AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification * AutoML Natural Language Entity Extraction * AutoML Natural Language Sentiment Analysis * AutoML Tables", + "canonical": true, + "file": "prediction_service.batch_predict.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 133, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchPredict", + "fullName": "google.cloud.automl.v1.PredictionService.BatchPredict", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "input_config", + "type": ".google.cloud.automl.v1.BatchPredictInputConfig" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1.BatchPredictOutputConfig" + }, + { + "name": "params", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "PredictionServiceClient", + "fullName": "google.cloud.automl.v1.PredictionServiceClient" + }, + "method": { + "shortName": "BatchPredict", + "fullName": "google.cloud.automl.v1.PredictionService.BatchPredict", + "service": { + "shortName": "PredictionService", + "fullName": "google.cloud.automl.v1.PredictionService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-automl/samples/generated/v1/snippet_metadata_google.cloud.automl.v1.json b/packages/google-cloud-automl/samples/generated/v1/snippet_metadata_google.cloud.automl.v1.json new file mode 100644 index 00000000000..f9ada8483d5 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/snippet_metadata_google.cloud.automl.v1.json @@ -0,0 +1,907 @@ +{ + "clientLibrary": { + "name": "nodejs-automl", + "version": "4.0.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.automl.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "automl_v1_generated_AutoMl_CreateDataset_async", + "title": "automl createDataset Sample", + "origin": "API_DEFINITION", + "description": " Creates a dataset.", + "canonical": true, + "file": "auto_ml.create_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDataset", + "fullName": "google.cloud.automl.v1.AutoMl.CreateDataset", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "dataset", + "type": ".google.cloud.automl.v1.Dataset" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "CreateDataset", + "fullName": "google.cloud.automl.v1.AutoMl.CreateDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_GetDataset_async", + "title": "automl getDataset Sample", + "origin": "API_DEFINITION", + "description": " Gets a dataset.", + "canonical": true, + "file": "auto_ml.get_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataset", + "fullName": "google.cloud.automl.v1.AutoMl.GetDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.Dataset", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "GetDataset", + "fullName": "google.cloud.automl.v1.AutoMl.GetDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ListDatasets_async", + "title": "automl listDatasets Sample", + "origin": "API_DEFINITION", + "description": " Lists datasets in a project.", + "canonical": true, + "file": "auto_ml.list_datasets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDatasets", + "fullName": "google.cloud.automl.v1.AutoMl.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.automl.v1.ListDatasetsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ListDatasets", + "fullName": "google.cloud.automl.v1.AutoMl.ListDatasets", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_UpdateDataset_async", + "title": "automl updateDataset Sample", + "origin": "API_DEFINITION", + "description": " Updates a dataset.", + "canonical": true, + "file": "auto_ml.update_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDataset", + "fullName": "google.cloud.automl.v1.AutoMl.UpdateDataset", + "async": true, + "parameters": [ + { + "name": "dataset", + "type": ".google.cloud.automl.v1.Dataset" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1.Dataset", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "UpdateDataset", + "fullName": "google.cloud.automl.v1.AutoMl.UpdateDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_DeleteDataset_async", + "title": "automl deleteDataset Sample", + "origin": "API_DEFINITION", + "description": " Deletes a dataset and all of its contents. Returns empty response in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.", + "canonical": true, + "file": "auto_ml.delete_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDataset", + "fullName": "google.cloud.automl.v1.AutoMl.DeleteDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "DeleteDataset", + "fullName": "google.cloud.automl.v1.AutoMl.DeleteDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ImportData_async", + "title": "automl importData Sample", + "origin": "API_DEFINITION", + "description": " Imports data into a dataset. For Tables this method can only be called on an empty Dataset. For Tables: * A [schema_inference_version][google.cloud.automl.v1.InputConfig.params] parameter must be explicitly set. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.import_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportData", + "fullName": "google.cloud.automl.v1.AutoMl.ImportData", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "input_config", + "type": ".google.cloud.automl.v1.InputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ImportData", + "fullName": "google.cloud.automl.v1.AutoMl.ImportData", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ExportData_async", + "title": "automl exportData Sample", + "origin": "API_DEFINITION", + "description": " Exports dataset's data to the provided output location. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.export_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportData", + "fullName": "google.cloud.automl.v1.AutoMl.ExportData", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1.OutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ExportData", + "fullName": "google.cloud.automl.v1.AutoMl.ExportData", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_GetAnnotationSpec_async", + "title": "automl getAnnotationSpec Sample", + "origin": "API_DEFINITION", + "description": " Gets an annotation spec.", + "canonical": true, + "file": "auto_ml.get_annotation_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAnnotationSpec", + "fullName": "google.cloud.automl.v1.AutoMl.GetAnnotationSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.AnnotationSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "GetAnnotationSpec", + "fullName": "google.cloud.automl.v1.AutoMl.GetAnnotationSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_CreateModel_async", + "title": "automl createModel Sample", + "origin": "API_DEFINITION", + "description": " Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.", + "canonical": true, + "file": "auto_ml.create_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateModel", + "fullName": "google.cloud.automl.v1.AutoMl.CreateModel", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": ".google.cloud.automl.v1.Model" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "CreateModel", + "fullName": "google.cloud.automl.v1.AutoMl.CreateModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_GetModel_async", + "title": "automl getModel Sample", + "origin": "API_DEFINITION", + "description": " Gets a model.", + "canonical": true, + "file": "auto_ml.get_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetModel", + "fullName": "google.cloud.automl.v1.AutoMl.GetModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.Model", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "GetModel", + "fullName": "google.cloud.automl.v1.AutoMl.GetModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ListModels_async", + "title": "automl listModels Sample", + "origin": "API_DEFINITION", + "description": " Lists models.", + "canonical": true, + "file": "auto_ml.list_models.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListModels", + "fullName": "google.cloud.automl.v1.AutoMl.ListModels", + "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.automl.v1.ListModelsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ListModels", + "fullName": "google.cloud.automl.v1.AutoMl.ListModels", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_DeleteModel_async", + "title": "automl deleteModel Sample", + "origin": "API_DEFINITION", + "description": " Deletes a model. Returns `google.protobuf.Empty` in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.", + "canonical": true, + "file": "auto_ml.delete_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteModel", + "fullName": "google.cloud.automl.v1.AutoMl.DeleteModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "DeleteModel", + "fullName": "google.cloud.automl.v1.AutoMl.DeleteModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_UpdateModel_async", + "title": "automl updateModel Sample", + "origin": "API_DEFINITION", + "description": " Updates a model.", + "canonical": true, + "file": "auto_ml.update_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateModel", + "fullName": "google.cloud.automl.v1.AutoMl.UpdateModel", + "async": true, + "parameters": [ + { + "name": "model", + "type": ".google.cloud.automl.v1.Model" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1.Model", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "UpdateModel", + "fullName": "google.cloud.automl.v1.AutoMl.UpdateModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_DeployModel_async", + "title": "automl deployModel Sample", + "origin": "API_DEFINITION", + "description": " Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability. Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.deploy_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeployModel", + "fullName": "google.cloud.automl.v1.AutoMl.DeployModel", + "async": true, + "parameters": [ + { + "name": "image_object_detection_model_deployment_metadata", + "type": ".google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata" + }, + { + "name": "image_classification_model_deployment_metadata", + "type": ".google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "DeployModel", + "fullName": "google.cloud.automl.v1.AutoMl.DeployModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_UndeployModel_async", + "title": "automl undeployModel Sample", + "origin": "API_DEFINITION", + "description": " Undeploys a model. If the model is not deployed this method has no effect. Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.undeploy_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeployModel", + "fullName": "google.cloud.automl.v1.AutoMl.UndeployModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "UndeployModel", + "fullName": "google.cloud.automl.v1.AutoMl.UndeployModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ExportModel_async", + "title": "automl exportModel Sample", + "origin": "API_DEFINITION", + "description": " Exports a trained, \"export-able\", model to a user specified Google Cloud Storage location. A model is considered export-able if and only if it has an export format defined for it in [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.export_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportModel", + "fullName": "google.cloud.automl.v1.AutoMl.ExportModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1.ModelExportOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ExportModel", + "fullName": "google.cloud.automl.v1.AutoMl.ExportModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_GetModelEvaluation_async", + "title": "automl getModelEvaluation Sample", + "origin": "API_DEFINITION", + "description": " Gets a model evaluation.", + "canonical": true, + "file": "auto_ml.get_model_evaluation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetModelEvaluation", + "fullName": "google.cloud.automl.v1.AutoMl.GetModelEvaluation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.ModelEvaluation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "GetModelEvaluation", + "fullName": "google.cloud.automl.v1.AutoMl.GetModelEvaluation", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ListModelEvaluations_async", + "title": "automl listModelEvaluations Sample", + "origin": "API_DEFINITION", + "description": " Lists model evaluations.", + "canonical": true, + "file": "auto_ml.list_model_evaluations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListModelEvaluations", + "fullName": "google.cloud.automl.v1.AutoMl.ListModelEvaluations", + "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.automl.v1.ListModelEvaluationsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ListModelEvaluations", + "fullName": "google.cloud.automl.v1.AutoMl.ListModelEvaluations", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_PredictionService_Predict_async", + "title": "automl predict Sample", + "origin": "API_DEFINITION", + "description": " Perform an online prediction. The prediction result is directly returned in the response. Available for following ML scenarios, and their expected request payloads: AutoML Vision Classification * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. AutoML Vision Object Detection * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. AutoML Natural Language Classification * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in .PDF, .TIF or .TIFF format with size upto 2MB. AutoML Natural Language Entity Extraction * A TextSnippet up to 10,000 characters, UTF-8 NFC encoded or a document in .PDF, .TIF or .TIFF format with size upto 20MB. AutoML Natural Language Sentiment Analysis * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in .PDF, .TIF or .TIFF format with size upto 2MB. AutoML Translation * A TextSnippet up to 25,000 characters, UTF-8 encoded. AutoML Tables * A row with column values matching the columns of the model, up to 5MB. Not available for FORECASTING `prediction_type`.", + "canonical": true, + "file": "prediction_service.predict.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Predict", + "fullName": "google.cloud.automl.v1.PredictionService.Predict", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "payload", + "type": ".google.cloud.automl.v1.ExamplePayload" + }, + { + "name": "params", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.automl.v1.PredictResponse", + "client": { + "shortName": "PredictionServiceClient", + "fullName": "google.cloud.automl.v1.PredictionServiceClient" + }, + "method": { + "shortName": "Predict", + "fullName": "google.cloud.automl.v1.PredictionService.Predict", + "service": { + "shortName": "PredictionService", + "fullName": "google.cloud.automl.v1.PredictionService" + } + } + } + }, + { + "regionTag": "automl_v1_generated_PredictionService_BatchPredict_async", + "title": "automl batchPredict Sample", + "origin": "API_DEFINITION", + "description": " Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1.PredictionService.Predict], batch prediction result won't be immediately available in the response. Instead, a long running operation object is returned. User can poll the operation result via [GetOperation][google.longrunning.Operations.GetOperation] method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in the [response][google.longrunning.Operation.response] field. Available for following ML scenarios: * AutoML Vision Classification * AutoML Vision Object Detection * AutoML Video Intelligence Classification * AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification * AutoML Natural Language Entity Extraction * AutoML Natural Language Sentiment Analysis * AutoML Tables", + "canonical": true, + "file": "prediction_service.batch_predict.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 133, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchPredict", + "fullName": "google.cloud.automl.v1.PredictionService.BatchPredict", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "input_config", + "type": ".google.cloud.automl.v1.BatchPredictInputConfig" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1.BatchPredictOutputConfig" + }, + { + "name": "params", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "PredictionServiceClient", + "fullName": "google.cloud.automl.v1.PredictionServiceClient" + }, + "method": { + "shortName": "BatchPredict", + "fullName": "google.cloud.automl.v1.PredictionService.BatchPredict", + "service": { + "shortName": "PredictionService", + "fullName": "google.cloud.automl.v1.PredictionService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_dataset.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_dataset.js new file mode 100644 index 00000000000..94d9e03dcaa --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_dataset.js @@ -0,0 +1,66 @@ +// Copyright 2023 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 automl_v1beta1_generated_AutoMl_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. The resource name of the project to create the dataset for. + */ + // const parent = 'abc123' + /** + * Required. The dataset to create. + */ + // const dataset = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callCreateDataset() { + // Construct request + const request = { + parent, + dataset, + }; + + // Run request + const response = await automlClient.createDataset(request); + console.log(response); + } + + callCreateDataset(); + // [END automl_v1beta1_generated_AutoMl_CreateDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_model.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_model.js new file mode 100644 index 00000000000..214fc85d2f9 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_model.js @@ -0,0 +1,67 @@ +// Copyright 2023 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, model) { + // [START automl_v1beta1_generated_AutoMl_CreateModel_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. Resource name of the parent project where the model is being created. + */ + // const parent = 'abc123' + /** + * Required. The model to create. + */ + // const model = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callCreateModel() { + // Construct request + const request = { + parent, + model, + }; + + // Run request + const [operation] = await automlClient.createModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateModel(); + // [END automl_v1beta1_generated_AutoMl_CreateModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_dataset.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_dataset.js new file mode 100644 index 00000000000..eeaa8bbb71c --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_dataset.js @@ -0,0 +1,62 @@ +// Copyright 2023 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 automl_v1beta1_generated_AutoMl_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. The resource name of the dataset to delete. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callDeleteDataset() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.deleteDataset(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteDataset(); + // [END automl_v1beta1_generated_AutoMl_DeleteDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_model.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_model.js new file mode 100644 index 00000000000..41beedb4443 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_model.js @@ -0,0 +1,62 @@ +// Copyright 2023 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 automl_v1beta1_generated_AutoMl_DeleteModel_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. Resource name of the model being deleted. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callDeleteModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.deleteModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteModel(); + // [END automl_v1beta1_generated_AutoMl_DeleteModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.deploy_model.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.deploy_model.js new file mode 100644 index 00000000000..f074578247e --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.deploy_model.js @@ -0,0 +1,70 @@ +// Copyright 2023 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 automl_v1beta1_generated_AutoMl_DeployModel_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. + */ + /** + * Model deployment metadata specific to Image Object Detection. + */ + // const imageObjectDetectionModelDeploymentMetadata = {} + /** + * Model deployment metadata specific to Image Classification. + */ + // const imageClassificationModelDeploymentMetadata = {} + /** + * Required. Resource name of the model to deploy. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callDeployModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.deployModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeployModel(); + // [END automl_v1beta1_generated_AutoMl_DeployModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_data.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_data.js new file mode 100644 index 00000000000..9216d524f48 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_data.js @@ -0,0 +1,67 @@ +// Copyright 2023 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, outputConfig) { + // [START automl_v1beta1_generated_AutoMl_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. The resource name of the dataset. + */ + // const name = 'abc123' + /** + * Required. The desired output location. + */ + // const outputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callExportData() { + // Construct request + const request = { + name, + outputConfig, + }; + + // Run request + const [operation] = await automlClient.exportData(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportData(); + // [END automl_v1beta1_generated_AutoMl_ExportData_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js new file mode 100644 index 00000000000..a58e2827e64 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js @@ -0,0 +1,68 @@ +// Copyright 2023 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, outputConfig) { + // [START automl_v1beta1_generated_AutoMl_ExportEvaluatedExamples_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 resource name of the model whose evaluated examples are to + * be exported. + */ + // const name = 'abc123' + /** + * Required. The desired output location and configuration. + */ + // const outputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callExportEvaluatedExamples() { + // Construct request + const request = { + name, + outputConfig, + }; + + // Run request + const [operation] = await automlClient.exportEvaluatedExamples(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportEvaluatedExamples(); + // [END automl_v1beta1_generated_AutoMl_ExportEvaluatedExamples_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_model.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_model.js new file mode 100644 index 00000000000..ccdc3f36c97 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_model.js @@ -0,0 +1,67 @@ +// Copyright 2023 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, outputConfig) { + // [START automl_v1beta1_generated_AutoMl_ExportModel_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 resource name of the model to export. + */ + // const name = 'abc123' + /** + * Required. The desired output location and configuration. + */ + // const outputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callExportModel() { + // Construct request + const request = { + name, + outputConfig, + }; + + // Run request + const [operation] = await automlClient.exportModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportModel(); + // [END automl_v1beta1_generated_AutoMl_ExportModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_annotation_spec.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_annotation_spec.js new file mode 100644 index 00000000000..ce6b959935d --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_annotation_spec.js @@ -0,0 +1,61 @@ +// Copyright 2023 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 automl_v1beta1_generated_AutoMl_GetAnnotationSpec_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 resource name of the annotation spec to retrieve. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetAnnotationSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getAnnotationSpec(request); + console.log(response); + } + + callGetAnnotationSpec(); + // [END automl_v1beta1_generated_AutoMl_GetAnnotationSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_column_spec.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_column_spec.js new file mode 100644 index 00000000000..c958e329441 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_column_spec.js @@ -0,0 +1,65 @@ +// Copyright 2023 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 automl_v1beta1_generated_AutoMl_GetColumnSpec_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 resource name of the column spec to retrieve. + */ + // const name = 'abc123' + /** + * Mask specifying which fields to read. + */ + // const fieldMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetColumnSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getColumnSpec(request); + console.log(response); + } + + callGetColumnSpec(); + // [END automl_v1beta1_generated_AutoMl_GetColumnSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_dataset.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_dataset.js new file mode 100644 index 00000000000..05cf1a6e5cc --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_dataset.js @@ -0,0 +1,61 @@ +// Copyright 2023 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 automl_v1beta1_generated_AutoMl_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. The resource name of the dataset to retrieve. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetDataset() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getDataset(request); + console.log(response); + } + + callGetDataset(); + // [END automl_v1beta1_generated_AutoMl_GetDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model.js new file mode 100644 index 00000000000..fabf33d25d5 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model.js @@ -0,0 +1,61 @@ +// Copyright 2023 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 automl_v1beta1_generated_AutoMl_GetModel_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. Resource name of the model. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetModel() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getModel(request); + console.log(response); + } + + callGetModel(); + // [END automl_v1beta1_generated_AutoMl_GetModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model_evaluation.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model_evaluation.js new file mode 100644 index 00000000000..10b9e7b8e87 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model_evaluation.js @@ -0,0 +1,61 @@ +// Copyright 2023 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 automl_v1beta1_generated_AutoMl_GetModelEvaluation_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. Resource name for the model evaluation. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetModelEvaluation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getModelEvaluation(request); + console.log(response); + } + + callGetModelEvaluation(); + // [END automl_v1beta1_generated_AutoMl_GetModelEvaluation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_table_spec.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_table_spec.js new file mode 100644 index 00000000000..dd665f67d40 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_table_spec.js @@ -0,0 +1,65 @@ +// Copyright 2023 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 automl_v1beta1_generated_AutoMl_GetTableSpec_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 resource name of the table spec to retrieve. + */ + // const name = 'abc123' + /** + * Mask specifying which fields to read. + */ + // const fieldMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetTableSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getTableSpec(request); + console.log(response); + } + + callGetTableSpec(); + // [END automl_v1beta1_generated_AutoMl_GetTableSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.import_data.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.import_data.js new file mode 100644 index 00000000000..58fea1a5bb0 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.import_data.js @@ -0,0 +1,69 @@ +// Copyright 2023 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 automl_v1beta1_generated_AutoMl_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 name. Dataset must already exist. All imported + * annotations and examples will be added. + */ + // const name = 'abc123' + /** + * Required. The desired input location and its domain specific semantics, + * if any. + */ + // const inputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callImportData() { + // Construct request + const request = { + name, + inputConfig, + }; + + // Run request + const [operation] = await automlClient.importData(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportData(); + // [END automl_v1beta1_generated_AutoMl_ImportData_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_column_specs.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_column_specs.js new file mode 100644 index 00000000000..eab1faabd7b --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_column_specs.js @@ -0,0 +1,83 @@ +// Copyright 2023 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 automl_v1beta1_generated_AutoMl_ListColumnSpecs_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 resource name of the table spec to list column specs from. + */ + // const parent = 'abc123' + /** + * Mask specifying which fields to read. + */ + // const fieldMask = {} + /** + * Filter expression, see go/filtering. + */ + // const filter = 'abc123' + /** + * Requested page size. The server can return fewer results than requested. + * If unspecified, the server will pick a default size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return. + * Typically obtained from the + * ListColumnSpecsResponse.next_page_token google.cloud.automl.v1beta1.ListColumnSpecsResponse.next_page_token field of the previous + * AutoMl.ListColumnSpecs google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListColumnSpecs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listColumnSpecsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListColumnSpecs(); + // [END automl_v1beta1_generated_AutoMl_ListColumnSpecs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_datasets.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_datasets.js new file mode 100644 index 00000000000..98315294040 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_datasets.js @@ -0,0 +1,84 @@ +// Copyright 2023 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 automl_v1beta1_generated_AutoMl_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. The resource name of the project from which to list datasets. + */ + // const parent = 'abc123' + /** + * An expression for filtering the results of the request. + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of + * using the filter are: + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + */ + // const filter = 'abc123' + /** + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * ListDatasetsResponse.next_page_token google.cloud.automl.v1beta1.ListDatasetsResponse.next_page_token of the previous + * AutoMl.ListDatasets google.cloud.automl.v1beta1.AutoMl.ListDatasets call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListDatasets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listDatasetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDatasets(); + // [END automl_v1beta1_generated_AutoMl_ListDatasets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_model_evaluations.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_model_evaluations.js new file mode 100644 index 00000000000..1c2add7392f --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_model_evaluations.js @@ -0,0 +1,87 @@ +// Copyright 2023 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 automl_v1beta1_generated_AutoMl_ListModelEvaluations_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. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + */ + // const parent = 'abc123' + /** + * An expression for filtering the results of the request. + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * Some examples of using the filter are: + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + */ + // const filter = 'abc123' + /** + * Requested page size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return. + * Typically obtained via + * ListModelEvaluationsResponse.next_page_token google.cloud.automl.v1beta1.ListModelEvaluationsResponse.next_page_token of the previous + * AutoMl.ListModelEvaluations google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListModelEvaluations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listModelEvaluationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListModelEvaluations(); + // [END automl_v1beta1_generated_AutoMl_ListModelEvaluations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_models.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_models.js new file mode 100644 index 00000000000..a157f91485b --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_models.js @@ -0,0 +1,84 @@ +// Copyright 2023 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 automl_v1beta1_generated_AutoMl_ListModels_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. Resource name of the project, from which to list the models. + */ + // const parent = 'abc123' + /** + * An expression for filtering the results of the request. + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + */ + // const filter = 'abc123' + /** + * Requested page size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * ListModelsResponse.next_page_token google.cloud.automl.v1beta1.ListModelsResponse.next_page_token of the previous + * AutoMl.ListModels google.cloud.automl.v1beta1.AutoMl.ListModels call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListModels() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listModelsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListModels(); + // [END automl_v1beta1_generated_AutoMl_ListModels_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_table_specs.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_table_specs.js new file mode 100644 index 00000000000..46f95c6d3a9 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_table_specs.js @@ -0,0 +1,83 @@ +// Copyright 2023 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 automl_v1beta1_generated_AutoMl_ListTableSpecs_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 resource name of the dataset to list table specs from. + */ + // const parent = 'abc123' + /** + * Mask specifying which fields to read. + */ + // const fieldMask = {} + /** + * Filter expression, see go/filtering. + */ + // const filter = 'abc123' + /** + * Requested page size. The server can return fewer results than requested. + * If unspecified, the server will pick a default size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return. + * Typically obtained from the + * ListTableSpecsResponse.next_page_token google.cloud.automl.v1beta1.ListTableSpecsResponse.next_page_token field of the previous + * AutoMl.ListTableSpecs google.cloud.automl.v1beta1.AutoMl.ListTableSpecs call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListTableSpecs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listTableSpecsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTableSpecs(); + // [END automl_v1beta1_generated_AutoMl_ListTableSpecs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.undeploy_model.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.undeploy_model.js new file mode 100644 index 00000000000..7af99326c79 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.undeploy_model.js @@ -0,0 +1,62 @@ +// Copyright 2023 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 automl_v1beta1_generated_AutoMl_UndeployModel_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. Resource name of the model to undeploy. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUndeployModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.undeployModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeployModel(); + // [END automl_v1beta1_generated_AutoMl_UndeployModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_column_spec.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_column_spec.js new file mode 100644 index 00000000000..424f65a0042 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_column_spec.js @@ -0,0 +1,65 @@ +// Copyright 2023 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(columnSpec) { + // [START automl_v1beta1_generated_AutoMl_UpdateColumnSpec_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 column spec which replaces the resource on the server. + */ + // const columnSpec = {} + /** + * The update mask applies to the resource. + */ + // const updateMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUpdateColumnSpec() { + // Construct request + const request = { + columnSpec, + }; + + // Run request + const response = await automlClient.updateColumnSpec(request); + console.log(response); + } + + callUpdateColumnSpec(); + // [END automl_v1beta1_generated_AutoMl_UpdateColumnSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_dataset.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_dataset.js new file mode 100644 index 00000000000..1e782b62195 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_dataset.js @@ -0,0 +1,65 @@ +// Copyright 2023 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(dataset) { + // [START automl_v1beta1_generated_AutoMl_UpdateDataset_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 dataset which replaces the resource on the server. + */ + // const dataset = {} + /** + * The update mask applies to the resource. + */ + // const updateMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUpdateDataset() { + // Construct request + const request = { + dataset, + }; + + // Run request + const response = await automlClient.updateDataset(request); + console.log(response); + } + + callUpdateDataset(); + // [END automl_v1beta1_generated_AutoMl_UpdateDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_table_spec.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_table_spec.js new file mode 100644 index 00000000000..68fecefaa93 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_table_spec.js @@ -0,0 +1,65 @@ +// Copyright 2023 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(tableSpec) { + // [START automl_v1beta1_generated_AutoMl_UpdateTableSpec_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 table spec which replaces the resource on the server. + */ + // const tableSpec = {} + /** + * The update mask applies to the resource. + */ + // const updateMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUpdateTableSpec() { + // Construct request + const request = { + tableSpec, + }; + + // Run request + const response = await automlClient.updateTableSpec(request); + console.log(response); + } + + callUpdateTableSpec(); + // [END automl_v1beta1_generated_AutoMl_UpdateTableSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.batch_predict.js b/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.batch_predict.js new file mode 100644 index 00000000000..57e2b419a52 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.batch_predict.js @@ -0,0 +1,135 @@ +// Copyright 2023 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, outputConfig, params) { + // [START automl_v1beta1_generated_PredictionService_BatchPredict_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 model requested to serve the batch prediction. + */ + // const name = 'abc123' + /** + * Required. The input configuration for batch prediction. + */ + // const inputConfig = {} + /** + * Required. The Configuration specifying where output predictions should + * be written. + */ + // const outputConfig = {} + /** + * Required. Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * * For Text Classification: + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * * For Image Classification: + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * * For Image Object Detection: + * `score_threshold` - (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be produced per image. Default is 100, the + * requested value may be limited by server. + * * For Video Classification : + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for a video, it will only produce results that + * have at least this confidence score. The default is 0.5. + * `segment_classification` - (boolean) Set to true to request + * segment-level classification. AutoML Video Intelligence returns + * labels and their confidence scores for the entire segment of the + * video that user specified in the request configuration. + * The default is "true". + * `shot_classification` - (boolean) Set to true to request shot-level + * classification. AutoML Video Intelligence determines the boundaries + * for each camera shot in the entire segment of the video that user + * specified in the request configuration. AutoML Video Intelligence + * then returns labels and their confidence scores for each detected + * shot, along with the start and end time of the shot. + * WARNING: Model evaluation is not done for this classification type, + * the quality of it depends on training data, but there are no metrics + * provided to describe that quality. The default is "false". + * `1s_interval_classification` - (boolean) Set to true to request + * classification for a video at one-second intervals. AutoML Video + * Intelligence returns labels and their confidence scores for each + * second of the entire segment of the video that user specified in the + * request configuration. + * WARNING: Model evaluation is not done for this classification + * type, the quality of it depends on training data, but there are no + * metrics provided to describe that quality. The default is + * "false". + * * For Tables: + * feature_importance - (boolean) Whether feature importance + * should be populated in the returned TablesAnnotations. The + * default is false. + * * For Video Object Tracking: + * `score_threshold` - (float) When Model detects objects on video frames, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be returned per frame. Default is 100, the requested + * value may be limited by server. + * `min_bounding_box_size` - (float) Only bounding boxes with shortest edge + * at least that long as a relative value of video frame size will be + * returned. Value in 0 to 1 range. Default is 0. + */ + // const params = [1,2,3,4] + + // Imports the Automl library + const {PredictionServiceClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new PredictionServiceClient(); + + async function callBatchPredict() { + // Construct request + const request = { + name, + inputConfig, + outputConfig, + params, + }; + + // Run request + const [operation] = await automlClient.batchPredict(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchPredict(); + // [END automl_v1beta1_generated_PredictionService_BatchPredict_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.predict.js b/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.predict.js new file mode 100644 index 00000000000..1ae50901843 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.predict.js @@ -0,0 +1,87 @@ +// Copyright 2023 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, payload) { + // [START automl_v1beta1_generated_PredictionService_Predict_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 model requested to serve the prediction. + */ + // const name = 'abc123' + /** + * Required. Payload to perform a prediction on. The payload must match the + * problem type that the model was trained to solve. + */ + // const payload = {} + /** + * Additional domain-specific parameters, any string must be up to 25000 + * characters long. + * * For Image Classification: + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * * For Image Object Detection: + * `score_threshold` - (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be returned in the response. Default is 100, the + * requested value may be limited by server. + * * For Tables: + * feature_importance - (boolean) Whether feature importance + * should be populated in the returned TablesAnnotation. + * The default is false. + */ + // const params = [1,2,3,4] + + // Imports the Automl library + const {PredictionServiceClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new PredictionServiceClient(); + + async function callPredict() { + // Construct request + const request = { + name, + payload, + }; + + // Run request + const response = await automlClient.predict(request); + console.log(response); + } + + callPredict(); + // [END automl_v1beta1_generated_PredictionService_Predict_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/snippet_metadata.google.cloud.automl.v1beta1.json b/packages/google-cloud-automl/samples/generated/v1beta1/snippet_metadata.google.cloud.automl.v1beta1.json new file mode 100644 index 00000000000..e0dc5502de5 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/snippet_metadata.google.cloud.automl.v1beta1.json @@ -0,0 +1,1195 @@ +{ + "clientLibrary": { + "name": "nodejs-automl", + "version": "4.0.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.automl.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "automl_v1beta1_generated_AutoMl_CreateDataset_async", + "title": "automl createDataset Sample", + "origin": "API_DEFINITION", + "description": " Creates a dataset.", + "canonical": true, + "file": "auto_ml.create_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.CreateDataset", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "dataset", + "type": ".google.cloud.automl.v1beta1.Dataset" + } + ], + "resultType": ".google.cloud.automl.v1beta1.Dataset", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "CreateDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.CreateDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetDataset_async", + "title": "automl getDataset Sample", + "origin": "API_DEFINITION", + "description": " Gets a dataset.", + "canonical": true, + "file": "auto_ml.get_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.Dataset", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ListDatasets_async", + "title": "automl listDatasets Sample", + "origin": "API_DEFINITION", + "description": " Lists datasets in a project.", + "canonical": true, + "file": "auto_ml.list_datasets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDatasets", + "fullName": "google.cloud.automl.v1beta1.AutoMl.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.automl.v1beta1.ListDatasetsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ListDatasets", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListDatasets", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_UpdateDataset_async", + "title": "automl updateDataset Sample", + "origin": "API_DEFINITION", + "description": " Updates a dataset.", + "canonical": true, + "file": "auto_ml.update_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateDataset", + "async": true, + "parameters": [ + { + "name": "dataset", + "type": ".google.cloud.automl.v1beta1.Dataset" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1beta1.Dataset", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "UpdateDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_DeleteDataset_async", + "title": "automl deleteDataset Sample", + "origin": "API_DEFINITION", + "description": " Deletes a dataset and all of its contents. Returns empty response in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.", + "canonical": true, + "file": "auto_ml.delete_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeleteDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "DeleteDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeleteDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ImportData_async", + "title": "automl importData Sample", + "origin": "API_DEFINITION", + "description": " Imports data into a dataset. For Tables this method can only be called on an empty Dataset. For Tables: * A [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter must be explicitly set. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.import_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportData", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ImportData", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "input_config", + "type": ".google.cloud.automl.v1beta1.InputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ImportData", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ImportData", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ExportData_async", + "title": "automl exportData Sample", + "origin": "API_DEFINITION", + "description": " Exports dataset's data to the provided output location. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.export_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportData", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportData", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1beta1.OutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ExportData", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportData", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetAnnotationSpec_async", + "title": "automl getAnnotationSpec Sample", + "origin": "API_DEFINITION", + "description": " Gets an annotation spec.", + "canonical": true, + "file": "auto_ml.get_annotation_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAnnotationSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetAnnotationSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.AnnotationSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetAnnotationSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetAnnotationSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetTableSpec_async", + "title": "automl getTableSpec Sample", + "origin": "API_DEFINITION", + "description": " Gets a table spec.", + "canonical": true, + "file": "auto_ml.get_table_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTableSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetTableSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1beta1.TableSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetTableSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetTableSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ListTableSpecs_async", + "title": "automl listTableSpecs Sample", + "origin": "API_DEFINITION", + "description": " Lists table specs in a dataset.", + "canonical": true, + "file": "auto_ml.list_table_specs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTableSpecs", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListTableSpecs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ListTableSpecsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ListTableSpecs", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListTableSpecs", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_UpdateTableSpec_async", + "title": "automl updateTableSpec Sample", + "origin": "API_DEFINITION", + "description": " Updates a table spec.", + "canonical": true, + "file": "auto_ml.update_table_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTableSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateTableSpec", + "async": true, + "parameters": [ + { + "name": "table_spec", + "type": ".google.cloud.automl.v1beta1.TableSpec" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1beta1.TableSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "UpdateTableSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateTableSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetColumnSpec_async", + "title": "automl getColumnSpec Sample", + "origin": "API_DEFINITION", + "description": " Gets a column spec.", + "canonical": true, + "file": "auto_ml.get_column_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetColumnSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetColumnSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ColumnSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetColumnSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetColumnSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ListColumnSpecs_async", + "title": "automl listColumnSpecs Sample", + "origin": "API_DEFINITION", + "description": " Lists column specs in a table spec.", + "canonical": true, + "file": "auto_ml.list_column_specs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListColumnSpecs", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ListColumnSpecsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ListColumnSpecs", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_UpdateColumnSpec_async", + "title": "automl updateColumnSpec Sample", + "origin": "API_DEFINITION", + "description": " Updates a column spec.", + "canonical": true, + "file": "auto_ml.update_column_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateColumnSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateColumnSpec", + "async": true, + "parameters": [ + { + "name": "column_spec", + "type": ".google.cloud.automl.v1beta1.ColumnSpec" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ColumnSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "UpdateColumnSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateColumnSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_CreateModel_async", + "title": "automl createModel Sample", + "origin": "API_DEFINITION", + "description": " Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.", + "canonical": true, + "file": "auto_ml.create_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.CreateModel", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": ".google.cloud.automl.v1beta1.Model" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "CreateModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.CreateModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetModel_async", + "title": "automl getModel Sample", + "origin": "API_DEFINITION", + "description": " Gets a model.", + "canonical": true, + "file": "auto_ml.get_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.Model", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ListModels_async", + "title": "automl listModels Sample", + "origin": "API_DEFINITION", + "description": " Lists models.", + "canonical": true, + "file": "auto_ml.list_models.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListModels", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListModels", + "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.automl.v1beta1.ListModelsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ListModels", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListModels", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_DeleteModel_async", + "title": "automl deleteModel Sample", + "origin": "API_DEFINITION", + "description": " Deletes a model. Returns `google.protobuf.Empty` in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.", + "canonical": true, + "file": "auto_ml.delete_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeleteModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "DeleteModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeleteModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_DeployModel_async", + "title": "automl deployModel Sample", + "origin": "API_DEFINITION", + "description": " Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing [node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability. Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.deploy_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeployModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeployModel", + "async": true, + "parameters": [ + { + "name": "image_object_detection_model_deployment_metadata", + "type": ".google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata" + }, + { + "name": "image_classification_model_deployment_metadata", + "type": ".google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "DeployModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeployModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_UndeployModel_async", + "title": "automl undeployModel Sample", + "origin": "API_DEFINITION", + "description": " Undeploys a model. If the model is not deployed this method has no effect. Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.undeploy_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeployModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UndeployModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "UndeployModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UndeployModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ExportModel_async", + "title": "automl exportModel Sample", + "origin": "API_DEFINITION", + "description": " Exports a trained, \"export-able\", model to a user specified Google Cloud Storage location. A model is considered export-able if and only if it has an export format defined for it in [ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.export_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1beta1.ModelExportOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ExportModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ExportEvaluatedExamples_async", + "title": "automl exportEvaluatedExamples Sample", + "origin": "API_DEFINITION", + "description": " Exports examples on which the model was evaluated (i.e. which were in the TEST set of the dataset the model was created from), together with their ground truth annotations and the annotations created (predicted) by the model. The examples, ground truth and predictions are exported in the state they were at the moment the model was evaluated. This export is available only for 30 days since the model evaluation is created. Currently only available for Tables. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.export_evaluated_examples.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportEvaluatedExamples", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportEvaluatedExamples", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ExportEvaluatedExamples", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportEvaluatedExamples", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetModelEvaluation_async", + "title": "automl getModelEvaluation Sample", + "origin": "API_DEFINITION", + "description": " Gets a model evaluation.", + "canonical": true, + "file": "auto_ml.get_model_evaluation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetModelEvaluation", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetModelEvaluation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ModelEvaluation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetModelEvaluation", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetModelEvaluation", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ListModelEvaluations_async", + "title": "automl listModelEvaluations Sample", + "origin": "API_DEFINITION", + "description": " Lists model evaluations.", + "canonical": true, + "file": "auto_ml.list_model_evaluations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListModelEvaluations", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations", + "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.automl.v1beta1.ListModelEvaluationsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ListModelEvaluations", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_PredictionService_Predict_async", + "title": "automl predict Sample", + "origin": "API_DEFINITION", + "description": " Perform an online prediction. The prediction result will be directly returned in the response. Available for following ML problems, and their expected request payloads: * Image Classification - Image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. * Image Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. * Text Classification - TextSnippet, content up to 60,000 characters, UTF-8 encoded. * Text Extraction - TextSnippet, content up to 30,000 characters, UTF-8 NFC encoded. * Translation - TextSnippet, content up to 25,000 characters, UTF-8 encoded. * Tables - Row, with column values matching the columns of the model, up to 5MB. Not available for FORECASTING [prediction_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]. * Text Sentiment - TextSnippet, content up 500 characters, UTF-8 encoded.", + "canonical": true, + "file": "prediction_service.predict.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Predict", + "fullName": "google.cloud.automl.v1beta1.PredictionService.Predict", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "payload", + "type": ".google.cloud.automl.v1beta1.ExamplePayload" + }, + { + "name": "params", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.automl.v1beta1.PredictResponse", + "client": { + "shortName": "PredictionServiceClient", + "fullName": "google.cloud.automl.v1beta1.PredictionServiceClient" + }, + "method": { + "shortName": "Predict", + "fullName": "google.cloud.automl.v1beta1.PredictionService.Predict", + "service": { + "shortName": "PredictionService", + "fullName": "google.cloud.automl.v1beta1.PredictionService" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_PredictionService_BatchPredict_async", + "title": "automl batchPredict Sample", + "origin": "API_DEFINITION", + "description": " Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1beta1.PredictionService.Predict], batch prediction result won't be immediately available in the response. Instead, a long running operation object is returned. User can poll the operation result via [GetOperation][google.longrunning.Operations.GetOperation] method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1beta1.BatchPredictResult] is returned in the [response][google.longrunning.Operation.response] field. Available for following ML problems: * Image Classification * Image Object Detection * Video Classification * Video Object Tracking * Text Extraction * Tables", + "canonical": true, + "file": "prediction_service.batch_predict.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 127, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchPredict", + "fullName": "google.cloud.automl.v1beta1.PredictionService.BatchPredict", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "input_config", + "type": ".google.cloud.automl.v1beta1.BatchPredictInputConfig" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1beta1.BatchPredictOutputConfig" + }, + { + "name": "params", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "PredictionServiceClient", + "fullName": "google.cloud.automl.v1beta1.PredictionServiceClient" + }, + "method": { + "shortName": "BatchPredict", + "fullName": "google.cloud.automl.v1beta1.PredictionService.BatchPredict", + "service": { + "shortName": "PredictionService", + "fullName": "google.cloud.automl.v1beta1.PredictionService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/snippet_metadata_google.cloud.automl.v1beta1.json b/packages/google-cloud-automl/samples/generated/v1beta1/snippet_metadata_google.cloud.automl.v1beta1.json new file mode 100644 index 00000000000..e0dc5502de5 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/snippet_metadata_google.cloud.automl.v1beta1.json @@ -0,0 +1,1195 @@ +{ + "clientLibrary": { + "name": "nodejs-automl", + "version": "4.0.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.automl.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "automl_v1beta1_generated_AutoMl_CreateDataset_async", + "title": "automl createDataset Sample", + "origin": "API_DEFINITION", + "description": " Creates a dataset.", + "canonical": true, + "file": "auto_ml.create_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.CreateDataset", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "dataset", + "type": ".google.cloud.automl.v1beta1.Dataset" + } + ], + "resultType": ".google.cloud.automl.v1beta1.Dataset", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "CreateDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.CreateDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetDataset_async", + "title": "automl getDataset Sample", + "origin": "API_DEFINITION", + "description": " Gets a dataset.", + "canonical": true, + "file": "auto_ml.get_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.Dataset", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ListDatasets_async", + "title": "automl listDatasets Sample", + "origin": "API_DEFINITION", + "description": " Lists datasets in a project.", + "canonical": true, + "file": "auto_ml.list_datasets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDatasets", + "fullName": "google.cloud.automl.v1beta1.AutoMl.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.automl.v1beta1.ListDatasetsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ListDatasets", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListDatasets", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_UpdateDataset_async", + "title": "automl updateDataset Sample", + "origin": "API_DEFINITION", + "description": " Updates a dataset.", + "canonical": true, + "file": "auto_ml.update_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateDataset", + "async": true, + "parameters": [ + { + "name": "dataset", + "type": ".google.cloud.automl.v1beta1.Dataset" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1beta1.Dataset", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "UpdateDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_DeleteDataset_async", + "title": "automl deleteDataset Sample", + "origin": "API_DEFINITION", + "description": " Deletes a dataset and all of its contents. Returns empty response in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.", + "canonical": true, + "file": "auto_ml.delete_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeleteDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "DeleteDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeleteDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ImportData_async", + "title": "automl importData Sample", + "origin": "API_DEFINITION", + "description": " Imports data into a dataset. For Tables this method can only be called on an empty Dataset. For Tables: * A [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter must be explicitly set. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.import_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportData", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ImportData", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "input_config", + "type": ".google.cloud.automl.v1beta1.InputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ImportData", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ImportData", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ExportData_async", + "title": "automl exportData Sample", + "origin": "API_DEFINITION", + "description": " Exports dataset's data to the provided output location. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.export_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportData", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportData", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1beta1.OutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ExportData", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportData", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetAnnotationSpec_async", + "title": "automl getAnnotationSpec Sample", + "origin": "API_DEFINITION", + "description": " Gets an annotation spec.", + "canonical": true, + "file": "auto_ml.get_annotation_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAnnotationSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetAnnotationSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.AnnotationSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetAnnotationSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetAnnotationSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetTableSpec_async", + "title": "automl getTableSpec Sample", + "origin": "API_DEFINITION", + "description": " Gets a table spec.", + "canonical": true, + "file": "auto_ml.get_table_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTableSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetTableSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1beta1.TableSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetTableSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetTableSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ListTableSpecs_async", + "title": "automl listTableSpecs Sample", + "origin": "API_DEFINITION", + "description": " Lists table specs in a dataset.", + "canonical": true, + "file": "auto_ml.list_table_specs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTableSpecs", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListTableSpecs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ListTableSpecsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ListTableSpecs", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListTableSpecs", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_UpdateTableSpec_async", + "title": "automl updateTableSpec Sample", + "origin": "API_DEFINITION", + "description": " Updates a table spec.", + "canonical": true, + "file": "auto_ml.update_table_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTableSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateTableSpec", + "async": true, + "parameters": [ + { + "name": "table_spec", + "type": ".google.cloud.automl.v1beta1.TableSpec" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1beta1.TableSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "UpdateTableSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateTableSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetColumnSpec_async", + "title": "automl getColumnSpec Sample", + "origin": "API_DEFINITION", + "description": " Gets a column spec.", + "canonical": true, + "file": "auto_ml.get_column_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetColumnSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetColumnSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ColumnSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetColumnSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetColumnSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ListColumnSpecs_async", + "title": "automl listColumnSpecs Sample", + "origin": "API_DEFINITION", + "description": " Lists column specs in a table spec.", + "canonical": true, + "file": "auto_ml.list_column_specs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListColumnSpecs", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ListColumnSpecsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ListColumnSpecs", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_UpdateColumnSpec_async", + "title": "automl updateColumnSpec Sample", + "origin": "API_DEFINITION", + "description": " Updates a column spec.", + "canonical": true, + "file": "auto_ml.update_column_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateColumnSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateColumnSpec", + "async": true, + "parameters": [ + { + "name": "column_spec", + "type": ".google.cloud.automl.v1beta1.ColumnSpec" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ColumnSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "UpdateColumnSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateColumnSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_CreateModel_async", + "title": "automl createModel Sample", + "origin": "API_DEFINITION", + "description": " Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.", + "canonical": true, + "file": "auto_ml.create_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.CreateModel", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": ".google.cloud.automl.v1beta1.Model" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "CreateModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.CreateModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetModel_async", + "title": "automl getModel Sample", + "origin": "API_DEFINITION", + "description": " Gets a model.", + "canonical": true, + "file": "auto_ml.get_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.Model", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ListModels_async", + "title": "automl listModels Sample", + "origin": "API_DEFINITION", + "description": " Lists models.", + "canonical": true, + "file": "auto_ml.list_models.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListModels", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListModels", + "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.automl.v1beta1.ListModelsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ListModels", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListModels", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_DeleteModel_async", + "title": "automl deleteModel Sample", + "origin": "API_DEFINITION", + "description": " Deletes a model. Returns `google.protobuf.Empty` in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.", + "canonical": true, + "file": "auto_ml.delete_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeleteModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "DeleteModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeleteModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_DeployModel_async", + "title": "automl deployModel Sample", + "origin": "API_DEFINITION", + "description": " Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing [node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability. Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.deploy_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeployModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeployModel", + "async": true, + "parameters": [ + { + "name": "image_object_detection_model_deployment_metadata", + "type": ".google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata" + }, + { + "name": "image_classification_model_deployment_metadata", + "type": ".google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "DeployModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeployModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_UndeployModel_async", + "title": "automl undeployModel Sample", + "origin": "API_DEFINITION", + "description": " Undeploys a model. If the model is not deployed this method has no effect. Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.undeploy_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeployModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UndeployModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "UndeployModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UndeployModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ExportModel_async", + "title": "automl exportModel Sample", + "origin": "API_DEFINITION", + "description": " Exports a trained, \"export-able\", model to a user specified Google Cloud Storage location. A model is considered export-able if and only if it has an export format defined for it in [ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.export_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1beta1.ModelExportOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ExportModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ExportEvaluatedExamples_async", + "title": "automl exportEvaluatedExamples Sample", + "origin": "API_DEFINITION", + "description": " Exports examples on which the model was evaluated (i.e. which were in the TEST set of the dataset the model was created from), together with their ground truth annotations and the annotations created (predicted) by the model. The examples, ground truth and predictions are exported in the state they were at the moment the model was evaluated. This export is available only for 30 days since the model evaluation is created. Currently only available for Tables. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.export_evaluated_examples.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportEvaluatedExamples", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportEvaluatedExamples", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ExportEvaluatedExamples", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportEvaluatedExamples", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetModelEvaluation_async", + "title": "automl getModelEvaluation Sample", + "origin": "API_DEFINITION", + "description": " Gets a model evaluation.", + "canonical": true, + "file": "auto_ml.get_model_evaluation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetModelEvaluation", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetModelEvaluation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ModelEvaluation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetModelEvaluation", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetModelEvaluation", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ListModelEvaluations_async", + "title": "automl listModelEvaluations Sample", + "origin": "API_DEFINITION", + "description": " Lists model evaluations.", + "canonical": true, + "file": "auto_ml.list_model_evaluations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListModelEvaluations", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations", + "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.automl.v1beta1.ListModelEvaluationsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ListModelEvaluations", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_PredictionService_Predict_async", + "title": "automl predict Sample", + "origin": "API_DEFINITION", + "description": " Perform an online prediction. The prediction result will be directly returned in the response. Available for following ML problems, and their expected request payloads: * Image Classification - Image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. * Image Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. * Text Classification - TextSnippet, content up to 60,000 characters, UTF-8 encoded. * Text Extraction - TextSnippet, content up to 30,000 characters, UTF-8 NFC encoded. * Translation - TextSnippet, content up to 25,000 characters, UTF-8 encoded. * Tables - Row, with column values matching the columns of the model, up to 5MB. Not available for FORECASTING [prediction_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]. * Text Sentiment - TextSnippet, content up 500 characters, UTF-8 encoded.", + "canonical": true, + "file": "prediction_service.predict.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Predict", + "fullName": "google.cloud.automl.v1beta1.PredictionService.Predict", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "payload", + "type": ".google.cloud.automl.v1beta1.ExamplePayload" + }, + { + "name": "params", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.automl.v1beta1.PredictResponse", + "client": { + "shortName": "PredictionServiceClient", + "fullName": "google.cloud.automl.v1beta1.PredictionServiceClient" + }, + "method": { + "shortName": "Predict", + "fullName": "google.cloud.automl.v1beta1.PredictionService.Predict", + "service": { + "shortName": "PredictionService", + "fullName": "google.cloud.automl.v1beta1.PredictionService" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_PredictionService_BatchPredict_async", + "title": "automl batchPredict Sample", + "origin": "API_DEFINITION", + "description": " Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1beta1.PredictionService.Predict], batch prediction result won't be immediately available in the response. Instead, a long running operation object is returned. User can poll the operation result via [GetOperation][google.longrunning.Operations.GetOperation] method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1beta1.BatchPredictResult] is returned in the [response][google.longrunning.Operation.response] field. Available for following ML problems: * Image Classification * Image Object Detection * Video Classification * Video Object Tracking * Text Extraction * Tables", + "canonical": true, + "file": "prediction_service.batch_predict.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 127, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchPredict", + "fullName": "google.cloud.automl.v1beta1.PredictionService.BatchPredict", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "input_config", + "type": ".google.cloud.automl.v1beta1.BatchPredictInputConfig" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1beta1.BatchPredictOutputConfig" + }, + { + "name": "params", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "PredictionServiceClient", + "fullName": "google.cloud.automl.v1beta1.PredictionServiceClient" + }, + "method": { + "shortName": "BatchPredict", + "fullName": "google.cloud.automl.v1beta1.PredictionService.BatchPredict", + "service": { + "shortName": "PredictionService", + "fullName": "google.cloud.automl.v1beta1.PredictionService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-automl/samples/package.json b/packages/google-cloud-automl/samples/package.json new file mode 100644 index 00000000000..886dc6020f4 --- /dev/null +++ b/packages/google-cloud-automl/samples/package.json @@ -0,0 +1,30 @@ +{ + "name": "@google-cloud/automl-samples", + "description": "Samples for the Cloud AutoML Client Library for Node.js.", + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=14.0.0" + }, + "repository": "googleapis/nodejs-automl", + "private": true, + "scripts": { + "test": "mocha --timeout 9000000" + }, + "files": [ + "**/*.js", + "!test/" + ], + "dependencies": { + "@google-cloud/automl": "^4.0.0", + "csv": "^6.0.0", + "mathjs": "^11.0.0", + "yargs": "^16.0.0" + }, + "devDependencies": { + "@google-cloud/storage": "^7.0.1", + "chai": "^4.2.0", + "mocha": "^8.0.0", + "uuid": "^9.0.0" + } +} \ No newline at end of file diff --git a/packages/google-cloud-automl/samples/quickstart.js b/packages/google-cloud-automl/samples/quickstart.js new file mode 100644 index 00000000000..83bb3aa63ef --- /dev/null +++ b/packages/google-cloud-automl/samples/quickstart.js @@ -0,0 +1,73 @@ +// 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. + +'use strict'; + +async function main( + projectId, + computeRegion, + modelId, + filePath, + scoreThreshold +) { + // [START automl_quickstart] + const automl = require('@google-cloud/automl'); + const fs = require('fs'); + + // Create client for prediction service. + const client = new automl.PredictionServiceClient(); + + /** + * TODO(developer): Uncomment the following line before running the sample. + */ + // const projectId = `The GCLOUD_PROJECT string, e.g. "my-gcloud-project"`; + // const computeRegion = `region-name, e.g. "us-central1"`; + // const modelId = `id of the model, e.g. “ICN723541179344731436”`; + // const filePath = `local text file path of content to be classified, e.g. "./resources/flower.png"`; + // const scoreThreshold = `value between 0.0 and 1.0, e.g. "0.5"`; + + // Get the full path of the model. + const modelFullId = client.modelPath(projectId, computeRegion, modelId); + + // Read the file content for prediction. + const content = fs.readFileSync(filePath, 'base64'); + + const params = {}; + + if (scoreThreshold) { + params.score_threshold = scoreThreshold; + } + + // Set the payload by giving the content and type of the file. + const payload = {}; + payload.image = {imageBytes: content}; + + // params is additional domain-specific parameters. + // currently there is no additional parameters supported. + const [response] = await client.predict({ + name: modelFullId, + payload: payload, + params: params, + }); + console.log('Prediction results:'); + response.payload.forEach(result => { + console.log(`Predicted class name: ${result.displayName}`); + console.log(`Predicted class score: ${result.classification.score}`); + }); + // [END automl_quickstart] +} +main(...process.argv.slice(2)).catch(err => { + console.error(err); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-automl/src/index.ts b/packages/google-cloud-automl/src/index.ts new file mode 100644 index 00000000000..d8a6023d937 --- /dev/null +++ b/packages/google-cloud-automl/src/index.ts @@ -0,0 +1,30 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +import * as v1beta1 from './v1beta1'; + +const AutoMlClient = v1.AutoMlClient; +type AutoMlClient = v1.AutoMlClient; +const PredictionServiceClient = v1.PredictionServiceClient; +type PredictionServiceClient = v1.PredictionServiceClient; + +export {v1, v1beta1, AutoMlClient, PredictionServiceClient}; +export default {v1, v1beta1, AutoMlClient, PredictionServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-automl/src/v1/auto_ml_client.ts b/packages/google-cloud-automl/src/v1/auto_ml_client.ts new file mode 100644 index 00000000000..5c794103027 --- /dev/null +++ b/packages/google-cloud-automl/src/v1/auto_ml_client.ts @@ -0,0 +1,3342 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/auto_ml_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './auto_ml_client_config.json'; +const version = require('../../../package.json').version; + +/** + * AutoML Server API. + * + * The resource names are assigned by the server. + * The server never reuses names that it has created after the resources with + * those names are deleted. + * + * An ID of a resource is the last element of the item's resource name. For + * `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then + * the id for the item is `{dataset_id}`. + * + * Currently the only supported `location_id` is "us-central1". + * + * On any input that is documented to expect a string parameter in + * snake_case or dash-case, either of those cases is accepted. + * @class + * @memberof v1 + */ +export class AutoMlClient { + 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; + autoMlStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AutoMlClient. + * + * @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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 AutoMlClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AutoMlClient; + 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); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // 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 { + 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 = { + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}' + ), + }; + + // 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' + ), + listModels: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'model' + ), + listModelEvaluations: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'modelEvaluation' + ), + }; + + 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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/*/datasets/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/models/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/datasets/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/models/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/**}:testIamPermissions', + body: '*', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + { + selector: 'google.longrunning.Operations.WaitOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:wait', + body: '*', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createDatasetResponse = protoFilesRoot.lookup( + '.google.cloud.automl.v1.Dataset' + ) as gax.protobuf.Type; + const createDatasetMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteDatasetResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteDatasetMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1.OperationMetadata' + ) as gax.protobuf.Type; + const importDataResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const importDataMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1.OperationMetadata' + ) as gax.protobuf.Type; + const exportDataResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const exportDataMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createModelResponse = protoFilesRoot.lookup( + '.google.cloud.automl.v1.Model' + ) as gax.protobuf.Type; + const createModelMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteModelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteModelMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deployModelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deployModelMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1.OperationMetadata' + ) as gax.protobuf.Type; + const undeployModelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const undeployModelMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1.OperationMetadata' + ) as gax.protobuf.Type; + const exportModelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const exportModelMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createDataset: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createDatasetResponse.decode.bind(createDatasetResponse), + createDatasetMetadata.decode.bind(createDatasetMetadata) + ), + deleteDataset: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteDatasetResponse.decode.bind(deleteDatasetResponse), + deleteDatasetMetadata.decode.bind(deleteDatasetMetadata) + ), + 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) + ), + createModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createModelResponse.decode.bind(createModelResponse), + createModelMetadata.decode.bind(createModelMetadata) + ), + deleteModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteModelResponse.decode.bind(deleteModelResponse), + deleteModelMetadata.decode.bind(deleteModelMetadata) + ), + deployModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deployModelResponse.decode.bind(deployModelResponse), + deployModelMetadata.decode.bind(deployModelMetadata) + ), + undeployModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeployModelResponse.decode.bind(undeployModelResponse), + undeployModelMetadata.decode.bind(undeployModelMetadata) + ), + exportModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportModelResponse.decode.bind(exportModelResponse), + exportModelMetadata.decode.bind(exportModelMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.automl.v1.AutoMl', + 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.autoMlStub) { + return this.autoMlStub; + } + + // Put together the "service stub" for + // google.cloud.automl.v1.AutoMl. + this.autoMlStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.automl.v1.AutoMl' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.automl.v1.AutoMl, + 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 autoMlStubMethods = [ + 'createDataset', + 'getDataset', + 'listDatasets', + 'updateDataset', + 'deleteDataset', + 'importData', + 'exportData', + 'getAnnotationSpec', + 'createModel', + 'getModel', + 'listModels', + 'deleteModel', + 'updateModel', + 'deployModel', + 'undeployModel', + 'exportModel', + 'getModelEvaluation', + 'listModelEvaluations', + ]; + for (const methodName of autoMlStubMethods) { + const callPromise = this.autoMlStub.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.autoMlStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'automl.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 'automl.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 -- + // ------------------- + /** + * Gets a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the dataset to retrieve. + * @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 {@link protos.google.cloud.automl.v1.Dataset|Dataset}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.get_dataset.js + * region_tag:automl_v1_generated_AutoMl_GetDataset_async + */ + getDataset( + request?: protos.google.cloud.automl.v1.IGetDatasetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IGetDatasetRequest | undefined, + {} | undefined, + ] + >; + getDataset( + request: protos.google.cloud.automl.v1.IGetDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IGetDatasetRequest | null | undefined, + {} | null | undefined + > + ): void; + getDataset( + request: protos.google.cloud.automl.v1.IGetDatasetRequest, + callback: Callback< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IGetDatasetRequest | null | undefined, + {} | null | undefined + > + ): void; + getDataset( + request?: protos.google.cloud.automl.v1.IGetDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IGetDatasetRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IGetDatasetRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.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); + } + /** + * Updates a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1.Dataset} request.dataset + * Required. The dataset which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.automl.v1.Dataset|Dataset}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.update_dataset.js + * region_tag:automl_v1_generated_AutoMl_UpdateDataset_async + */ + updateDataset( + request?: protos.google.cloud.automl.v1.IUpdateDatasetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IUpdateDatasetRequest | undefined, + {} | undefined, + ] + >; + updateDataset( + request: protos.google.cloud.automl.v1.IUpdateDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IUpdateDatasetRequest | null | undefined, + {} | null | undefined + > + ): void; + updateDataset( + request: protos.google.cloud.automl.v1.IUpdateDatasetRequest, + callback: Callback< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IUpdateDatasetRequest | null | undefined, + {} | null | undefined + > + ): void; + updateDataset( + request?: protos.google.cloud.automl.v1.IUpdateDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1.IDataset, + | protos.google.cloud.automl.v1.IUpdateDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IUpdateDatasetRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IUpdateDatasetRequest | 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({ + 'dataset.name': request.dataset!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateDataset(request, options, callback); + } + /** + * Gets an annotation spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the annotation spec to retrieve. + * @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 {@link protos.google.cloud.automl.v1.AnnotationSpec|AnnotationSpec}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.get_annotation_spec.js + * region_tag:automl_v1_generated_AutoMl_GetAnnotationSpec_async + */ + getAnnotationSpec( + request?: protos.google.cloud.automl.v1.IGetAnnotationSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IAnnotationSpec, + protos.google.cloud.automl.v1.IGetAnnotationSpecRequest | undefined, + {} | undefined, + ] + >; + getAnnotationSpec( + request: protos.google.cloud.automl.v1.IGetAnnotationSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1.IAnnotationSpec, + | protos.google.cloud.automl.v1.IGetAnnotationSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAnnotationSpec( + request: protos.google.cloud.automl.v1.IGetAnnotationSpecRequest, + callback: Callback< + protos.google.cloud.automl.v1.IAnnotationSpec, + | protos.google.cloud.automl.v1.IGetAnnotationSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAnnotationSpec( + request?: protos.google.cloud.automl.v1.IGetAnnotationSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1.IAnnotationSpec, + | protos.google.cloud.automl.v1.IGetAnnotationSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1.IAnnotationSpec, + | protos.google.cloud.automl.v1.IGetAnnotationSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1.IAnnotationSpec, + protos.google.cloud.automl.v1.IGetAnnotationSpecRequest | 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.getAnnotationSpec(request, options, callback); + } + /** + * Gets a model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the model. + * @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 {@link protos.google.cloud.automl.v1.Model|Model}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.get_model.js + * region_tag:automl_v1_generated_AutoMl_GetModel_async + */ + getModel( + request?: protos.google.cloud.automl.v1.IGetModelRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IGetModelRequest | undefined, + {} | undefined, + ] + >; + getModel( + request: protos.google.cloud.automl.v1.IGetModelRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IGetModelRequest | null | undefined, + {} | null | undefined + > + ): void; + getModel( + request: protos.google.cloud.automl.v1.IGetModelRequest, + callback: Callback< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IGetModelRequest | null | undefined, + {} | null | undefined + > + ): void; + getModel( + request?: protos.google.cloud.automl.v1.IGetModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IGetModelRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IGetModelRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IGetModelRequest | 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.getModel(request, options, callback); + } + /** + * Updates a model. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1.Model} request.model + * Required. The model which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.automl.v1.Model|Model}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.update_model.js + * region_tag:automl_v1_generated_AutoMl_UpdateModel_async + */ + updateModel( + request?: protos.google.cloud.automl.v1.IUpdateModelRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IUpdateModelRequest | undefined, + {} | undefined, + ] + >; + updateModel( + request: protos.google.cloud.automl.v1.IUpdateModelRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IUpdateModelRequest | null | undefined, + {} | null | undefined + > + ): void; + updateModel( + request: protos.google.cloud.automl.v1.IUpdateModelRequest, + callback: Callback< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IUpdateModelRequest | null | undefined, + {} | null | undefined + > + ): void; + updateModel( + request?: protos.google.cloud.automl.v1.IUpdateModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IUpdateModelRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IUpdateModelRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IUpdateModelRequest | 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({ + 'model.name': request.model!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateModel(request, options, callback); + } + /** + * Gets a model evaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name for the model evaluation. + * @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 {@link protos.google.cloud.automl.v1.ModelEvaluation|ModelEvaluation}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.get_model_evaluation.js + * region_tag:automl_v1_generated_AutoMl_GetModelEvaluation_async + */ + getModelEvaluation( + request?: protos.google.cloud.automl.v1.IGetModelEvaluationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IModelEvaluation, + protos.google.cloud.automl.v1.IGetModelEvaluationRequest | undefined, + {} | undefined, + ] + >; + getModelEvaluation( + request: protos.google.cloud.automl.v1.IGetModelEvaluationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1.IModelEvaluation, + | protos.google.cloud.automl.v1.IGetModelEvaluationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getModelEvaluation( + request: protos.google.cloud.automl.v1.IGetModelEvaluationRequest, + callback: Callback< + protos.google.cloud.automl.v1.IModelEvaluation, + | protos.google.cloud.automl.v1.IGetModelEvaluationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getModelEvaluation( + request?: protos.google.cloud.automl.v1.IGetModelEvaluationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1.IModelEvaluation, + | protos.google.cloud.automl.v1.IGetModelEvaluationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1.IModelEvaluation, + | protos.google.cloud.automl.v1.IGetModelEvaluationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1.IModelEvaluation, + protos.google.cloud.automl.v1.IGetModelEvaluationRequest | 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.getModelEvaluation(request, options, callback); + } + + /** + * Creates a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the project to create the dataset for. + * @param {google.cloud.automl.v1.Dataset} request.dataset + * Required. The dataset 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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.create_dataset.js + * region_tag:automl_v1_generated_AutoMl_CreateDataset_async + */ + createDataset( + request?: protos.google.cloud.automl.v1.ICreateDatasetRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createDataset( + request: protos.google.cloud.automl.v1.ICreateDatasetRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createDataset( + request: protos.google.cloud.automl.v1.ICreateDatasetRequest, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createDataset( + request?: protos.google.cloud.automl.v1.ICreateDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createDataset(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createDataset()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.create_dataset.js + * region_tag:automl_v1_generated_AutoMl_CreateDataset_async + */ + async checkCreateDatasetProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.automl.v1.Dataset, + protos.google.cloud.automl.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createDataset, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.automl.v1.Dataset, + protos.google.cloud.automl.v1.OperationMetadata + >; + } + /** + * Deletes a dataset and all of its contents. + * Returns empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes, + * and `delete_details` in the + * {@link protos.google.longrunning.Operation.metadata|metadata} field. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the dataset to delete. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.delete_dataset.js + * region_tag:automl_v1_generated_AutoMl_DeleteDataset_async + */ + deleteDataset( + request?: protos.google.cloud.automl.v1.IDeleteDatasetRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteDataset( + request: protos.google.cloud.automl.v1.IDeleteDatasetRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteDataset( + request: protos.google.cloud.automl.v1.IDeleteDatasetRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteDataset( + request?: protos.google.cloud.automl.v1.IDeleteDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteDataset(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteDataset()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.delete_dataset.js + * region_tag:automl_v1_generated_AutoMl_DeleteDataset_async + */ + async checkDeleteDatasetProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteDataset, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + >; + } + /** + * Imports data into a dataset. + * For Tables this method can only be called on an empty Dataset. + * + * For Tables: + * * A + * {@link protos.google.cloud.automl.v1.InputConfig.params|schema_inference_version} + * parameter must be explicitly set. + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Dataset name. Dataset must already exist. All imported + * annotations and examples will be added. + * @param {google.cloud.automl.v1.InputConfig} request.inputConfig + * Required. The desired input location and its domain specific semantics, + * if any. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.import_data.js + * region_tag:automl_v1_generated_AutoMl_ImportData_async + */ + importData( + request?: protos.google.cloud.automl.v1.IImportDataRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + importData( + request: protos.google.cloud.automl.v1.IImportDataRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importData( + request: protos.google.cloud.automl.v1.IImportDataRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importData( + request?: protos.google.cloud.automl.v1.IImportDataRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.import_data.js + * region_tag:automl_v1_generated_AutoMl_ImportData_async + */ + async checkImportDataProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.importData, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + >; + } + /** + * Exports dataset's data to the provided output location. + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the dataset. + * @param {google.cloud.automl.v1.OutputConfig} request.outputConfig + * Required. The desired output location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.export_data.js + * region_tag:automl_v1_generated_AutoMl_ExportData_async + */ + exportData( + request?: protos.google.cloud.automl.v1.IExportDataRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportData( + request: protos.google.cloud.automl.v1.IExportDataRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportData( + request: protos.google.cloud.automl.v1.IExportDataRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportData( + request?: protos.google.cloud.automl.v1.IExportDataRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.export_data.js + * region_tag:automl_v1_generated_AutoMl_ExportData_async + */ + async checkExportDataProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.exportData, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + >; + } + /** + * Creates a model. + * Returns a Model in the {@link protos.google.longrunning.Operation.response|response} + * field when it completes. + * When you create a model, several model evaluations are created for it: + * a global evaluation, and one evaluation for each annotation spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent project where the model is being created. + * @param {google.cloud.automl.v1.Model} request.model + * Required. The model 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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.create_model.js + * region_tag:automl_v1_generated_AutoMl_CreateModel_async + */ + createModel( + request?: protos.google.cloud.automl.v1.ICreateModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createModel( + request: protos.google.cloud.automl.v1.ICreateModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createModel( + request: protos.google.cloud.automl.v1.ICreateModelRequest, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createModel( + request?: protos.google.cloud.automl.v1.ICreateModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createModel()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.create_model.js + * region_tag:automl_v1_generated_AutoMl_CreateModel_async + */ + async checkCreateModelProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.automl.v1.Model, + protos.google.cloud.automl.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.automl.v1.Model, + protos.google.cloud.automl.v1.OperationMetadata + >; + } + /** + * Deletes a model. + * Returns `google.protobuf.Empty` in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes, + * and `delete_details` in the + * {@link protos.google.longrunning.Operation.metadata|metadata} field. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the model being deleted. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.delete_model.js + * region_tag:automl_v1_generated_AutoMl_DeleteModel_async + */ + deleteModel( + request?: protos.google.cloud.automl.v1.IDeleteModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteModel( + request: protos.google.cloud.automl.v1.IDeleteModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteModel( + request: protos.google.cloud.automl.v1.IDeleteModelRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteModel( + request?: protos.google.cloud.automl.v1.IDeleteModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteModel()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.delete_model.js + * region_tag:automl_v1_generated_AutoMl_DeleteModel_async + */ + async checkDeleteModelProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + >; + } + /** + * Deploys a model. If a model is already deployed, deploying it with the + * same parameters has no effect. Deploying with different parametrs + * (as e.g. changing + * {@link protos.google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number|node_number}) + * will reset the deployment state without pausing the model's availability. + * + * Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage + * deployment automatically. + * + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} request.imageObjectDetectionModelDeploymentMetadata + * Model deployment metadata specific to Image Object Detection. + * @param {google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} request.imageClassificationModelDeploymentMetadata + * Model deployment metadata specific to Image Classification. + * @param {string} request.name + * Required. Resource name of the model to deploy. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.deploy_model.js + * region_tag:automl_v1_generated_AutoMl_DeployModel_async + */ + deployModel( + request?: protos.google.cloud.automl.v1.IDeployModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deployModel( + request: protos.google.cloud.automl.v1.IDeployModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deployModel( + request: protos.google.cloud.automl.v1.IDeployModelRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deployModel( + request?: protos.google.cloud.automl.v1.IDeployModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deployModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deployModel()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.deploy_model.js + * region_tag:automl_v1_generated_AutoMl_DeployModel_async + */ + async checkDeployModelProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deployModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + >; + } + /** + * Undeploys a model. If the model is not deployed this method has no effect. + * + * Only applicable for Text Classification, Image Object Detection and Tables; + * all other domains manage deployment automatically. + * + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the model to undeploy. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.undeploy_model.js + * region_tag:automl_v1_generated_AutoMl_UndeployModel_async + */ + undeployModel( + request?: protos.google.cloud.automl.v1.IUndeployModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + undeployModel( + request: protos.google.cloud.automl.v1.IUndeployModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + undeployModel( + request: protos.google.cloud.automl.v1.IUndeployModelRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + undeployModel( + request?: protos.google.cloud.automl.v1.IUndeployModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.undeployModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `undeployModel()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.undeploy_model.js + * region_tag:automl_v1_generated_AutoMl_UndeployModel_async + */ + async checkUndeployModelProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.undeployModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + >; + } + /** + * Exports a trained, "export-able", model to a user specified Google Cloud + * Storage location. A model is considered export-able if and only if it has + * an export format defined for it in + * {@link protos.google.cloud.automl.v1.ModelExportOutputConfig|ModelExportOutputConfig}. + * + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the model to export. + * @param {google.cloud.automl.v1.ModelExportOutputConfig} request.outputConfig + * Required. The desired output location and configuration. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.export_model.js + * region_tag:automl_v1_generated_AutoMl_ExportModel_async + */ + exportModel( + request?: protos.google.cloud.automl.v1.IExportModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportModel( + request: protos.google.cloud.automl.v1.IExportModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportModel( + request: protos.google.cloud.automl.v1.IExportModelRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportModel( + request?: protos.google.cloud.automl.v1.IExportModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.exportModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `exportModel()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.export_model.js + * region_tag:automl_v1_generated_AutoMl_ExportModel_async + */ + async checkExportModelProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.exportModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + >; + } + /** + * Lists datasets in a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the project from which to list datasets. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of using the filter are: + * + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + * @param {number} request.pageSize + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1.ListDatasetsResponse.next_page_token|ListDatasetsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1.AutoMl.ListDatasets|AutoMl.ListDatasets} call. + * @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 {@link protos.google.cloud.automl.v1.Dataset|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatasets( + request?: protos.google.cloud.automl.v1.IListDatasetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IDataset[], + protos.google.cloud.automl.v1.IListDatasetsRequest | null, + protos.google.cloud.automl.v1.IListDatasetsResponse, + ] + >; + listDatasets( + request: protos.google.cloud.automl.v1.IListDatasetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1.IListDatasetsRequest, + protos.google.cloud.automl.v1.IListDatasetsResponse | null | undefined, + protos.google.cloud.automl.v1.IDataset + > + ): void; + listDatasets( + request: protos.google.cloud.automl.v1.IListDatasetsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1.IListDatasetsRequest, + protos.google.cloud.automl.v1.IListDatasetsResponse | null | undefined, + protos.google.cloud.automl.v1.IDataset + > + ): void; + listDatasets( + request?: protos.google.cloud.automl.v1.IListDatasetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.automl.v1.IListDatasetsRequest, + | protos.google.cloud.automl.v1.IListDatasetsResponse + | null + | undefined, + protos.google.cloud.automl.v1.IDataset + >, + callback?: PaginationCallback< + protos.google.cloud.automl.v1.IListDatasetsRequest, + protos.google.cloud.automl.v1.IListDatasetsResponse | null | undefined, + protos.google.cloud.automl.v1.IDataset + > + ): Promise< + [ + protos.google.cloud.automl.v1.IDataset[], + protos.google.cloud.automl.v1.IListDatasetsRequest | null, + protos.google.cloud.automl.v1.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. The resource name of the project from which to list datasets. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of using the filter are: + * + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + * @param {number} request.pageSize + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1.ListDatasetsResponse.next_page_token|ListDatasetsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1.AutoMl.ListDatasets|AutoMl.ListDatasets} call. + * @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 {@link protos.google.cloud.automl.v1.Dataset|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatasetsStream( + request?: protos.google.cloud.automl.v1.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. The resource name of the project from which to list datasets. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of using the filter are: + * + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + * @param {number} request.pageSize + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1.ListDatasetsResponse.next_page_token|ListDatasetsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1.AutoMl.ListDatasets|AutoMl.ListDatasets} call. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.automl.v1.Dataset|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.list_datasets.js + * region_tag:automl_v1_generated_AutoMl_ListDatasets_async + */ + listDatasetsAsync( + request?: protos.google.cloud.automl.v1.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 models. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the project, from which to list the models. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1.AutoMl.ListModels|AutoMl.ListModels} call. + * @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 {@link protos.google.cloud.automl.v1.Model|Model}. + * 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 `listModelsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listModels( + request?: protos.google.cloud.automl.v1.IListModelsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IModel[], + protos.google.cloud.automl.v1.IListModelsRequest | null, + protos.google.cloud.automl.v1.IListModelsResponse, + ] + >; + listModels( + request: protos.google.cloud.automl.v1.IListModelsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1.IListModelsRequest, + protos.google.cloud.automl.v1.IListModelsResponse | null | undefined, + protos.google.cloud.automl.v1.IModel + > + ): void; + listModels( + request: protos.google.cloud.automl.v1.IListModelsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1.IListModelsRequest, + protos.google.cloud.automl.v1.IListModelsResponse | null | undefined, + protos.google.cloud.automl.v1.IModel + > + ): void; + listModels( + request?: protos.google.cloud.automl.v1.IListModelsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.automl.v1.IListModelsRequest, + protos.google.cloud.automl.v1.IListModelsResponse | null | undefined, + protos.google.cloud.automl.v1.IModel + >, + callback?: PaginationCallback< + protos.google.cloud.automl.v1.IListModelsRequest, + protos.google.cloud.automl.v1.IListModelsResponse | null | undefined, + protos.google.cloud.automl.v1.IModel + > + ): Promise< + [ + protos.google.cloud.automl.v1.IModel[], + protos.google.cloud.automl.v1.IListModelsRequest | null, + protos.google.cloud.automl.v1.IListModelsResponse, + ] + > | 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.listModels(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. Resource name of the project, from which to list the models. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1.AutoMl.ListModels|AutoMl.ListModels} call. + * @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 {@link protos.google.cloud.automl.v1.Model|Model} 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 `listModelsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listModelsStream( + request?: protos.google.cloud.automl.v1.IListModelsRequest, + 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['listModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModels.createStream( + this.innerApiCalls.listModels as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listModels`, 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. Resource name of the project, from which to list the models. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1.AutoMl.ListModels|AutoMl.ListModels} call. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.automl.v1.Model|Model}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.list_models.js + * region_tag:automl_v1_generated_AutoMl_ListModels_async + */ + listModelsAsync( + request?: protos.google.cloud.automl.v1.IListModelsRequest, + 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['listModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModels.asyncIterate( + this.innerApiCalls['listModels'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists model evaluations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + * @param {string} request.filter + * Required. An expression for filtering the results of the request. + * + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * + * Some examples of using the filter are: + * + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained via + * {@link protos.google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1.AutoMl.ListModelEvaluations|AutoMl.ListModelEvaluations} call. + * @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 {@link protos.google.cloud.automl.v1.ModelEvaluation|ModelEvaluation}. + * 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 `listModelEvaluationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listModelEvaluations( + request?: protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IModelEvaluation[], + protos.google.cloud.automl.v1.IListModelEvaluationsRequest | null, + protos.google.cloud.automl.v1.IListModelEvaluationsResponse, + ] + >; + listModelEvaluations( + request: protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1.IModelEvaluation + > + ): void; + listModelEvaluations( + request: protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1.IModelEvaluation + > + ): void; + listModelEvaluations( + request?: protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1.IModelEvaluation + >, + callback?: PaginationCallback< + protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1.IModelEvaluation + > + ): Promise< + [ + protos.google.cloud.automl.v1.IModelEvaluation[], + protos.google.cloud.automl.v1.IListModelEvaluationsRequest | null, + protos.google.cloud.automl.v1.IListModelEvaluationsResponse, + ] + > | 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.listModelEvaluations(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. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + * @param {string} request.filter + * Required. An expression for filtering the results of the request. + * + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * + * Some examples of using the filter are: + * + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained via + * {@link protos.google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1.AutoMl.ListModelEvaluations|AutoMl.ListModelEvaluations} call. + * @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 {@link protos.google.cloud.automl.v1.ModelEvaluation|ModelEvaluation} 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 `listModelEvaluationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listModelEvaluationsStream( + request?: protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + 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['listModelEvaluations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelEvaluations.createStream( + this.innerApiCalls.listModelEvaluations as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listModelEvaluations`, 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. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + * @param {string} request.filter + * Required. An expression for filtering the results of the request. + * + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * + * Some examples of using the filter are: + * + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained via + * {@link protos.google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1.AutoMl.ListModelEvaluations|AutoMl.ListModelEvaluations} call. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.automl.v1.ModelEvaluation|ModelEvaluation}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.list_model_evaluations.js + * region_tag:automl_v1_generated_AutoMl_ListModelEvaluations_async + */ + listModelEvaluationsAsync( + request?: protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + 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['listModelEvaluations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelEvaluations.asyncIterate( + this.innerApiCalls['listModelEvaluations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath( + project: string, + location: string, + dataset: string, + annotationSpec: string + ) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).annotation_spec; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project: string, location: string, dataset: string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + 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 location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * 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 location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project: string, location: string, model: string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} model_evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath( + project: string, + location: string, + model: string, + modelEvaluation: string + ) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + model_evaluation: modelEvaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model; + } + + /** + * Parse the model_evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model_evaluation. + */ + matchModelEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model_evaluation; + } + + /** + * 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.autoMlStub && !this._terminated) { + return this.autoMlStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-automl/src/v1/auto_ml_client_config.json b/packages/google-cloud-automl/src/v1/auto_ml_client_config.json new file mode 100644 index 00000000000..3ad4956b39f --- /dev/null +++ b/packages/google-cloud-automl/src/v1/auto_ml_client_config.json @@ -0,0 +1,116 @@ +{ + "interfaces": { + "google.cloud.automl.v1.AutoMl": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateDataset": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDataset": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListDatasets": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateDataset": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDataset": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ImportData": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportData": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAnnotationSpec": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetModel": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListModels": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteModel": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeployModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UndeployModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetModelEvaluation": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListModelEvaluations": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-automl/src/v1/auto_ml_proto_list.json b/packages/google-cloud-automl/src/v1/auto_ml_proto_list.json new file mode 100644 index 00000000000..f15ad4ecded --- /dev/null +++ b/packages/google-cloud-automl/src/v1/auto_ml_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/automl/v1/annotation_payload.proto", + "../../protos/google/cloud/automl/v1/annotation_spec.proto", + "../../protos/google/cloud/automl/v1/classification.proto", + "../../protos/google/cloud/automl/v1/data_items.proto", + "../../protos/google/cloud/automl/v1/dataset.proto", + "../../protos/google/cloud/automl/v1/detection.proto", + "../../protos/google/cloud/automl/v1/geometry.proto", + "../../protos/google/cloud/automl/v1/image.proto", + "../../protos/google/cloud/automl/v1/io.proto", + "../../protos/google/cloud/automl/v1/model.proto", + "../../protos/google/cloud/automl/v1/model_evaluation.proto", + "../../protos/google/cloud/automl/v1/operations.proto", + "../../protos/google/cloud/automl/v1/prediction_service.proto", + "../../protos/google/cloud/automl/v1/service.proto", + "../../protos/google/cloud/automl/v1/text.proto", + "../../protos/google/cloud/automl/v1/text_extraction.proto", + "../../protos/google/cloud/automl/v1/text_segment.proto", + "../../protos/google/cloud/automl/v1/text_sentiment.proto", + "../../protos/google/cloud/automl/v1/translation.proto" +] diff --git a/packages/google-cloud-automl/src/v1/gapic_metadata.json b/packages/google-cloud-automl/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..dc46712ae9b --- /dev/null +++ b/packages/google-cloud-automl/src/v1/gapic_metadata.json @@ -0,0 +1,249 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.automl.v1", + "libraryPackage": "@google-cloud/automl", + "services": { + "AutoMl": { + "clients": { + "grpc": { + "libraryClient": "AutoMlClient", + "rpcs": { + "GetDataset": { + "methods": [ + "getDataset" + ] + }, + "UpdateDataset": { + "methods": [ + "updateDataset" + ] + }, + "GetAnnotationSpec": { + "methods": [ + "getAnnotationSpec" + ] + }, + "GetModel": { + "methods": [ + "getModel" + ] + }, + "UpdateModel": { + "methods": [ + "updateModel" + ] + }, + "GetModelEvaluation": { + "methods": [ + "getModelEvaluation" + ] + }, + "CreateDataset": { + "methods": [ + "createDataset" + ] + }, + "DeleteDataset": { + "methods": [ + "deleteDataset" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "CreateModel": { + "methods": [ + "createModel" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "DeployModel": { + "methods": [ + "deployModel" + ] + }, + "UndeployModel": { + "methods": [ + "undeployModel" + ] + }, + "ExportModel": { + "methods": [ + "exportModel" + ] + }, + "ListDatasets": { + "methods": [ + "listDatasets", + "listDatasetsStream", + "listDatasetsAsync" + ] + }, + "ListModels": { + "methods": [ + "listModels", + "listModelsStream", + "listModelsAsync" + ] + }, + "ListModelEvaluations": { + "methods": [ + "listModelEvaluations", + "listModelEvaluationsStream", + "listModelEvaluationsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AutoMlClient", + "rpcs": { + "GetDataset": { + "methods": [ + "getDataset" + ] + }, + "UpdateDataset": { + "methods": [ + "updateDataset" + ] + }, + "GetAnnotationSpec": { + "methods": [ + "getAnnotationSpec" + ] + }, + "GetModel": { + "methods": [ + "getModel" + ] + }, + "UpdateModel": { + "methods": [ + "updateModel" + ] + }, + "GetModelEvaluation": { + "methods": [ + "getModelEvaluation" + ] + }, + "CreateDataset": { + "methods": [ + "createDataset" + ] + }, + "DeleteDataset": { + "methods": [ + "deleteDataset" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "CreateModel": { + "methods": [ + "createModel" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "DeployModel": { + "methods": [ + "deployModel" + ] + }, + "UndeployModel": { + "methods": [ + "undeployModel" + ] + }, + "ExportModel": { + "methods": [ + "exportModel" + ] + }, + "ListDatasets": { + "methods": [ + "listDatasets", + "listDatasetsStream", + "listDatasetsAsync" + ] + }, + "ListModels": { + "methods": [ + "listModels", + "listModelsStream", + "listModelsAsync" + ] + }, + "ListModelEvaluations": { + "methods": [ + "listModelEvaluations", + "listModelEvaluationsStream", + "listModelEvaluationsAsync" + ] + } + } + } + } + }, + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionServiceClient", + "rpcs": { + "Predict": { + "methods": [ + "predict" + ] + }, + "BatchPredict": { + "methods": [ + "batchPredict" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PredictionServiceClient", + "rpcs": { + "Predict": { + "methods": [ + "predict" + ] + }, + "BatchPredict": { + "methods": [ + "batchPredict" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-automl/src/v1/index.ts b/packages/google-cloud-automl/src/v1/index.ts new file mode 100644 index 00000000000..d736d0fb81a --- /dev/null +++ b/packages/google-cloud-automl/src/v1/index.ts @@ -0,0 +1,20 @@ +// Copyright 2023 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 {AutoMlClient} from './auto_ml_client'; +export {PredictionServiceClient} from './prediction_service_client'; diff --git a/packages/google-cloud-automl/src/v1/prediction_service_client.ts b/packages/google-cloud-automl/src/v1/prediction_service_client.ts new file mode 100644 index 00000000000..88ff607ae29 --- /dev/null +++ b/packages/google-cloud-automl/src/v1/prediction_service_client.ts @@ -0,0 +1,1083 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/prediction_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './prediction_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * AutoML Prediction API. + * + * On any input that is documented to expect a string parameter in + * snake_case or dash-case, either of those cases is accepted. + * @class + * @memberof v1 + */ +export class PredictionServiceClient { + 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; + predictionServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PredictionServiceClient. + * + * @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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 PredictionServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof PredictionServiceClient; + 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); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // 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 { + 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 = { + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}' + ), + }; + + 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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/*/datasets/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/models/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/datasets/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/models/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/**}:testIamPermissions', + body: '*', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + { + selector: 'google.longrunning.Operations.WaitOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:wait', + body: '*', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const batchPredictResponse = protoFilesRoot.lookup( + '.google.cloud.automl.v1.BatchPredictResult' + ) as gax.protobuf.Type; + const batchPredictMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + batchPredict: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchPredictResponse.decode.bind(batchPredictResponse), + batchPredictMetadata.decode.bind(batchPredictMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.automl.v1.PredictionService', + 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.predictionServiceStub) { + return this.predictionServiceStub; + } + + // Put together the "service stub" for + // google.cloud.automl.v1.PredictionService. + this.predictionServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.automl.v1.PredictionService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.automl.v1.PredictionService, + 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 predictionServiceStubMethods = ['predict', 'batchPredict']; + for (const methodName of predictionServiceStubMethods) { + const callPromise = this.predictionServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.longrunning[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.predictionServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'automl.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 'automl.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 -- + // ------------------- + /** + * Perform an online prediction. The prediction result is directly + * returned in the response. + * Available for following ML scenarios, and their expected request payloads: + * + * AutoML Vision Classification + * + * * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. + * + * AutoML Vision Object Detection + * + * * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. + * + * AutoML Natural Language Classification + * + * * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in + * .PDF, .TIF or .TIFF format with size upto 2MB. + * + * AutoML Natural Language Entity Extraction + * + * * A TextSnippet up to 10,000 characters, UTF-8 NFC encoded or a document + * in .PDF, .TIF or .TIFF format with size upto 20MB. + * + * AutoML Natural Language Sentiment Analysis + * + * * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in + * .PDF, .TIF or .TIFF format with size upto 2MB. + * + * AutoML Translation + * + * * A TextSnippet up to 25,000 characters, UTF-8 encoded. + * + * AutoML Tables + * + * * A row with column values matching + * the columns of the model, up to 5MB. Not available for FORECASTING + * `prediction_type`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the model requested to serve the prediction. + * @param {google.cloud.automl.v1.ExamplePayload} request.payload + * Required. Payload to perform a prediction on. The payload must match the + * problem type that the model was trained to solve. + * @param {number[]} request.params + * Additional domain-specific parameters, any string must be up to 25000 + * characters long. + * + * AutoML Vision Classification + * + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * + * AutoML Vision Object Detection + * + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned. The default is 100. The + * number of returned bounding boxes might be limited by the server. + * + * AutoML Tables + * + * `feature_importance` + * : (boolean) Whether + * {@link protos.google.cloud.automl.v1.TablesModelColumnInfo.feature_importance|feature_importance} + * is populated in the returned list of + * {@link protos.google.cloud.automl.v1.TablesAnnotation|TablesAnnotation} + * objects. The default is false. + * @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 {@link protos.google.cloud.automl.v1.PredictResponse|PredictResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/prediction_service.predict.js + * region_tag:automl_v1_generated_PredictionService_Predict_async + */ + predict( + request?: protos.google.cloud.automl.v1.IPredictRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IPredictResponse, + protos.google.cloud.automl.v1.IPredictRequest | undefined, + {} | undefined, + ] + >; + predict( + request: protos.google.cloud.automl.v1.IPredictRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1.IPredictResponse, + protos.google.cloud.automl.v1.IPredictRequest | null | undefined, + {} | null | undefined + > + ): void; + predict( + request: protos.google.cloud.automl.v1.IPredictRequest, + callback: Callback< + protos.google.cloud.automl.v1.IPredictResponse, + protos.google.cloud.automl.v1.IPredictRequest | null | undefined, + {} | null | undefined + > + ): void; + predict( + request?: protos.google.cloud.automl.v1.IPredictRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1.IPredictResponse, + protos.google.cloud.automl.v1.IPredictRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1.IPredictResponse, + protos.google.cloud.automl.v1.IPredictRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1.IPredictResponse, + protos.google.cloud.automl.v1.IPredictRequest | 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.predict(request, options, callback); + } + + /** + * Perform a batch prediction. Unlike the online {@link protos.google.cloud.automl.v1.PredictionService.Predict|Predict}, batch + * prediction result won't be immediately available in the response. Instead, + * a long running operation object is returned. User can poll the operation + * result via {@link protos.google.longrunning.Operations.GetOperation|GetOperation} + * method. Once the operation is done, {@link protos.google.cloud.automl.v1.BatchPredictResult|BatchPredictResult} is returned in + * the {@link protos.google.longrunning.Operation.response|response} field. + * Available for following ML scenarios: + * + * * AutoML Vision Classification + * * AutoML Vision Object Detection + * * AutoML Video Intelligence Classification + * * AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification + * * AutoML Natural Language Entity Extraction + * * AutoML Natural Language Sentiment Analysis + * * AutoML Tables + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the model requested to serve the batch prediction. + * @param {google.cloud.automl.v1.BatchPredictInputConfig} request.inputConfig + * Required. The input configuration for batch prediction. + * @param {google.cloud.automl.v1.BatchPredictOutputConfig} request.outputConfig + * Required. The Configuration specifying where output predictions should + * be written. + * @param {number[]} request.params + * Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * + * AutoML Natural Language Classification + * + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * + * + * AutoML Vision Classification + * + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * + * AutoML Vision Object Detection + * + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * AutoML Video Intelligence Classification + * + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a video, it will only produce results that + * have at least this confidence score. The default is 0.5. + * + * `segment_classification` + * : (boolean) Set to true to request + * segment-level classification. AutoML Video Intelligence returns + * labels and their confidence scores for the entire segment of the + * video that user specified in the request configuration. + * The default is true. + * + * `shot_classification` + * : (boolean) Set to true to request shot-level + * classification. AutoML Video Intelligence determines the boundaries + * for each camera shot in the entire segment of the video that user + * specified in the request configuration. AutoML Video Intelligence + * then returns labels and their confidence scores for each detected + * shot, along with the start and end time of the shot. + * The default is false. + * + * WARNING: Model evaluation is not done for this classification type, + * the quality of it depends on training data, but there are no metrics + * provided to describe that quality. + * + * `1s_interval_classification` + * : (boolean) Set to true to request + * classification for a video at one-second intervals. AutoML Video + * Intelligence returns labels and their confidence scores for each + * second of the entire segment of the video that user specified in the + * request configuration. The default is false. + * + * WARNING: Model evaluation is not done for this classification + * type, the quality of it depends on training data, but there are no + * metrics provided to describe that quality. + * + * AutoML Video Intelligence Object Tracking + * + * `score_threshold` + * : (float) When Model detects objects on video frames, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * + * `min_bounding_box_size` + * : (float) Only bounding boxes with shortest edge + * at least that long as a relative value of video frame size are + * returned. Value in 0 to 1 range. Default is 0. + * + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/prediction_service.batch_predict.js + * region_tag:automl_v1_generated_PredictionService_BatchPredict_async + */ + batchPredict( + request?: protos.google.cloud.automl.v1.IBatchPredictRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + batchPredict( + request: protos.google.cloud.automl.v1.IBatchPredictRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchPredict( + request: protos.google.cloud.automl.v1.IBatchPredictRequest, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchPredict( + request?: protos.google.cloud.automl.v1.IBatchPredictRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.batchPredict(request, options, callback); + } + /** + * Check the status of the long running operation returned by `batchPredict()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/prediction_service.batch_predict.js + * region_tag:automl_v1_generated_PredictionService_BatchPredict_async + */ + async checkBatchPredictProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.automl.v1.BatchPredictResult, + protos.google.cloud.automl.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.batchPredict, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.automl.v1.BatchPredictResult, + protos.google.cloud.automl.v1.OperationMetadata + >; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath( + project: string, + location: string, + dataset: string, + annotationSpec: string + ) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).annotation_spec; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project: string, location: string, dataset: string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + 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 location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * 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 model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project: string, location: string, model: string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} model_evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath( + project: string, + location: string, + model: string, + modelEvaluation: string + ) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + model_evaluation: modelEvaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model; + } + + /** + * Parse the model_evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model_evaluation. + */ + matchModelEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model_evaluation; + } + + /** + * 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.predictionServiceStub && !this._terminated) { + return this.predictionServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-automl/src/v1/prediction_service_client_config.json b/packages/google-cloud-automl/src/v1/prediction_service_client_config.json new file mode 100644 index 00000000000..d0cf33d835c --- /dev/null +++ b/packages/google-cloud-automl/src/v1/prediction_service_client_config.json @@ -0,0 +1,36 @@ +{ + "interfaces": { + "google.cloud.automl.v1.PredictionService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "Predict": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchPredict": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-automl/src/v1/prediction_service_proto_list.json b/packages/google-cloud-automl/src/v1/prediction_service_proto_list.json new file mode 100644 index 00000000000..f15ad4ecded --- /dev/null +++ b/packages/google-cloud-automl/src/v1/prediction_service_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/automl/v1/annotation_payload.proto", + "../../protos/google/cloud/automl/v1/annotation_spec.proto", + "../../protos/google/cloud/automl/v1/classification.proto", + "../../protos/google/cloud/automl/v1/data_items.proto", + "../../protos/google/cloud/automl/v1/dataset.proto", + "../../protos/google/cloud/automl/v1/detection.proto", + "../../protos/google/cloud/automl/v1/geometry.proto", + "../../protos/google/cloud/automl/v1/image.proto", + "../../protos/google/cloud/automl/v1/io.proto", + "../../protos/google/cloud/automl/v1/model.proto", + "../../protos/google/cloud/automl/v1/model_evaluation.proto", + "../../protos/google/cloud/automl/v1/operations.proto", + "../../protos/google/cloud/automl/v1/prediction_service.proto", + "../../protos/google/cloud/automl/v1/service.proto", + "../../protos/google/cloud/automl/v1/text.proto", + "../../protos/google/cloud/automl/v1/text_extraction.proto", + "../../protos/google/cloud/automl/v1/text_segment.proto", + "../../protos/google/cloud/automl/v1/text_sentiment.proto", + "../../protos/google/cloud/automl/v1/translation.proto" +] diff --git a/packages/google-cloud-automl/src/v1beta1/auto_ml_client.ts b/packages/google-cloud-automl/src/v1beta1/auto_ml_client.ts new file mode 100644 index 00000000000..99c19bcd874 --- /dev/null +++ b/packages/google-cloud-automl/src/v1beta1/auto_ml_client.ts @@ -0,0 +1,4354 @@ +// Copyright 2023 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/auto_ml_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './auto_ml_client_config.json'; +const version = require('../../../package.json').version; + +/** + * AutoML Server API. + * + * The resource names are assigned by the server. + * The server never reuses names that it has created after the resources with + * those names are deleted. + * + * An ID of a resource is the last element of the item's resource name. For + * `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then + * the id for the item is `{dataset_id}`. + * + * Currently the only supported `location_id` is "us-central1". + * + * On any input that is documented to expect a string parameter in + * snake_case or kebab-case, either of those cases is accepted. + * @class + * @memberof v1beta1 + */ +export class AutoMlClient { + 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; + autoMlStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AutoMlClient. + * + * @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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 AutoMlClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AutoMlClient; + 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); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // 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 { + 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 = { + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + columnSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}/columnSpecs/{column_spec}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}' + ), + tableSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}' + ), + }; + + // 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' + ), + listTableSpecs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'tableSpecs' + ), + listColumnSpecs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'columnSpecs' + ), + listModels: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'model' + ), + listModelEvaluations: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'modelEvaluation' + ), + }; + + 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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1beta1/{resource=projects/*/locations/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1beta1/{resource=projects/*/locations/*/datasets/*}:getIamPolicy', + }, + { + get: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1beta1/{resource=projects/*/locations/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1beta1/{resource=projects/*/locations/*/datasets/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1beta1/{resource=projects/*/locations/*/**}:testIamPermissions', + body: '*', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1beta1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1beta1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1beta1/{name=projects/*/locations/*}/operations', + }, + { + selector: 'google.longrunning.Operations.WaitOperation', + post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait', + body: '*', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const deleteDatasetResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteDatasetMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + const importDataResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const importDataMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + const exportDataResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const exportDataMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + const createModelResponse = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.Model' + ) as gax.protobuf.Type; + const createModelMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteModelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteModelMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + const deployModelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deployModelMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + const undeployModelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const undeployModelMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + const exportModelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const exportModelMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + const exportEvaluatedExamplesResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const exportEvaluatedExamplesMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + deleteDataset: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteDatasetResponse.decode.bind(deleteDatasetResponse), + deleteDatasetMetadata.decode.bind(deleteDatasetMetadata) + ), + 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) + ), + createModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createModelResponse.decode.bind(createModelResponse), + createModelMetadata.decode.bind(createModelMetadata) + ), + deleteModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteModelResponse.decode.bind(deleteModelResponse), + deleteModelMetadata.decode.bind(deleteModelMetadata) + ), + deployModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deployModelResponse.decode.bind(deployModelResponse), + deployModelMetadata.decode.bind(deployModelMetadata) + ), + undeployModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeployModelResponse.decode.bind(undeployModelResponse), + undeployModelMetadata.decode.bind(undeployModelMetadata) + ), + exportModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportModelResponse.decode.bind(exportModelResponse), + exportModelMetadata.decode.bind(exportModelMetadata) + ), + exportEvaluatedExamples: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportEvaluatedExamplesResponse.decode.bind( + exportEvaluatedExamplesResponse + ), + exportEvaluatedExamplesMetadata.decode.bind( + exportEvaluatedExamplesMetadata + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.automl.v1beta1.AutoMl', + 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.autoMlStub) { + return this.autoMlStub; + } + + // Put together the "service stub" for + // google.cloud.automl.v1beta1.AutoMl. + this.autoMlStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.automl.v1beta1.AutoMl' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.automl.v1beta1.AutoMl, + 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 autoMlStubMethods = [ + 'createDataset', + 'getDataset', + 'listDatasets', + 'updateDataset', + 'deleteDataset', + 'importData', + 'exportData', + 'getAnnotationSpec', + 'getTableSpec', + 'listTableSpecs', + 'updateTableSpec', + 'getColumnSpec', + 'listColumnSpecs', + 'updateColumnSpec', + 'createModel', + 'getModel', + 'listModels', + 'deleteModel', + 'deployModel', + 'undeployModel', + 'exportModel', + 'exportEvaluatedExamples', + 'getModelEvaluation', + 'listModelEvaluations', + ]; + for (const methodName of autoMlStubMethods) { + const callPromise = this.autoMlStub.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.autoMlStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'automl.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 'automl.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Creates a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the project to create the dataset for. + * @param {google.cloud.automl.v1beta1.Dataset} request.dataset + * Required. The dataset 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 {@link protos.google.cloud.automl.v1beta1.Dataset|Dataset}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.create_dataset.js + * region_tag:automl_v1beta1_generated_AutoMl_CreateDataset_async + */ + createDataset( + request?: protos.google.cloud.automl.v1beta1.ICreateDatasetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.v1beta1.ICreateDatasetRequest | undefined, + {} | undefined, + ] + >; + createDataset( + request: protos.google.cloud.automl.v1beta1.ICreateDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.ICreateDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createDataset( + request: protos.google.cloud.automl.v1beta1.ICreateDatasetRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.ICreateDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createDataset( + request?: protos.google.cloud.automl.v1beta1.ICreateDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.ICreateDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.ICreateDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.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 a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the dataset to retrieve. + * @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 {@link protos.google.cloud.automl.v1beta1.Dataset|Dataset}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.get_dataset.js + * region_tag:automl_v1beta1_generated_AutoMl_GetDataset_async + */ + getDataset( + request?: protos.google.cloud.automl.v1beta1.IGetDatasetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.v1beta1.IGetDatasetRequest | undefined, + {} | undefined, + ] + >; + getDataset( + request: protos.google.cloud.automl.v1beta1.IGetDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.v1beta1.IGetDatasetRequest | null | undefined, + {} | null | undefined + > + ): void; + getDataset( + request: protos.google.cloud.automl.v1beta1.IGetDatasetRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.v1beta1.IGetDatasetRequest | null | undefined, + {} | null | undefined + > + ): void; + getDataset( + request?: protos.google.cloud.automl.v1beta1.IGetDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.IGetDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.v1beta1.IGetDatasetRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.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); + } + /** + * Updates a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1beta1.Dataset} request.dataset + * Required. The dataset which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * The update mask applies to the resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.automl.v1beta1.Dataset|Dataset}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.update_dataset.js + * region_tag:automl_v1beta1_generated_AutoMl_UpdateDataset_async + */ + updateDataset( + request?: protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest | undefined, + {} | undefined, + ] + >; + updateDataset( + request: protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateDataset( + request: protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateDataset( + request?: protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest | 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({ + 'dataset.name': request.dataset!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateDataset(request, options, callback); + } + /** + * Gets an annotation spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the annotation spec to retrieve. + * @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 {@link protos.google.cloud.automl.v1beta1.AnnotationSpec|AnnotationSpec}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.get_annotation_spec.js + * region_tag:automl_v1beta1_generated_AutoMl_GetAnnotationSpec_async + */ + getAnnotationSpec( + request?: protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IAnnotationSpec, + protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest | undefined, + {} | undefined, + ] + >; + getAnnotationSpec( + request: protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.IAnnotationSpec, + | protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAnnotationSpec( + request: protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.IAnnotationSpec, + | protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAnnotationSpec( + request?: protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.IAnnotationSpec, + | protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.IAnnotationSpec, + | protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IAnnotationSpec, + protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest | 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.getAnnotationSpec(request, options, callback); + } + /** + * Gets a table spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the table spec to retrieve. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields to read. + * @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 {@link protos.google.cloud.automl.v1beta1.TableSpec|TableSpec}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.get_table_spec.js + * region_tag:automl_v1beta1_generated_AutoMl_GetTableSpec_async + */ + getTableSpec( + request?: protos.google.cloud.automl.v1beta1.IGetTableSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.ITableSpec, + protos.google.cloud.automl.v1beta1.IGetTableSpecRequest | undefined, + {} | undefined, + ] + >; + getTableSpec( + request: protos.google.cloud.automl.v1beta1.IGetTableSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.ITableSpec, + | protos.google.cloud.automl.v1beta1.IGetTableSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTableSpec( + request: protos.google.cloud.automl.v1beta1.IGetTableSpecRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.ITableSpec, + | protos.google.cloud.automl.v1beta1.IGetTableSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTableSpec( + request?: protos.google.cloud.automl.v1beta1.IGetTableSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.ITableSpec, + | protos.google.cloud.automl.v1beta1.IGetTableSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.ITableSpec, + | protos.google.cloud.automl.v1beta1.IGetTableSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.ITableSpec, + protos.google.cloud.automl.v1beta1.IGetTableSpecRequest | 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.getTableSpec(request, options, callback); + } + /** + * Updates a table spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1beta1.TableSpec} request.tableSpec + * Required. The table spec which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * The update mask applies to the resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.automl.v1beta1.TableSpec|TableSpec}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.update_table_spec.js + * region_tag:automl_v1beta1_generated_AutoMl_UpdateTableSpec_async + */ + updateTableSpec( + request?: protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.ITableSpec, + protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest | undefined, + {} | undefined, + ] + >; + updateTableSpec( + request: protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.ITableSpec, + | protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateTableSpec( + request: protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.ITableSpec, + | protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateTableSpec( + request?: protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.ITableSpec, + | protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.ITableSpec, + | protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.ITableSpec, + protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest | 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({ + 'table_spec.name': request.tableSpec!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateTableSpec(request, options, callback); + } + /** + * Gets a column spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the column spec to retrieve. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields to read. + * @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 {@link protos.google.cloud.automl.v1beta1.ColumnSpec|ColumnSpec}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.get_column_spec.js + * region_tag:automl_v1beta1_generated_AutoMl_GetColumnSpec_async + */ + getColumnSpec( + request?: protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IColumnSpec, + protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest | undefined, + {} | undefined, + ] + >; + getColumnSpec( + request: protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.IColumnSpec, + | protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getColumnSpec( + request: protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.IColumnSpec, + | protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getColumnSpec( + request?: protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.IColumnSpec, + | protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.IColumnSpec, + | protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IColumnSpec, + protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest | 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.getColumnSpec(request, options, callback); + } + /** + * Updates a column spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1beta1.ColumnSpec} request.columnSpec + * Required. The column spec which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * The update mask applies to the resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.automl.v1beta1.ColumnSpec|ColumnSpec}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.update_column_spec.js + * region_tag:automl_v1beta1_generated_AutoMl_UpdateColumnSpec_async + */ + updateColumnSpec( + request?: protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IColumnSpec, + protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest | undefined, + {} | undefined, + ] + >; + updateColumnSpec( + request: protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.IColumnSpec, + | protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateColumnSpec( + request: protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.IColumnSpec, + | protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateColumnSpec( + request?: protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.IColumnSpec, + | protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.IColumnSpec, + | protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IColumnSpec, + protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest | 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({ + 'column_spec.name': request.columnSpec!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateColumnSpec(request, options, callback); + } + /** + * Gets a model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the model. + * @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 {@link protos.google.cloud.automl.v1beta1.Model|Model}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.get_model.js + * region_tag:automl_v1beta1_generated_AutoMl_GetModel_async + */ + getModel( + request?: protos.google.cloud.automl.v1beta1.IGetModelRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IGetModelRequest | undefined, + {} | undefined, + ] + >; + getModel( + request: protos.google.cloud.automl.v1beta1.IGetModelRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IGetModelRequest | null | undefined, + {} | null | undefined + > + ): void; + getModel( + request: protos.google.cloud.automl.v1beta1.IGetModelRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IGetModelRequest | null | undefined, + {} | null | undefined + > + ): void; + getModel( + request?: protos.google.cloud.automl.v1beta1.IGetModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.IModel, + | protos.google.cloud.automl.v1beta1.IGetModelRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IGetModelRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IGetModelRequest | 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.getModel(request, options, callback); + } + /** + * Gets a model evaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name for the model evaluation. + * @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 {@link protos.google.cloud.automl.v1beta1.ModelEvaluation|ModelEvaluation}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.get_model_evaluation.js + * region_tag:automl_v1beta1_generated_AutoMl_GetModelEvaluation_async + */ + getModelEvaluation( + request?: protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IModelEvaluation, + protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest | undefined, + {} | undefined, + ] + >; + getModelEvaluation( + request: protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.IModelEvaluation, + | protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getModelEvaluation( + request: protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.IModelEvaluation, + | protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getModelEvaluation( + request?: protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.IModelEvaluation, + | protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.IModelEvaluation, + | protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IModelEvaluation, + protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest | 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.getModelEvaluation(request, options, callback); + } + + /** + * Deletes a dataset and all of its contents. + * Returns empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes, + * and `delete_details` in the + * {@link protos.google.longrunning.Operation.metadata|metadata} field. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the dataset to delete. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.delete_dataset.js + * region_tag:automl_v1beta1_generated_AutoMl_DeleteDataset_async + */ + deleteDataset( + request?: protos.google.cloud.automl.v1beta1.IDeleteDatasetRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteDataset( + request: protos.google.cloud.automl.v1beta1.IDeleteDatasetRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteDataset( + request: protos.google.cloud.automl.v1beta1.IDeleteDatasetRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteDataset( + request?: protos.google.cloud.automl.v1beta1.IDeleteDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteDataset(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteDataset()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.delete_dataset.js + * region_tag:automl_v1beta1_generated_AutoMl_DeleteDataset_async + */ + async checkDeleteDatasetProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteDataset, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + >; + } + /** + * Imports data into a dataset. + * For Tables this method can only be called on an empty Dataset. + * + * For Tables: + * * A + * {@link protos.google.cloud.automl.v1beta1.InputConfig.params|schema_inference_version} + * parameter must be explicitly set. + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Dataset name. Dataset must already exist. All imported + * annotations and examples will be added. + * @param {google.cloud.automl.v1beta1.InputConfig} request.inputConfig + * Required. The desired input location and its domain specific semantics, + * if any. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.import_data.js + * region_tag:automl_v1beta1_generated_AutoMl_ImportData_async + */ + importData( + request?: protos.google.cloud.automl.v1beta1.IImportDataRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + importData( + request: protos.google.cloud.automl.v1beta1.IImportDataRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importData( + request: protos.google.cloud.automl.v1beta1.IImportDataRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importData( + request?: protos.google.cloud.automl.v1beta1.IImportDataRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.import_data.js + * region_tag:automl_v1beta1_generated_AutoMl_ImportData_async + */ + async checkImportDataProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.importData, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + >; + } + /** + * Exports dataset's data to the provided output location. + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the dataset. + * @param {google.cloud.automl.v1beta1.OutputConfig} request.outputConfig + * Required. The desired output location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.export_data.js + * region_tag:automl_v1beta1_generated_AutoMl_ExportData_async + */ + exportData( + request?: protos.google.cloud.automl.v1beta1.IExportDataRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportData( + request: protos.google.cloud.automl.v1beta1.IExportDataRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportData( + request: protos.google.cloud.automl.v1beta1.IExportDataRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportData( + request?: protos.google.cloud.automl.v1beta1.IExportDataRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.export_data.js + * region_tag:automl_v1beta1_generated_AutoMl_ExportData_async + */ + async checkExportDataProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.exportData, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + >; + } + /** + * Creates a model. + * Returns a Model in the {@link protos.google.longrunning.Operation.response|response} + * field when it completes. + * When you create a model, several model evaluations are created for it: + * a global evaluation, and one evaluation for each annotation spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent project where the model is being created. + * @param {google.cloud.automl.v1beta1.Model} request.model + * Required. The model 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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.create_model.js + * region_tag:automl_v1beta1_generated_AutoMl_CreateModel_async + */ + createModel( + request?: protos.google.cloud.automl.v1beta1.ICreateModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createModel( + request: protos.google.cloud.automl.v1beta1.ICreateModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createModel( + request: protos.google.cloud.automl.v1beta1.ICreateModelRequest, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createModel( + request?: protos.google.cloud.automl.v1beta1.ICreateModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createModel()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.create_model.js + * region_tag:automl_v1beta1_generated_AutoMl_CreateModel_async + */ + async checkCreateModelProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.automl.v1beta1.Model, + protos.google.cloud.automl.v1beta1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.automl.v1beta1.Model, + protos.google.cloud.automl.v1beta1.OperationMetadata + >; + } + /** + * Deletes a model. + * Returns `google.protobuf.Empty` in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes, + * and `delete_details` in the + * {@link protos.google.longrunning.Operation.metadata|metadata} field. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the model being deleted. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.delete_model.js + * region_tag:automl_v1beta1_generated_AutoMl_DeleteModel_async + */ + deleteModel( + request?: protos.google.cloud.automl.v1beta1.IDeleteModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteModel( + request: protos.google.cloud.automl.v1beta1.IDeleteModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteModel( + request: protos.google.cloud.automl.v1beta1.IDeleteModelRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteModel( + request?: protos.google.cloud.automl.v1beta1.IDeleteModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteModel()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.delete_model.js + * region_tag:automl_v1beta1_generated_AutoMl_DeleteModel_async + */ + async checkDeleteModelProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + >; + } + /** + * Deploys a model. If a model is already deployed, deploying it with the + * same parameters has no effect. Deploying with different parametrs + * (as e.g. changing + * + * {@link protos.google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number|node_number}) + * will reset the deployment state without pausing the model's availability. + * + * Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage + * deployment automatically. + * + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata} request.imageObjectDetectionModelDeploymentMetadata + * Model deployment metadata specific to Image Object Detection. + * @param {google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata} request.imageClassificationModelDeploymentMetadata + * Model deployment metadata specific to Image Classification. + * @param {string} request.name + * Required. Resource name of the model to deploy. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.deploy_model.js + * region_tag:automl_v1beta1_generated_AutoMl_DeployModel_async + */ + deployModel( + request?: protos.google.cloud.automl.v1beta1.IDeployModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deployModel( + request: protos.google.cloud.automl.v1beta1.IDeployModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deployModel( + request: protos.google.cloud.automl.v1beta1.IDeployModelRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deployModel( + request?: protos.google.cloud.automl.v1beta1.IDeployModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deployModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deployModel()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.deploy_model.js + * region_tag:automl_v1beta1_generated_AutoMl_DeployModel_async + */ + async checkDeployModelProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deployModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + >; + } + /** + * Undeploys a model. If the model is not deployed this method has no effect. + * + * Only applicable for Text Classification, Image Object Detection and Tables; + * all other domains manage deployment automatically. + * + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the model to undeploy. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.undeploy_model.js + * region_tag:automl_v1beta1_generated_AutoMl_UndeployModel_async + */ + undeployModel( + request?: protos.google.cloud.automl.v1beta1.IUndeployModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + undeployModel( + request: protos.google.cloud.automl.v1beta1.IUndeployModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + undeployModel( + request: protos.google.cloud.automl.v1beta1.IUndeployModelRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + undeployModel( + request?: protos.google.cloud.automl.v1beta1.IUndeployModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.undeployModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `undeployModel()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.undeploy_model.js + * region_tag:automl_v1beta1_generated_AutoMl_UndeployModel_async + */ + async checkUndeployModelProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.undeployModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + >; + } + /** + * Exports a trained, "export-able", model to a user specified Google Cloud + * Storage location. A model is considered export-able if and only if it has + * an export format defined for it in + * + * {@link protos.google.cloud.automl.v1beta1.ModelExportOutputConfig|ModelExportOutputConfig}. + * + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the model to export. + * @param {google.cloud.automl.v1beta1.ModelExportOutputConfig} request.outputConfig + * Required. The desired output location and configuration. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.export_model.js + * region_tag:automl_v1beta1_generated_AutoMl_ExportModel_async + */ + exportModel( + request?: protos.google.cloud.automl.v1beta1.IExportModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportModel( + request: protos.google.cloud.automl.v1beta1.IExportModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportModel( + request: protos.google.cloud.automl.v1beta1.IExportModelRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportModel( + request?: protos.google.cloud.automl.v1beta1.IExportModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.exportModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `exportModel()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.export_model.js + * region_tag:automl_v1beta1_generated_AutoMl_ExportModel_async + */ + async checkExportModelProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.exportModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + >; + } + /** + * Exports examples on which the model was evaluated (i.e. which were in the + * TEST set of the dataset the model was created from), together with their + * ground truth annotations and the annotations created (predicted) by the + * model. + * The examples, ground truth and predictions are exported in the state + * they were at the moment the model was evaluated. + * + * This export is available only for 30 days since the model evaluation is + * created. + * + * Currently only available for Tables. + * + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the model whose evaluated examples are to + * be exported. + * @param {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig} request.outputConfig + * Required. The desired output location and configuration. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.export_evaluated_examples.js + * region_tag:automl_v1beta1_generated_AutoMl_ExportEvaluatedExamples_async + */ + exportEvaluatedExamples( + request?: protos.google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportEvaluatedExamples( + request: protos.google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportEvaluatedExamples( + request: protos.google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportEvaluatedExamples( + request?: protos.google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.exportEvaluatedExamples( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `exportEvaluatedExamples()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.export_evaluated_examples.js + * region_tag:automl_v1beta1_generated_AutoMl_ExportEvaluatedExamples_async + */ + async checkExportEvaluatedExamplesProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.exportEvaluatedExamples, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + >; + } + /** + * Lists datasets in a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the project from which to list datasets. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of + * using the filter are: + * + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + * @param {number} request.pageSize + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1beta1.ListDatasetsResponse.next_page_token|ListDatasetsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListDatasets|AutoMl.ListDatasets} call. + * @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 {@link protos.google.cloud.automl.v1beta1.Dataset|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatasets( + request?: protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IDataset[], + protos.google.cloud.automl.v1beta1.IListDatasetsRequest | null, + protos.google.cloud.automl.v1beta1.IListDatasetsResponse, + ] + >; + listDatasets( + request: protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + | protos.google.cloud.automl.v1beta1.IListDatasetsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IDataset + > + ): void; + listDatasets( + request: protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + | protos.google.cloud.automl.v1beta1.IListDatasetsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IDataset + > + ): void; + listDatasets( + request?: protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + | protos.google.cloud.automl.v1beta1.IListDatasetsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IDataset + >, + callback?: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + | protos.google.cloud.automl.v1beta1.IListDatasetsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IDataset + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IDataset[], + protos.google.cloud.automl.v1beta1.IListDatasetsRequest | null, + protos.google.cloud.automl.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. The resource name of the project from which to list datasets. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of + * using the filter are: + * + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + * @param {number} request.pageSize + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1beta1.ListDatasetsResponse.next_page_token|ListDatasetsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListDatasets|AutoMl.ListDatasets} call. + * @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 {@link protos.google.cloud.automl.v1beta1.Dataset|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatasetsStream( + request?: protos.google.cloud.automl.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. The resource name of the project from which to list datasets. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of + * using the filter are: + * + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + * @param {number} request.pageSize + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1beta1.ListDatasetsResponse.next_page_token|ListDatasetsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListDatasets|AutoMl.ListDatasets} call. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.automl.v1beta1.Dataset|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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.list_datasets.js + * region_tag:automl_v1beta1_generated_AutoMl_ListDatasets_async + */ + listDatasetsAsync( + request?: protos.google.cloud.automl.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 table specs in a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the dataset to list table specs from. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields to read. + * @param {string} request.filter + * Filter expression, see go/filtering. + * @param {number} request.pageSize + * Requested page size. The server can return fewer results than requested. + * If unspecified, the server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained from the + * {@link protos.google.cloud.automl.v1beta1.ListTableSpecsResponse.next_page_token|ListTableSpecsResponse.next_page_token} field of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListTableSpecs|AutoMl.ListTableSpecs} call. + * @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 {@link protos.google.cloud.automl.v1beta1.TableSpec|TableSpec}. + * 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 `listTableSpecsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTableSpecs( + request?: protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.ITableSpec[], + protos.google.cloud.automl.v1beta1.IListTableSpecsRequest | null, + protos.google.cloud.automl.v1beta1.IListTableSpecsResponse, + ] + >; + listTableSpecs( + request: protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListTableSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.ITableSpec + > + ): void; + listTableSpecs( + request: protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListTableSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.ITableSpec + > + ): void; + listTableSpecs( + request?: protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListTableSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.ITableSpec + >, + callback?: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListTableSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.ITableSpec + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.ITableSpec[], + protos.google.cloud.automl.v1beta1.IListTableSpecsRequest | null, + protos.google.cloud.automl.v1beta1.IListTableSpecsResponse, + ] + > | 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.listTableSpecs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the dataset to list table specs from. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields to read. + * @param {string} request.filter + * Filter expression, see go/filtering. + * @param {number} request.pageSize + * Requested page size. The server can return fewer results than requested. + * If unspecified, the server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained from the + * {@link protos.google.cloud.automl.v1beta1.ListTableSpecsResponse.next_page_token|ListTableSpecsResponse.next_page_token} field of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListTableSpecs|AutoMl.ListTableSpecs} call. + * @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 {@link protos.google.cloud.automl.v1beta1.TableSpec|TableSpec} 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 `listTableSpecsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTableSpecsStream( + request?: protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + 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['listTableSpecs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTableSpecs.createStream( + this.innerApiCalls.listTableSpecs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTableSpecs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the dataset to list table specs from. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields to read. + * @param {string} request.filter + * Filter expression, see go/filtering. + * @param {number} request.pageSize + * Requested page size. The server can return fewer results than requested. + * If unspecified, the server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained from the + * {@link protos.google.cloud.automl.v1beta1.ListTableSpecsResponse.next_page_token|ListTableSpecsResponse.next_page_token} field of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListTableSpecs|AutoMl.ListTableSpecs} call. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.automl.v1beta1.TableSpec|TableSpec}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.list_table_specs.js + * region_tag:automl_v1beta1_generated_AutoMl_ListTableSpecs_async + */ + listTableSpecsAsync( + request?: protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + 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['listTableSpecs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTableSpecs.asyncIterate( + this.innerApiCalls['listTableSpecs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists column specs in a table spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the table spec to list column specs from. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields to read. + * @param {string} request.filter + * Filter expression, see go/filtering. + * @param {number} request.pageSize + * Requested page size. The server can return fewer results than requested. + * If unspecified, the server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained from the + * {@link protos.google.cloud.automl.v1beta1.ListColumnSpecsResponse.next_page_token|ListColumnSpecsResponse.next_page_token} field of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs|AutoMl.ListColumnSpecs} call. + * @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 {@link protos.google.cloud.automl.v1beta1.ColumnSpec|ColumnSpec}. + * 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 `listColumnSpecsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listColumnSpecs( + request?: protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IColumnSpec[], + protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest | null, + protos.google.cloud.automl.v1beta1.IListColumnSpecsResponse, + ] + >; + listColumnSpecs( + request: protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListColumnSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IColumnSpec + > + ): void; + listColumnSpecs( + request: protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListColumnSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IColumnSpec + > + ): void; + listColumnSpecs( + request?: protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListColumnSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IColumnSpec + >, + callback?: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListColumnSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IColumnSpec + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IColumnSpec[], + protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest | null, + protos.google.cloud.automl.v1beta1.IListColumnSpecsResponse, + ] + > | 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.listColumnSpecs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the table spec to list column specs from. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields to read. + * @param {string} request.filter + * Filter expression, see go/filtering. + * @param {number} request.pageSize + * Requested page size. The server can return fewer results than requested. + * If unspecified, the server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained from the + * {@link protos.google.cloud.automl.v1beta1.ListColumnSpecsResponse.next_page_token|ListColumnSpecsResponse.next_page_token} field of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs|AutoMl.ListColumnSpecs} call. + * @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 {@link protos.google.cloud.automl.v1beta1.ColumnSpec|ColumnSpec} 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 `listColumnSpecsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listColumnSpecsStream( + request?: protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + 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['listColumnSpecs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listColumnSpecs.createStream( + this.innerApiCalls.listColumnSpecs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listColumnSpecs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the table spec to list column specs from. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields to read. + * @param {string} request.filter + * Filter expression, see go/filtering. + * @param {number} request.pageSize + * Requested page size. The server can return fewer results than requested. + * If unspecified, the server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained from the + * {@link protos.google.cloud.automl.v1beta1.ListColumnSpecsResponse.next_page_token|ListColumnSpecsResponse.next_page_token} field of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs|AutoMl.ListColumnSpecs} call. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.automl.v1beta1.ColumnSpec|ColumnSpec}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.list_column_specs.js + * region_tag:automl_v1beta1_generated_AutoMl_ListColumnSpecs_async + */ + listColumnSpecsAsync( + request?: protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + 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['listColumnSpecs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listColumnSpecs.asyncIterate( + this.innerApiCalls['listColumnSpecs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists models. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the project, from which to list the models. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1beta1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListModels|AutoMl.ListModels} call. + * @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 {@link protos.google.cloud.automl.v1beta1.Model|Model}. + * 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 `listModelsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listModels( + request?: protos.google.cloud.automl.v1beta1.IListModelsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IModel[], + protos.google.cloud.automl.v1beta1.IListModelsRequest | null, + protos.google.cloud.automl.v1beta1.IListModelsResponse, + ] + >; + listModels( + request: protos.google.cloud.automl.v1beta1.IListModelsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelsRequest, + protos.google.cloud.automl.v1beta1.IListModelsResponse | null | undefined, + protos.google.cloud.automl.v1beta1.IModel + > + ): void; + listModels( + request: protos.google.cloud.automl.v1beta1.IListModelsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelsRequest, + protos.google.cloud.automl.v1beta1.IListModelsResponse | null | undefined, + protos.google.cloud.automl.v1beta1.IModel + > + ): void; + listModels( + request?: protos.google.cloud.automl.v1beta1.IListModelsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelsRequest, + | protos.google.cloud.automl.v1beta1.IListModelsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IModel + >, + callback?: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelsRequest, + protos.google.cloud.automl.v1beta1.IListModelsResponse | null | undefined, + protos.google.cloud.automl.v1beta1.IModel + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IModel[], + protos.google.cloud.automl.v1beta1.IListModelsRequest | null, + protos.google.cloud.automl.v1beta1.IListModelsResponse, + ] + > | 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.listModels(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. Resource name of the project, from which to list the models. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1beta1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListModels|AutoMl.ListModels} call. + * @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 {@link protos.google.cloud.automl.v1beta1.Model|Model} 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 `listModelsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listModelsStream( + request?: protos.google.cloud.automl.v1beta1.IListModelsRequest, + 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['listModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModels.createStream( + this.innerApiCalls.listModels as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listModels`, 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. Resource name of the project, from which to list the models. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1beta1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListModels|AutoMl.ListModels} call. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.automl.v1beta1.Model|Model}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.list_models.js + * region_tag:automl_v1beta1_generated_AutoMl_ListModels_async + */ + listModelsAsync( + request?: protos.google.cloud.automl.v1beta1.IListModelsRequest, + 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['listModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModels.asyncIterate( + this.innerApiCalls['listModels'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists model evaluations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * + * Some examples of using the filter are: + * + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained via + * {@link protos.google.cloud.automl.v1beta1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations|AutoMl.ListModelEvaluations} call. + * @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 {@link protos.google.cloud.automl.v1beta1.ModelEvaluation|ModelEvaluation}. + * 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 `listModelEvaluationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listModelEvaluations( + request?: protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IModelEvaluation[], + protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest | null, + protos.google.cloud.automl.v1beta1.IListModelEvaluationsResponse, + ] + >; + listModelEvaluations( + request: protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1beta1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IModelEvaluation + > + ): void; + listModelEvaluations( + request: protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1beta1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IModelEvaluation + > + ): void; + listModelEvaluations( + request?: protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1beta1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IModelEvaluation + >, + callback?: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1beta1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IModelEvaluation + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IModelEvaluation[], + protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest | null, + protos.google.cloud.automl.v1beta1.IListModelEvaluationsResponse, + ] + > | 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.listModelEvaluations(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. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * + * Some examples of using the filter are: + * + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained via + * {@link protos.google.cloud.automl.v1beta1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations|AutoMl.ListModelEvaluations} call. + * @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 {@link protos.google.cloud.automl.v1beta1.ModelEvaluation|ModelEvaluation} 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 `listModelEvaluationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listModelEvaluationsStream( + request?: protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + 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['listModelEvaluations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelEvaluations.createStream( + this.innerApiCalls.listModelEvaluations as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listModelEvaluations`, 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. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * + * Some examples of using the filter are: + * + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained via + * {@link protos.google.cloud.automl.v1beta1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations|AutoMl.ListModelEvaluations} call. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.automl.v1beta1.ModelEvaluation|ModelEvaluation}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.list_model_evaluations.js + * region_tag:automl_v1beta1_generated_AutoMl_ListModelEvaluations_async + */ + listModelEvaluationsAsync( + request?: protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + 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['listModelEvaluations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelEvaluations.asyncIterate( + this.innerApiCalls['listModelEvaluations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath( + project: string, + location: string, + dataset: string, + annotationSpec: string + ) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).annotation_spec; + } + + /** + * Return a fully-qualified columnSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} table_spec + * @param {string} column_spec + * @returns {string} Resource name string. + */ + columnSpecPath( + project: string, + location: string, + dataset: string, + tableSpec: string, + columnSpec: string + ) { + return this.pathTemplates.columnSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + table_spec: tableSpec, + column_spec: columnSpec, + }); + } + + /** + * Parse the project from ColumnSpec resource. + * + * @param {string} columnSpecName + * A fully-qualified path representing ColumnSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromColumnSpecName(columnSpecName: string) { + return this.pathTemplates.columnSpecPathTemplate.match(columnSpecName) + .project; + } + + /** + * Parse the location from ColumnSpec resource. + * + * @param {string} columnSpecName + * A fully-qualified path representing ColumnSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromColumnSpecName(columnSpecName: string) { + return this.pathTemplates.columnSpecPathTemplate.match(columnSpecName) + .location; + } + + /** + * Parse the dataset from ColumnSpec resource. + * + * @param {string} columnSpecName + * A fully-qualified path representing ColumnSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromColumnSpecName(columnSpecName: string) { + return this.pathTemplates.columnSpecPathTemplate.match(columnSpecName) + .dataset; + } + + /** + * Parse the table_spec from ColumnSpec resource. + * + * @param {string} columnSpecName + * A fully-qualified path representing ColumnSpec resource. + * @returns {string} A string representing the table_spec. + */ + matchTableSpecFromColumnSpecName(columnSpecName: string) { + return this.pathTemplates.columnSpecPathTemplate.match(columnSpecName) + .table_spec; + } + + /** + * Parse the column_spec from ColumnSpec resource. + * + * @param {string} columnSpecName + * A fully-qualified path representing ColumnSpec resource. + * @returns {string} A string representing the column_spec. + */ + matchColumnSpecFromColumnSpecName(columnSpecName: string) { + return this.pathTemplates.columnSpecPathTemplate.match(columnSpecName) + .column_spec; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project: string, location: string, dataset: string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + 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 location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * 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 location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project: string, location: string, model: string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} model_evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath( + project: string, + location: string, + model: string, + modelEvaluation: string + ) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + model_evaluation: modelEvaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model; + } + + /** + * Parse the model_evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model_evaluation. + */ + matchModelEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model_evaluation; + } + + /** + * Return a fully-qualified tableSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} table_spec + * @returns {string} Resource name string. + */ + tableSpecPath( + project: string, + location: string, + dataset: string, + tableSpec: string + ) { + return this.pathTemplates.tableSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + table_spec: tableSpec, + }); + } + + /** + * Parse the project from TableSpec resource. + * + * @param {string} tableSpecName + * A fully-qualified path representing TableSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTableSpecName(tableSpecName: string) { + return this.pathTemplates.tableSpecPathTemplate.match(tableSpecName) + .project; + } + + /** + * Parse the location from TableSpec resource. + * + * @param {string} tableSpecName + * A fully-qualified path representing TableSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTableSpecName(tableSpecName: string) { + return this.pathTemplates.tableSpecPathTemplate.match(tableSpecName) + .location; + } + + /** + * Parse the dataset from TableSpec resource. + * + * @param {string} tableSpecName + * A fully-qualified path representing TableSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromTableSpecName(tableSpecName: string) { + return this.pathTemplates.tableSpecPathTemplate.match(tableSpecName) + .dataset; + } + + /** + * Parse the table_spec from TableSpec resource. + * + * @param {string} tableSpecName + * A fully-qualified path representing TableSpec resource. + * @returns {string} A string representing the table_spec. + */ + matchTableSpecFromTableSpecName(tableSpecName: string) { + return this.pathTemplates.tableSpecPathTemplate.match(tableSpecName) + .table_spec; + } + + /** + * 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.autoMlStub && !this._terminated) { + return this.autoMlStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-automl/src/v1beta1/auto_ml_client_config.json b/packages/google-cloud-automl/src/v1beta1/auto_ml_client_config.json new file mode 100644 index 00000000000..019742ff974 --- /dev/null +++ b/packages/google-cloud-automl/src/v1beta1/auto_ml_client_config.json @@ -0,0 +1,146 @@ +{ + "interfaces": { + "google.cloud.automl.v1beta1.AutoMl": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateDataset": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDataset": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListDatasets": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateDataset": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDataset": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ImportData": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportData": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAnnotationSpec": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetTableSpec": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListTableSpecs": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateTableSpec": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetColumnSpec": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListColumnSpecs": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateColumnSpec": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetModel": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListModels": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteModel": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeployModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UndeployModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportEvaluatedExamples": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetModelEvaluation": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListModelEvaluations": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-automl/src/v1beta1/auto_ml_proto_list.json b/packages/google-cloud-automl/src/v1beta1/auto_ml_proto_list.json new file mode 100644 index 00000000000..3a493dbb13a --- /dev/null +++ b/packages/google-cloud-automl/src/v1beta1/auto_ml_proto_list.json @@ -0,0 +1,30 @@ +[ + "../../protos/google/cloud/automl/v1beta1/annotation_payload.proto", + "../../protos/google/cloud/automl/v1beta1/annotation_spec.proto", + "../../protos/google/cloud/automl/v1beta1/classification.proto", + "../../protos/google/cloud/automl/v1beta1/column_spec.proto", + "../../protos/google/cloud/automl/v1beta1/data_items.proto", + "../../protos/google/cloud/automl/v1beta1/data_stats.proto", + "../../protos/google/cloud/automl/v1beta1/data_types.proto", + "../../protos/google/cloud/automl/v1beta1/dataset.proto", + "../../protos/google/cloud/automl/v1beta1/detection.proto", + "../../protos/google/cloud/automl/v1beta1/geometry.proto", + "../../protos/google/cloud/automl/v1beta1/image.proto", + "../../protos/google/cloud/automl/v1beta1/io.proto", + "../../protos/google/cloud/automl/v1beta1/model.proto", + "../../protos/google/cloud/automl/v1beta1/model_evaluation.proto", + "../../protos/google/cloud/automl/v1beta1/operations.proto", + "../../protos/google/cloud/automl/v1beta1/prediction_service.proto", + "../../protos/google/cloud/automl/v1beta1/ranges.proto", + "../../protos/google/cloud/automl/v1beta1/regression.proto", + "../../protos/google/cloud/automl/v1beta1/service.proto", + "../../protos/google/cloud/automl/v1beta1/table_spec.proto", + "../../protos/google/cloud/automl/v1beta1/tables.proto", + "../../protos/google/cloud/automl/v1beta1/temporal.proto", + "../../protos/google/cloud/automl/v1beta1/text.proto", + "../../protos/google/cloud/automl/v1beta1/text_extraction.proto", + "../../protos/google/cloud/automl/v1beta1/text_segment.proto", + "../../protos/google/cloud/automl/v1beta1/text_sentiment.proto", + "../../protos/google/cloud/automl/v1beta1/translation.proto", + "../../protos/google/cloud/automl/v1beta1/video.proto" +] diff --git a/packages/google-cloud-automl/src/v1beta1/gapic_metadata.json b/packages/google-cloud-automl/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000000..ab872c5f77b --- /dev/null +++ b/packages/google-cloud-automl/src/v1beta1/gapic_metadata.json @@ -0,0 +1,317 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.automl.v1beta1", + "libraryPackage": "@google-cloud/automl", + "services": { + "AutoMl": { + "clients": { + "grpc": { + "libraryClient": "AutoMlClient", + "rpcs": { + "CreateDataset": { + "methods": [ + "createDataset" + ] + }, + "GetDataset": { + "methods": [ + "getDataset" + ] + }, + "UpdateDataset": { + "methods": [ + "updateDataset" + ] + }, + "GetAnnotationSpec": { + "methods": [ + "getAnnotationSpec" + ] + }, + "GetTableSpec": { + "methods": [ + "getTableSpec" + ] + }, + "UpdateTableSpec": { + "methods": [ + "updateTableSpec" + ] + }, + "GetColumnSpec": { + "methods": [ + "getColumnSpec" + ] + }, + "UpdateColumnSpec": { + "methods": [ + "updateColumnSpec" + ] + }, + "GetModel": { + "methods": [ + "getModel" + ] + }, + "GetModelEvaluation": { + "methods": [ + "getModelEvaluation" + ] + }, + "DeleteDataset": { + "methods": [ + "deleteDataset" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "CreateModel": { + "methods": [ + "createModel" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "DeployModel": { + "methods": [ + "deployModel" + ] + }, + "UndeployModel": { + "methods": [ + "undeployModel" + ] + }, + "ExportModel": { + "methods": [ + "exportModel" + ] + }, + "ExportEvaluatedExamples": { + "methods": [ + "exportEvaluatedExamples" + ] + }, + "ListDatasets": { + "methods": [ + "listDatasets", + "listDatasetsStream", + "listDatasetsAsync" + ] + }, + "ListTableSpecs": { + "methods": [ + "listTableSpecs", + "listTableSpecsStream", + "listTableSpecsAsync" + ] + }, + "ListColumnSpecs": { + "methods": [ + "listColumnSpecs", + "listColumnSpecsStream", + "listColumnSpecsAsync" + ] + }, + "ListModels": { + "methods": [ + "listModels", + "listModelsStream", + "listModelsAsync" + ] + }, + "ListModelEvaluations": { + "methods": [ + "listModelEvaluations", + "listModelEvaluationsStream", + "listModelEvaluationsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AutoMlClient", + "rpcs": { + "CreateDataset": { + "methods": [ + "createDataset" + ] + }, + "GetDataset": { + "methods": [ + "getDataset" + ] + }, + "UpdateDataset": { + "methods": [ + "updateDataset" + ] + }, + "GetAnnotationSpec": { + "methods": [ + "getAnnotationSpec" + ] + }, + "GetTableSpec": { + "methods": [ + "getTableSpec" + ] + }, + "UpdateTableSpec": { + "methods": [ + "updateTableSpec" + ] + }, + "GetColumnSpec": { + "methods": [ + "getColumnSpec" + ] + }, + "UpdateColumnSpec": { + "methods": [ + "updateColumnSpec" + ] + }, + "GetModel": { + "methods": [ + "getModel" + ] + }, + "GetModelEvaluation": { + "methods": [ + "getModelEvaluation" + ] + }, + "DeleteDataset": { + "methods": [ + "deleteDataset" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "CreateModel": { + "methods": [ + "createModel" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "DeployModel": { + "methods": [ + "deployModel" + ] + }, + "UndeployModel": { + "methods": [ + "undeployModel" + ] + }, + "ExportModel": { + "methods": [ + "exportModel" + ] + }, + "ExportEvaluatedExamples": { + "methods": [ + "exportEvaluatedExamples" + ] + }, + "ListDatasets": { + "methods": [ + "listDatasets", + "listDatasetsStream", + "listDatasetsAsync" + ] + }, + "ListTableSpecs": { + "methods": [ + "listTableSpecs", + "listTableSpecsStream", + "listTableSpecsAsync" + ] + }, + "ListColumnSpecs": { + "methods": [ + "listColumnSpecs", + "listColumnSpecsStream", + "listColumnSpecsAsync" + ] + }, + "ListModels": { + "methods": [ + "listModels", + "listModelsStream", + "listModelsAsync" + ] + }, + "ListModelEvaluations": { + "methods": [ + "listModelEvaluations", + "listModelEvaluationsStream", + "listModelEvaluationsAsync" + ] + } + } + } + } + }, + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionServiceClient", + "rpcs": { + "Predict": { + "methods": [ + "predict" + ] + }, + "BatchPredict": { + "methods": [ + "batchPredict" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PredictionServiceClient", + "rpcs": { + "Predict": { + "methods": [ + "predict" + ] + }, + "BatchPredict": { + "methods": [ + "batchPredict" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-automl/src/v1beta1/index.ts b/packages/google-cloud-automl/src/v1beta1/index.ts new file mode 100644 index 00000000000..d736d0fb81a --- /dev/null +++ b/packages/google-cloud-automl/src/v1beta1/index.ts @@ -0,0 +1,20 @@ +// Copyright 2023 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 {AutoMlClient} from './auto_ml_client'; +export {PredictionServiceClient} from './prediction_service_client'; diff --git a/packages/google-cloud-automl/src/v1beta1/prediction_service_client.ts b/packages/google-cloud-automl/src/v1beta1/prediction_service_client.ts new file mode 100644 index 00000000000..86c19c5f851 --- /dev/null +++ b/packages/google-cloud-automl/src/v1beta1/prediction_service_client.ts @@ -0,0 +1,1194 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/prediction_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './prediction_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * AutoML Prediction API. + * + * On any input that is documented to expect a string parameter in + * snake_case or kebab-case, either of those cases is accepted. + * @class + * @memberof v1beta1 + */ +export class PredictionServiceClient { + 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; + predictionServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PredictionServiceClient. + * + * @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} [options.fallback] - Use HTTP/1.1 REST mode. + * 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 PredictionServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof PredictionServiceClient; + 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); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // 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 { + 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 = { + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + columnSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}/columnSpecs/{column_spec}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}' + ), + tableSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}' + ), + }; + + 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) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1beta1/{resource=projects/*/locations/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1beta1/{resource=projects/*/locations/*/datasets/*}:getIamPolicy', + }, + { + get: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1beta1/{resource=projects/*/locations/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1beta1/{resource=projects/*/locations/*/datasets/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1beta1/{resource=projects/*/locations/*/**}:testIamPermissions', + body: '*', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1beta1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1beta1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1beta1/{name=projects/*/locations/*}/operations', + }, + { + selector: 'google.longrunning.Operations.WaitOperation', + post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait', + body: '*', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const batchPredictResponse = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.BatchPredictResult' + ) as gax.protobuf.Type; + const batchPredictMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + batchPredict: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchPredictResponse.decode.bind(batchPredictResponse), + batchPredictMetadata.decode.bind(batchPredictMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.automl.v1beta1.PredictionService', + 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.predictionServiceStub) { + return this.predictionServiceStub; + } + + // Put together the "service stub" for + // google.cloud.automl.v1beta1.PredictionService. + this.predictionServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.automl.v1beta1.PredictionService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.automl.v1beta1.PredictionService, + 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 predictionServiceStubMethods = ['predict', 'batchPredict']; + for (const methodName of predictionServiceStubMethods) { + const callPromise = this.predictionServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.longrunning[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.predictionServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'automl.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 'automl.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 -- + // ------------------- + /** + * Perform an online prediction. The prediction result will be directly + * returned in the response. + * Available for following ML problems, and their expected request payloads: + * * Image Classification - Image in .JPEG, .GIF or .PNG format, image_bytes + * up to 30MB. + * * Image Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes + * up to 30MB. + * * Text Classification - TextSnippet, content up to 60,000 characters, + * UTF-8 encoded. + * * Text Extraction - TextSnippet, content up to 30,000 characters, + * UTF-8 NFC encoded. + * * Translation - TextSnippet, content up to 25,000 characters, UTF-8 + * encoded. + * * Tables - Row, with column values matching the columns of the model, + * up to 5MB. Not available for FORECASTING + * + * {@link protos.google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type|prediction_type}. + * * Text Sentiment - TextSnippet, content up 500 characters, UTF-8 + * encoded. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the model requested to serve the prediction. + * @param {google.cloud.automl.v1beta1.ExamplePayload} request.payload + * Required. Payload to perform a prediction on. The payload must match the + * problem type that the model was trained to solve. + * @param {number[]} request.params + * Additional domain-specific parameters, any string must be up to 25000 + * characters long. + * + * * For Image Classification: + * + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * + * * For Image Object Detection: + * `score_threshold` - (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be returned in the response. Default is 100, the + * requested value may be limited by server. + * * For Tables: + * feature_importance - (boolean) Whether feature importance + * should be populated in the returned TablesAnnotation. + * The default is false. + * @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 {@link protos.google.cloud.automl.v1beta1.PredictResponse|PredictResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/prediction_service.predict.js + * region_tag:automl_v1beta1_generated_PredictionService_Predict_async + */ + predict( + request?: protos.google.cloud.automl.v1beta1.IPredictRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IPredictResponse, + protos.google.cloud.automl.v1beta1.IPredictRequest | undefined, + {} | undefined, + ] + >; + predict( + request: protos.google.cloud.automl.v1beta1.IPredictRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.IPredictResponse, + protos.google.cloud.automl.v1beta1.IPredictRequest | null | undefined, + {} | null | undefined + > + ): void; + predict( + request: protos.google.cloud.automl.v1beta1.IPredictRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.IPredictResponse, + protos.google.cloud.automl.v1beta1.IPredictRequest | null | undefined, + {} | null | undefined + > + ): void; + predict( + request?: protos.google.cloud.automl.v1beta1.IPredictRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.IPredictResponse, + protos.google.cloud.automl.v1beta1.IPredictRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.IPredictResponse, + protos.google.cloud.automl.v1beta1.IPredictRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IPredictResponse, + protos.google.cloud.automl.v1beta1.IPredictRequest | 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.predict(request, options, callback); + } + + /** + * Perform a batch prediction. Unlike the online {@link protos.google.cloud.automl.v1beta1.PredictionService.Predict|Predict}, batch + * prediction result won't be immediately available in the response. Instead, + * a long running operation object is returned. User can poll the operation + * result via {@link protos.google.longrunning.Operations.GetOperation|GetOperation} + * method. Once the operation is done, {@link protos.google.cloud.automl.v1beta1.BatchPredictResult|BatchPredictResult} is returned in + * the {@link protos.google.longrunning.Operation.response|response} field. + * Available for following ML problems: + * * Image Classification + * * Image Object Detection + * * Video Classification + * * Video Object Tracking * Text Extraction + * * Tables + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the model requested to serve the batch prediction. + * @param {google.cloud.automl.v1beta1.BatchPredictInputConfig} request.inputConfig + * Required. The input configuration for batch prediction. + * @param {google.cloud.automl.v1beta1.BatchPredictOutputConfig} request.outputConfig + * Required. The Configuration specifying where output predictions should + * be written. + * @param {number[]} request.params + * Required. Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * + * * For Text Classification: + * + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * + * * For Image Classification: + * + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * + * * For Image Object Detection: + * + * `score_threshold` - (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be produced per image. Default is 100, the + * requested value may be limited by server. + * + * * For Video Classification : + * + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for a video, it will only produce results that + * have at least this confidence score. The default is 0.5. + * `segment_classification` - (boolean) Set to true to request + * segment-level classification. AutoML Video Intelligence returns + * labels and their confidence scores for the entire segment of the + * video that user specified in the request configuration. + * The default is "true". + * `shot_classification` - (boolean) Set to true to request shot-level + * classification. AutoML Video Intelligence determines the boundaries + * for each camera shot in the entire segment of the video that user + * specified in the request configuration. AutoML Video Intelligence + * then returns labels and their confidence scores for each detected + * shot, along with the start and end time of the shot. + * WARNING: Model evaluation is not done for this classification type, + * the quality of it depends on training data, but there are no metrics + * provided to describe that quality. The default is "false". + * `1s_interval_classification` - (boolean) Set to true to request + * classification for a video at one-second intervals. AutoML Video + * Intelligence returns labels and their confidence scores for each + * second of the entire segment of the video that user specified in the + * request configuration. + * WARNING: Model evaluation is not done for this classification + * type, the quality of it depends on training data, but there are no + * metrics provided to describe that quality. The default is + * "false". + * + * * For Tables: + * + * feature_importance - (boolean) Whether feature importance + * should be populated in the returned TablesAnnotations. The + * default is false. + * + * * For Video Object Tracking: + * + * `score_threshold` - (float) When Model detects objects on video frames, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be returned per frame. Default is 100, the requested + * value may be limited by server. + * `min_bounding_box_size` - (float) Only bounding boxes with shortest edge + * at least that long as a relative value of video frame size will be + * returned. Value in 0 to 1 range. Default is 0. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/prediction_service.batch_predict.js + * region_tag:automl_v1beta1_generated_PredictionService_BatchPredict_async + */ + batchPredict( + request?: protos.google.cloud.automl.v1beta1.IBatchPredictRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + batchPredict( + request: protos.google.cloud.automl.v1beta1.IBatchPredictRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchPredict( + request: protos.google.cloud.automl.v1beta1.IBatchPredictRequest, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchPredict( + request?: protos.google.cloud.automl.v1beta1.IBatchPredictRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.batchPredict(request, options, callback); + } + /** + * Check the status of the long running operation returned by `batchPredict()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/prediction_service.batch_predict.js + * region_tag:automl_v1beta1_generated_PredictionService_BatchPredict_async + */ + async checkBatchPredictProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.automl.v1beta1.BatchPredictResult, + protos.google.cloud.automl.v1beta1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.batchPredict, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.automl.v1beta1.BatchPredictResult, + protos.google.cloud.automl.v1beta1.OperationMetadata + >; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath( + project: string, + location: string, + dataset: string, + annotationSpec: string + ) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).annotation_spec; + } + + /** + * Return a fully-qualified columnSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} table_spec + * @param {string} column_spec + * @returns {string} Resource name string. + */ + columnSpecPath( + project: string, + location: string, + dataset: string, + tableSpec: string, + columnSpec: string + ) { + return this.pathTemplates.columnSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + table_spec: tableSpec, + column_spec: columnSpec, + }); + } + + /** + * Parse the project from ColumnSpec resource. + * + * @param {string} columnSpecName + * A fully-qualified path representing ColumnSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromColumnSpecName(columnSpecName: string) { + return this.pathTemplates.columnSpecPathTemplate.match(columnSpecName) + .project; + } + + /** + * Parse the location from ColumnSpec resource. + * + * @param {string} columnSpecName + * A fully-qualified path representing ColumnSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromColumnSpecName(columnSpecName: string) { + return this.pathTemplates.columnSpecPathTemplate.match(columnSpecName) + .location; + } + + /** + * Parse the dataset from ColumnSpec resource. + * + * @param {string} columnSpecName + * A fully-qualified path representing ColumnSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromColumnSpecName(columnSpecName: string) { + return this.pathTemplates.columnSpecPathTemplate.match(columnSpecName) + .dataset; + } + + /** + * Parse the table_spec from ColumnSpec resource. + * + * @param {string} columnSpecName + * A fully-qualified path representing ColumnSpec resource. + * @returns {string} A string representing the table_spec. + */ + matchTableSpecFromColumnSpecName(columnSpecName: string) { + return this.pathTemplates.columnSpecPathTemplate.match(columnSpecName) + .table_spec; + } + + /** + * Parse the column_spec from ColumnSpec resource. + * + * @param {string} columnSpecName + * A fully-qualified path representing ColumnSpec resource. + * @returns {string} A string representing the column_spec. + */ + matchColumnSpecFromColumnSpecName(columnSpecName: string) { + return this.pathTemplates.columnSpecPathTemplate.match(columnSpecName) + .column_spec; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project: string, location: string, dataset: string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + 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 location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * 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 model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project: string, location: string, model: string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} model_evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath( + project: string, + location: string, + model: string, + modelEvaluation: string + ) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + model_evaluation: modelEvaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model; + } + + /** + * Parse the model_evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model_evaluation. + */ + matchModelEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model_evaluation; + } + + /** + * Return a fully-qualified tableSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} table_spec + * @returns {string} Resource name string. + */ + tableSpecPath( + project: string, + location: string, + dataset: string, + tableSpec: string + ) { + return this.pathTemplates.tableSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + table_spec: tableSpec, + }); + } + + /** + * Parse the project from TableSpec resource. + * + * @param {string} tableSpecName + * A fully-qualified path representing TableSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTableSpecName(tableSpecName: string) { + return this.pathTemplates.tableSpecPathTemplate.match(tableSpecName) + .project; + } + + /** + * Parse the location from TableSpec resource. + * + * @param {string} tableSpecName + * A fully-qualified path representing TableSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTableSpecName(tableSpecName: string) { + return this.pathTemplates.tableSpecPathTemplate.match(tableSpecName) + .location; + } + + /** + * Parse the dataset from TableSpec resource. + * + * @param {string} tableSpecName + * A fully-qualified path representing TableSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromTableSpecName(tableSpecName: string) { + return this.pathTemplates.tableSpecPathTemplate.match(tableSpecName) + .dataset; + } + + /** + * Parse the table_spec from TableSpec resource. + * + * @param {string} tableSpecName + * A fully-qualified path representing TableSpec resource. + * @returns {string} A string representing the table_spec. + */ + matchTableSpecFromTableSpecName(tableSpecName: string) { + return this.pathTemplates.tableSpecPathTemplate.match(tableSpecName) + .table_spec; + } + + /** + * 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.predictionServiceStub && !this._terminated) { + return this.predictionServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-automl/src/v1beta1/prediction_service_client_config.json b/packages/google-cloud-automl/src/v1beta1/prediction_service_client_config.json new file mode 100644 index 00000000000..cc9f502b67c --- /dev/null +++ b/packages/google-cloud-automl/src/v1beta1/prediction_service_client_config.json @@ -0,0 +1,36 @@ +{ + "interfaces": { + "google.cloud.automl.v1beta1.PredictionService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "Predict": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchPredict": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-automl/src/v1beta1/prediction_service_proto_list.json b/packages/google-cloud-automl/src/v1beta1/prediction_service_proto_list.json new file mode 100644 index 00000000000..3a493dbb13a --- /dev/null +++ b/packages/google-cloud-automl/src/v1beta1/prediction_service_proto_list.json @@ -0,0 +1,30 @@ +[ + "../../protos/google/cloud/automl/v1beta1/annotation_payload.proto", + "../../protos/google/cloud/automl/v1beta1/annotation_spec.proto", + "../../protos/google/cloud/automl/v1beta1/classification.proto", + "../../protos/google/cloud/automl/v1beta1/column_spec.proto", + "../../protos/google/cloud/automl/v1beta1/data_items.proto", + "../../protos/google/cloud/automl/v1beta1/data_stats.proto", + "../../protos/google/cloud/automl/v1beta1/data_types.proto", + "../../protos/google/cloud/automl/v1beta1/dataset.proto", + "../../protos/google/cloud/automl/v1beta1/detection.proto", + "../../protos/google/cloud/automl/v1beta1/geometry.proto", + "../../protos/google/cloud/automl/v1beta1/image.proto", + "../../protos/google/cloud/automl/v1beta1/io.proto", + "../../protos/google/cloud/automl/v1beta1/model.proto", + "../../protos/google/cloud/automl/v1beta1/model_evaluation.proto", + "../../protos/google/cloud/automl/v1beta1/operations.proto", + "../../protos/google/cloud/automl/v1beta1/prediction_service.proto", + "../../protos/google/cloud/automl/v1beta1/ranges.proto", + "../../protos/google/cloud/automl/v1beta1/regression.proto", + "../../protos/google/cloud/automl/v1beta1/service.proto", + "../../protos/google/cloud/automl/v1beta1/table_spec.proto", + "../../protos/google/cloud/automl/v1beta1/tables.proto", + "../../protos/google/cloud/automl/v1beta1/temporal.proto", + "../../protos/google/cloud/automl/v1beta1/text.proto", + "../../protos/google/cloud/automl/v1beta1/text_extraction.proto", + "../../protos/google/cloud/automl/v1beta1/text_segment.proto", + "../../protos/google/cloud/automl/v1beta1/text_sentiment.proto", + "../../protos/google/cloud/automl/v1beta1/translation.proto", + "../../protos/google/cloud/automl/v1beta1/video.proto" +] diff --git a/packages/google-cloud-automl/system-test/automl.ts b/packages/google-cloud-automl/system-test/automl.ts new file mode 100644 index 00000000000..3667a8c1d53 --- /dev/null +++ b/packages/google-cloud-automl/system-test/automl.ts @@ -0,0 +1,35 @@ +// Copyright 2018 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'; + +import * as automl from '../src'; +import * as assert from 'assert'; +import {describe, it, before} from 'mocha'; + +const client = new automl.AutoMlClient(); +const location = 'us-central1'; + +describe('automl system tests', () => { + let projectId: string; + before(async () => { + projectId = await client.getProjectId(); + }); + + it('should list all datasets', async () => { + const parent = client.locationPath(projectId, location); + const [datasets] = await client.listDatasets({parent}); + assert.ok(Array.isArray(datasets)); + }); +}); diff --git a/packages/google-cloud-automl/system-test/fixtures/sample/src/index.js b/packages/google-cloud-automl/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..54d1151df35 --- /dev/null +++ b/packages/google-cloud-automl/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2023 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 automl = require('@google-cloud/automl'); + +function main() { + const autoMlClient = new automl.AutoMlClient(); + const predictionServiceClient = new automl.PredictionServiceClient(); +} + +main(); diff --git a/packages/google-cloud-automl/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-automl/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..e32ff22a428 --- /dev/null +++ b/packages/google-cloud-automl/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,38 @@ +// Copyright 2023 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 {AutoMlClient, PredictionServiceClient} from '@google-cloud/automl'; + +// check that the client class type name can be used +function doStuffWithAutoMlClient(client: AutoMlClient) { + client.close(); +} +function doStuffWithPredictionServiceClient(client: PredictionServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const autoMlClient = new AutoMlClient(); + doStuffWithAutoMlClient(autoMlClient); + // check that the client instance can be created + const predictionServiceClient = new PredictionServiceClient(); + doStuffWithPredictionServiceClient(predictionServiceClient); +} + +main(); diff --git a/packages/google-cloud-automl/system-test/install.ts b/packages/google-cloud-automl/system-test/install.ts new file mode 100644 index 00000000000..f61fe236476 --- /dev/null +++ b/packages/google-cloud-automl/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2023 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-automl/test/gapic_auto_ml_v1.ts b/packages/google-cloud-automl/test/gapic_auto_ml_v1.ts new file mode 100644 index 00000000000..04cf88aafc2 --- /dev/null +++ b/packages/google-cloud-automl/test/gapic_auto_ml_v1.ts @@ -0,0 +1,4022 @@ +// Copyright 2023 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 automlModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.AutoMlClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = automlModule.v1.AutoMlClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = automlModule.v1.AutoMlClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = automlModule.v1.AutoMlClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new automlModule.v1.AutoMlClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new automlModule.v1.AutoMlClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.autoMlStub, undefined); + await client.initialize(); + assert(client.autoMlStub); + }); + + it('has close method for the initialized client', done => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.autoMlStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.autoMlStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new automlModule.v1.AutoMlClient({ + 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 automlModule.v1.AutoMlClient({ + 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('getDataset', () => { + it('invokes getDataset without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.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 automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.Dataset() + ); + client.innerApiCalls.getDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1.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 automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.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 automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.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('updateDataset', () => { + it('invokes updateDataset without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UpdateDatasetRequest() + ); + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UpdateDatasetRequest', + ['dataset', 'name'] + ); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.Dataset() + ); + client.innerApiCalls.updateDataset = stubSimpleCall(expectedResponse); + const [response] = await client.updateDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataset without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UpdateDatasetRequest() + ); + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UpdateDatasetRequest', + ['dataset', 'name'] + ); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.Dataset() + ); + client.innerApiCalls.updateDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDataset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1.IDataset | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataset with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UpdateDatasetRequest() + ); + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UpdateDatasetRequest', + ['dataset', 'name'] + ); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataset = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataset with closed client', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UpdateDatasetRequest() + ); + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UpdateDatasetRequest', + ['dataset', 'name'] + ); + request.dataset.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDataset(request), expectedError); + }); + }); + + describe('getAnnotationSpec', () => { + it('invokes getAnnotationSpec without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetAnnotationSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetAnnotationSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.AnnotationSpec() + ); + client.innerApiCalls.getAnnotationSpec = stubSimpleCall(expectedResponse); + const [response] = await client.getAnnotationSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotationSpec without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetAnnotationSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetAnnotationSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.AnnotationSpec() + ); + client.innerApiCalls.getAnnotationSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAnnotationSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1.IAnnotationSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotationSpec with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetAnnotationSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetAnnotationSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAnnotationSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getAnnotationSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotationSpec with closed client', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetAnnotationSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetAnnotationSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAnnotationSpec(request), expectedError); + }); + }); + + describe('getModel', () => { + it('invokes getModel without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.Model() + ); + client.innerApiCalls.getModel = stubSimpleCall(expectedResponse); + const [response] = await client.getModel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.Model() + ); + client.innerApiCalls.getModel = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getModel( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1.IModel | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel with closed client', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getModel(request), expectedError); + }); + }); + + describe('updateModel', () => { + it('invokes updateModel without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UpdateModelRequest() + ); + request.model ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UpdateModelRequest', + ['model', 'name'] + ); + request.model.name = defaultValue1; + const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.Model() + ); + client.innerApiCalls.updateModel = stubSimpleCall(expectedResponse); + const [response] = await client.updateModel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateModel without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UpdateModelRequest() + ); + request.model ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UpdateModelRequest', + ['model', 'name'] + ); + request.model.name = defaultValue1; + const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.Model() + ); + client.innerApiCalls.updateModel = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateModel( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1.IModel | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateModel with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UpdateModelRequest() + ); + request.model ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UpdateModelRequest', + ['model', 'name'] + ); + request.model.name = defaultValue1; + const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateModel = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateModel with closed client', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UpdateModelRequest() + ); + request.model ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UpdateModelRequest', + ['model', 'name'] + ); + request.model.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateModel(request), expectedError); + }); + }); + + describe('getModelEvaluation', () => { + it('invokes getModelEvaluation without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetModelEvaluationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetModelEvaluationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ); + client.innerApiCalls.getModelEvaluation = + stubSimpleCall(expectedResponse); + const [response] = await client.getModelEvaluation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModelEvaluation without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetModelEvaluationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetModelEvaluationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ); + client.innerApiCalls.getModelEvaluation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getModelEvaluation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1.IModelEvaluation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModelEvaluation with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetModelEvaluationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetModelEvaluationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getModelEvaluation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getModelEvaluation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModelEvaluation with closed client', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetModelEvaluationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetModelEvaluationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getModelEvaluation(request), expectedError); + }); + }); + + describe('createDataset', () => { + it('invokes createDataset without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createDataset = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createDataset(request); + const [response] = await operation.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 without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createDataset = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDataset( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IOperationMetadata + >; + const [response] = await operation.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 call error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataset = stubLongRunningCall( + 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 LRO error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataset = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createDataset(request); + await assert.rejects(operation.promise(), 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 checkCreateDatasetProgress without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + 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.checkCreateDatasetProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateDatasetProgress with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + 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.checkCreateDatasetProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteDataset', () => { + it('invokes deleteDataset without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDataset = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteDataset(request); + const [response] = await operation.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 without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDataset = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDataset( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >; + const [response] = await operation.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 call error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataset = stubLongRunningCall( + 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 LRO error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataset = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteDataset(request); + await assert.rejects(operation.promise(), 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 checkDeleteDatasetProgress without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + 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.checkDeleteDatasetProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteDatasetProgress with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + 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.checkDeleteDatasetProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('importData', () => { + it('invokes importData without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.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 automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.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.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >; + 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 automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.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 automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.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 automlModule.v1.AutoMlClient({ + 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 automlModule.v1.AutoMlClient({ + 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 automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.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 automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.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.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >; + 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 automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.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 automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.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 automlModule.v1.AutoMlClient({ + 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 automlModule.v1.AutoMlClient({ + 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('createModel', () => { + it('invokes createModel without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.CreateModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.CreateModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.createModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createModel without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.CreateModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.CreateModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createModel with call error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.CreateModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.CreateModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createModel with LRO error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.CreateModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.CreateModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateModelProgress without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + 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.checkCreateModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateModelProgress with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + 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.checkCreateModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteModel', () => { + it('invokes deleteModel without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeleteModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeleteModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteModel without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeleteModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeleteModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteModel with call error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeleteModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeleteModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteModel with LRO error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeleteModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeleteModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteModelProgress without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + 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.checkDeleteModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteModelProgress with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + 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.checkDeleteModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deployModel', () => { + it('invokes deployModel without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deployModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.deployModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployModel without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deployModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deployModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployModel with call error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deployModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployModel with LRO error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deployModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeployModelProgress without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + 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.checkDeployModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeployModelProgress with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + 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.checkDeployModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('undeployModel', () => { + it('invokes undeployModel without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UndeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UndeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeployModel = + stubLongRunningCall(expectedResponse); + const [operation] = await client.undeployModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployModel without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UndeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UndeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeployModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeployModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployModel with call error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UndeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UndeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.undeployModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployModel with LRO error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UndeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UndeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.undeployModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUndeployModelProgress without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + 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.checkUndeployModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeployModelProgress with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + 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.checkUndeployModelProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('exportModel', () => { + it('invokes exportModel without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ExportModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ExportModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportModel without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ExportModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ExportModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportModel with call error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ExportModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ExportModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.exportModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportModel with LRO error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ExportModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ExportModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.exportModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportModelProgress without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + 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.checkExportModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportModelProgress with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + 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.checkExportModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listDatasets', () => { + it('invokes listDatasets without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1.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 automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + ]; + client.innerApiCalls.listDatasets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDatasets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1.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 automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.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 automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + ]; + client.descriptors.page.listDatasets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDatasetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1.Dataset[] = []; + stream.on('data', (response: protos.google.cloud.automl.v1.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 automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.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.automl.v1.Dataset[] = []; + stream.on('data', (response: protos.google.cloud.automl.v1.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 automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + ]; + client.descriptors.page.listDatasets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.automl.v1.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 automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.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.automl.v1.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('listModels', () => { + it('invokes listModels without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + ]; + client.innerApiCalls.listModels = stubSimpleCall(expectedResponse); + const [response] = await client.listModels(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModels without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + ]; + client.innerApiCalls.listModels = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModels( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1.IModel[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModels with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModels = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listModels(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelsStream without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + ]; + client.descriptors.page.listModels.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1.Model[] = []; + stream.on('data', (response: protos.google.cloud.automl.v1.Model) => { + 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.listModels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModels, request) + ); + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listModelsStream with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModels.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1.Model[] = []; + stream.on('data', (response: protos.google.cloud.automl.v1.Model) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModels, request) + ); + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModels without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + ]; + client.descriptors.page.listModels.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.automl.v1.IModel[] = []; + const iterable = client.listModelsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModels with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listModelsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.automl.v1.IModel[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listModelEvaluations', () => { + it('invokes listModelEvaluations without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + ]; + client.innerApiCalls.listModelEvaluations = + stubSimpleCall(expectedResponse); + const [response] = await client.listModelEvaluations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelEvaluations without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + ]; + client.innerApiCalls.listModelEvaluations = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModelEvaluations( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1.IModelEvaluation[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelEvaluations with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelEvaluations = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listModelEvaluations(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelEvaluationsStream without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + ]; + client.descriptors.page.listModelEvaluations.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listModelEvaluationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1.ModelEvaluation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1.ModelEvaluation) => { + 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.listModelEvaluations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModelEvaluations, request) + ); + assert( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listModelEvaluationsStream with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModelEvaluations.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listModelEvaluationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1.ModelEvaluation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1.ModelEvaluation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModelEvaluations, request) + ); + assert( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModelEvaluations without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + ]; + client.descriptors.page.listModelEvaluations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.automl.v1.IModelEvaluation[] = []; + const iterable = client.listModelEvaluationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModelEvaluations with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModelEvaluations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listModelEvaluationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.automl.v1.IModelEvaluation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('annotationSpec', () => { + const fakePath = '/rendered/path/annotationSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + annotation_spec: 'annotationSpecValue', + }; + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'annotationSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = + client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'annotationSpecValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataset', () => { + const fakePath = '/rendered/path/dataset'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + }; + const client = new automlModule.v1.AutoMlClient({ + 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', + 'locationValue', + '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('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, 'locationValue'); + 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('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + }; + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath( + 'projectValue', + 'locationValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = '/rendered/path/modelEvaluation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + model_evaluation: 'modelEvaluationValue', + }; + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath( + 'projectValue', + 'locationValue', + 'modelValue', + 'modelEvaluationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelEvaluationFromModelEvaluationName', () => { + const result = + client.matchModelEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelEvaluationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-automl/test/gapic_auto_ml_v1beta1.ts b/packages/google-cloud-automl/test/gapic_auto_ml_v1beta1.ts new file mode 100644 index 00000000000..e3b9b02fc78 --- /dev/null +++ b/packages/google-cloud-automl/test/gapic_auto_ml_v1beta1.ts @@ -0,0 +1,5382 @@ +// Copyright 2023 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 automlModule 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.AutoMlClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = automlModule.v1beta1.AutoMlClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = automlModule.v1beta1.AutoMlClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = automlModule.v1beta1.AutoMlClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new automlModule.v1beta1.AutoMlClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new automlModule.v1beta1.AutoMlClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.autoMlStub, undefined); + await client.initialize(); + assert(client.autoMlStub); + }); + + it('has close method for the initialized client', done => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.autoMlStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.autoMlStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new automlModule.v1beta1.AutoMlClient({ + 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 automlModule.v1beta1.AutoMlClient({ + 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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.Dataset() + ); + client.innerApiCalls.createDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDataset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.Dataset() + ); + client.innerApiCalls.getDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.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('updateDataset', () => { + it('invokes updateDataset without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateDatasetRequest() + ); + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateDatasetRequest', + ['dataset', 'name'] + ); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.Dataset() + ); + client.innerApiCalls.updateDataset = stubSimpleCall(expectedResponse); + const [response] = await client.updateDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataset without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateDatasetRequest() + ); + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateDatasetRequest', + ['dataset', 'name'] + ); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.Dataset() + ); + client.innerApiCalls.updateDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDataset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IDataset | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataset with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateDatasetRequest() + ); + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateDatasetRequest', + ['dataset', 'name'] + ); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataset = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataset with closed client', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateDatasetRequest() + ); + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateDatasetRequest', + ['dataset', 'name'] + ); + request.dataset.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDataset(request), expectedError); + }); + }); + + describe('getAnnotationSpec', () => { + it('invokes getAnnotationSpec without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetAnnotationSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetAnnotationSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.AnnotationSpec() + ); + client.innerApiCalls.getAnnotationSpec = stubSimpleCall(expectedResponse); + const [response] = await client.getAnnotationSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotationSpec without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetAnnotationSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetAnnotationSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.AnnotationSpec() + ); + client.innerApiCalls.getAnnotationSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAnnotationSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IAnnotationSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotationSpec with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetAnnotationSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetAnnotationSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAnnotationSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getAnnotationSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotationSpec with closed client', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetAnnotationSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetAnnotationSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAnnotationSpec(request), expectedError); + }); + }); + + describe('getTableSpec', () => { + it('invokes getTableSpec without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetTableSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetTableSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ); + client.innerApiCalls.getTableSpec = stubSimpleCall(expectedResponse); + const [response] = await client.getTableSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTableSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTableSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTableSpec without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetTableSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetTableSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ); + client.innerApiCalls.getTableSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTableSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.ITableSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTableSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTableSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTableSpec with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetTableSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetTableSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTableSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getTableSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTableSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTableSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTableSpec with closed client', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetTableSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetTableSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTableSpec(request), expectedError); + }); + }); + + describe('updateTableSpec', () => { + it('invokes updateTableSpec without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateTableSpecRequest() + ); + request.tableSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateTableSpecRequest', + ['tableSpec', 'name'] + ); + request.tableSpec.name = defaultValue1; + const expectedHeaderRequestParams = `table_spec.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ); + client.innerApiCalls.updateTableSpec = stubSimpleCall(expectedResponse); + const [response] = await client.updateTableSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTableSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTableSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTableSpec without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateTableSpecRequest() + ); + request.tableSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateTableSpecRequest', + ['tableSpec', 'name'] + ); + request.tableSpec.name = defaultValue1; + const expectedHeaderRequestParams = `table_spec.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ); + client.innerApiCalls.updateTableSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTableSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.ITableSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTableSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTableSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTableSpec with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateTableSpecRequest() + ); + request.tableSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateTableSpecRequest', + ['tableSpec', 'name'] + ); + request.tableSpec.name = defaultValue1; + const expectedHeaderRequestParams = `table_spec.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTableSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateTableSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTableSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTableSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTableSpec with closed client', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateTableSpecRequest() + ); + request.tableSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateTableSpecRequest', + ['tableSpec', 'name'] + ); + request.tableSpec.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateTableSpec(request), expectedError); + }); + }); + + describe('getColumnSpec', () => { + it('invokes getColumnSpec without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetColumnSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetColumnSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ); + client.innerApiCalls.getColumnSpec = stubSimpleCall(expectedResponse); + const [response] = await client.getColumnSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getColumnSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getColumnSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getColumnSpec without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetColumnSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetColumnSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ); + client.innerApiCalls.getColumnSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getColumnSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IColumnSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getColumnSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getColumnSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getColumnSpec with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetColumnSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetColumnSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getColumnSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getColumnSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getColumnSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getColumnSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getColumnSpec with closed client', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetColumnSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetColumnSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getColumnSpec(request), expectedError); + }); + }); + + describe('updateColumnSpec', () => { + it('invokes updateColumnSpec without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateColumnSpecRequest() + ); + request.columnSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateColumnSpecRequest', + ['columnSpec', 'name'] + ); + request.columnSpec.name = defaultValue1; + const expectedHeaderRequestParams = `column_spec.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ); + client.innerApiCalls.updateColumnSpec = stubSimpleCall(expectedResponse); + const [response] = await client.updateColumnSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateColumnSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateColumnSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateColumnSpec without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateColumnSpecRequest() + ); + request.columnSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateColumnSpecRequest', + ['columnSpec', 'name'] + ); + request.columnSpec.name = defaultValue1; + const expectedHeaderRequestParams = `column_spec.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ); + client.innerApiCalls.updateColumnSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateColumnSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IColumnSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateColumnSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateColumnSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateColumnSpec with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateColumnSpecRequest() + ); + request.columnSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateColumnSpecRequest', + ['columnSpec', 'name'] + ); + request.columnSpec.name = defaultValue1; + const expectedHeaderRequestParams = `column_spec.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateColumnSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateColumnSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateColumnSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateColumnSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateColumnSpec with closed client', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateColumnSpecRequest() + ); + request.columnSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateColumnSpecRequest', + ['columnSpec', 'name'] + ); + request.columnSpec.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateColumnSpec(request), expectedError); + }); + }); + + describe('getModel', () => { + it('invokes getModel without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.Model() + ); + client.innerApiCalls.getModel = stubSimpleCall(expectedResponse); + const [response] = await client.getModel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.Model() + ); + client.innerApiCalls.getModel = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getModel( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IModel | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel with closed client', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getModel(request), expectedError); + }); + }); + + describe('getModelEvaluation', () => { + it('invokes getModelEvaluation without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetModelEvaluationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetModelEvaluationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ); + client.innerApiCalls.getModelEvaluation = + stubSimpleCall(expectedResponse); + const [response] = await client.getModelEvaluation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModelEvaluation without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetModelEvaluationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetModelEvaluationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ); + client.innerApiCalls.getModelEvaluation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getModelEvaluation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IModelEvaluation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModelEvaluation with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetModelEvaluationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetModelEvaluationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getModelEvaluation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getModelEvaluation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModelEvaluation with closed client', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetModelEvaluationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetModelEvaluationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getModelEvaluation(request), expectedError); + }); + }); + + describe('deleteDataset', () => { + it('invokes deleteDataset without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDataset = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteDataset(request); + const [response] = await operation.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 without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDataset = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDataset( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >; + const [response] = await operation.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 call error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataset = stubLongRunningCall( + 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 LRO error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataset = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteDataset(request); + await assert.rejects(operation.promise(), 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 checkDeleteDatasetProgress without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + 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.checkDeleteDatasetProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteDatasetProgress with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + 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.checkDeleteDatasetProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('importData', () => { + it('invokes importData without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.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.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >; + 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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.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 automlModule.v1beta1.AutoMlClient({ + 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 automlModule.v1beta1.AutoMlClient({ + 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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.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.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >; + 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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.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 automlModule.v1beta1.AutoMlClient({ + 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 automlModule.v1beta1.AutoMlClient({ + 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('createModel', () => { + it('invokes createModel without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.CreateModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.CreateModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.createModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createModel without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.CreateModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.CreateModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createModel with call error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.CreateModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.CreateModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createModel with LRO error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.CreateModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.CreateModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateModelProgress without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + 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.checkCreateModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateModelProgress with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + 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.checkCreateModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteModel', () => { + it('invokes deleteModel without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeleteModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeleteModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteModel without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeleteModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeleteModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteModel with call error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeleteModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeleteModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteModel with LRO error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeleteModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeleteModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteModelProgress without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + 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.checkDeleteModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteModelProgress with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + 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.checkDeleteModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deployModel', () => { + it('invokes deployModel without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deployModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.deployModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployModel without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deployModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deployModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployModel with call error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deployModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployModel with LRO error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deployModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeployModelProgress without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + 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.checkDeployModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeployModelProgress with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + 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.checkDeployModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('undeployModel', () => { + it('invokes undeployModel without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UndeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UndeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeployModel = + stubLongRunningCall(expectedResponse); + const [operation] = await client.undeployModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployModel without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UndeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UndeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeployModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeployModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployModel with call error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UndeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UndeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.undeployModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployModel with LRO error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UndeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UndeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.undeployModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUndeployModelProgress without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + 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.checkUndeployModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeployModelProgress with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + 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.checkUndeployModelProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('exportModel', () => { + it('invokes exportModel without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ExportModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportModel without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ExportModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportModel with call error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ExportModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.exportModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportModel with LRO error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ExportModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.exportModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportModelProgress without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + 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.checkExportModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportModelProgress with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + 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.checkExportModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('exportEvaluatedExamples', () => { + it('invokes exportEvaluatedExamples without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportEvaluatedExamples = + stubLongRunningCall(expectedResponse); + const [operation] = await client.exportEvaluatedExamples(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportEvaluatedExamples as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportEvaluatedExamples as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportEvaluatedExamples without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportEvaluatedExamples = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportEvaluatedExamples( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportEvaluatedExamples as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportEvaluatedExamples as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportEvaluatedExamples with call error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportEvaluatedExamples = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.exportEvaluatedExamples(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.exportEvaluatedExamples as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportEvaluatedExamples as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportEvaluatedExamples with LRO error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportEvaluatedExamples = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.exportEvaluatedExamples(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportEvaluatedExamples as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportEvaluatedExamples as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportEvaluatedExamplesProgress without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + 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.checkExportEvaluatedExamplesProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportEvaluatedExamplesProgress with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + 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.checkExportEvaluatedExamplesProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listDatasets', () => { + it('invokes listDatasets without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + ]; + client.innerApiCalls.listDatasets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDatasets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.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.automl.v1beta1.Dataset[] = []; + stream.on( + 'data', + (response: protos.google.cloud.automl.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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.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.automl.v1beta1.Dataset[] = []; + stream.on( + 'data', + (response: protos.google.cloud.automl.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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + ]; + client.descriptors.page.listDatasets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.automl.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 automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.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.automl.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('listTableSpecs', () => { + it('invokes listTableSpecs without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListTableSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListTableSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + ]; + client.innerApiCalls.listTableSpecs = stubSimpleCall(expectedResponse); + const [response] = await client.listTableSpecs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTableSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTableSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTableSpecs without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListTableSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListTableSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + ]; + client.innerApiCalls.listTableSpecs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTableSpecs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.ITableSpec[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTableSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTableSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTableSpecs with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListTableSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListTableSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTableSpecs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTableSpecs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTableSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTableSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTableSpecsStream without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListTableSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListTableSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + ]; + client.descriptors.page.listTableSpecs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTableSpecsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1beta1.TableSpec[] = []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1beta1.TableSpec) => { + 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.listTableSpecs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTableSpecs, request) + ); + assert( + (client.descriptors.page.listTableSpecs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTableSpecsStream with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListTableSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListTableSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTableSpecs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTableSpecsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1beta1.TableSpec[] = []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1beta1.TableSpec) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTableSpecs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTableSpecs, request) + ); + assert( + (client.descriptors.page.listTableSpecs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTableSpecs without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListTableSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListTableSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + ]; + client.descriptors.page.listTableSpecs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.automl.v1beta1.ITableSpec[] = []; + const iterable = client.listTableSpecsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTableSpecs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTableSpecs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTableSpecs with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListTableSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListTableSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTableSpecs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTableSpecsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.automl.v1beta1.ITableSpec[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTableSpecs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTableSpecs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listColumnSpecs', () => { + it('invokes listColumnSpecs without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListColumnSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListColumnSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + ]; + client.innerApiCalls.listColumnSpecs = stubSimpleCall(expectedResponse); + const [response] = await client.listColumnSpecs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listColumnSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listColumnSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listColumnSpecs without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListColumnSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListColumnSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + ]; + client.innerApiCalls.listColumnSpecs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listColumnSpecs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IColumnSpec[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listColumnSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listColumnSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listColumnSpecs with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListColumnSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListColumnSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listColumnSpecs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listColumnSpecs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listColumnSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listColumnSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listColumnSpecsStream without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListColumnSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListColumnSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + ]; + client.descriptors.page.listColumnSpecs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listColumnSpecsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1beta1.ColumnSpec[] = []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1beta1.ColumnSpec) => { + 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.listColumnSpecs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listColumnSpecs, request) + ); + assert( + (client.descriptors.page.listColumnSpecs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listColumnSpecsStream with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListColumnSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListColumnSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listColumnSpecs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listColumnSpecsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1beta1.ColumnSpec[] = []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1beta1.ColumnSpec) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listColumnSpecs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listColumnSpecs, request) + ); + assert( + (client.descriptors.page.listColumnSpecs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listColumnSpecs without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListColumnSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListColumnSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + ]; + client.descriptors.page.listColumnSpecs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.automl.v1beta1.IColumnSpec[] = []; + const iterable = client.listColumnSpecsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listColumnSpecs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listColumnSpecs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listColumnSpecs with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListColumnSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListColumnSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listColumnSpecs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listColumnSpecsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.automl.v1beta1.IColumnSpec[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listColumnSpecs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listColumnSpecs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listModels', () => { + it('invokes listModels without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + ]; + client.innerApiCalls.listModels = stubSimpleCall(expectedResponse); + const [response] = await client.listModels(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModels without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + ]; + client.innerApiCalls.listModels = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModels( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IModel[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModels with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModels = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listModels(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelsStream without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + ]; + client.descriptors.page.listModels.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1beta1.Model[] = []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1beta1.Model) => { + 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.listModels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModels, request) + ); + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listModelsStream with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModels.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1beta1.Model[] = []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1beta1.Model) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModels, request) + ); + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModels without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + ]; + client.descriptors.page.listModels.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.automl.v1beta1.IModel[] = []; + const iterable = client.listModelsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModels with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listModelsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.automl.v1beta1.IModel[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listModelEvaluations', () => { + it('invokes listModelEvaluations without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + ]; + client.innerApiCalls.listModelEvaluations = + stubSimpleCall(expectedResponse); + const [response] = await client.listModelEvaluations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelEvaluations without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + ]; + client.innerApiCalls.listModelEvaluations = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModelEvaluations( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.automl.v1beta1.IModelEvaluation[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelEvaluations with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelEvaluations = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listModelEvaluations(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelEvaluationsStream without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + ]; + client.descriptors.page.listModelEvaluations.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listModelEvaluationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1beta1.ModelEvaluation[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1beta1.ModelEvaluation) => { + 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.listModelEvaluations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModelEvaluations, request) + ); + assert( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listModelEvaluationsStream with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModelEvaluations.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listModelEvaluationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1beta1.ModelEvaluation[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1beta1.ModelEvaluation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModelEvaluations, request) + ); + assert( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModelEvaluations without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + ]; + client.descriptors.page.listModelEvaluations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.automl.v1beta1.IModelEvaluation[] = + []; + const iterable = client.listModelEvaluationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModelEvaluations with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModelEvaluations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listModelEvaluationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.automl.v1beta1.IModelEvaluation[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('annotationSpec', () => { + const fakePath = '/rendered/path/annotationSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + annotation_spec: 'annotationSpecValue', + }; + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'annotationSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = + client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'annotationSpecValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('columnSpec', () => { + const fakePath = '/rendered/path/columnSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + table_spec: 'tableSpecValue', + column_spec: 'columnSpecValue', + }; + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.columnSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.columnSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('columnSpecPath', () => { + const result = client.columnSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'tableSpecValue', + 'columnSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.columnSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromColumnSpecName', () => { + const result = client.matchProjectFromColumnSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.columnSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromColumnSpecName', () => { + const result = client.matchLocationFromColumnSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.columnSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromColumnSpecName', () => { + const result = client.matchDatasetFromColumnSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.columnSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTableSpecFromColumnSpecName', () => { + const result = client.matchTableSpecFromColumnSpecName(fakePath); + assert.strictEqual(result, 'tableSpecValue'); + assert( + (client.pathTemplates.columnSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchColumnSpecFromColumnSpecName', () => { + const result = client.matchColumnSpecFromColumnSpecName(fakePath); + assert.strictEqual(result, 'columnSpecValue'); + assert( + (client.pathTemplates.columnSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataset', () => { + const fakePath = '/rendered/path/dataset'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + }; + const client = new automlModule.v1beta1.AutoMlClient({ + 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', + 'locationValue', + '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('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, 'locationValue'); + 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('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + }; + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath( + 'projectValue', + 'locationValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = '/rendered/path/modelEvaluation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + model_evaluation: 'modelEvaluationValue', + }; + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath( + 'projectValue', + 'locationValue', + 'modelValue', + 'modelEvaluationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelEvaluationFromModelEvaluationName', () => { + const result = + client.matchModelEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelEvaluationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tableSpec', () => { + const fakePath = '/rendered/path/tableSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + table_spec: 'tableSpecValue', + }; + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tableSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tableSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tableSpecPath', () => { + const result = client.tableSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'tableSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tableSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTableSpecName', () => { + const result = client.matchProjectFromTableSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tableSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTableSpecName', () => { + const result = client.matchLocationFromTableSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tableSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromTableSpecName', () => { + const result = client.matchDatasetFromTableSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.tableSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTableSpecFromTableSpecName', () => { + const result = client.matchTableSpecFromTableSpecName(fakePath); + assert.strictEqual(result, 'tableSpecValue'); + assert( + (client.pathTemplates.tableSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-automl/test/gapic_prediction_service_v1.ts b/packages/google-cloud-automl/test/gapic_prediction_service_v1.ts new file mode 100644 index 00000000000..71b641a384e --- /dev/null +++ b/packages/google-cloud-automl/test/gapic_prediction_service_v1.ts @@ -0,0 +1,799 @@ +// Copyright 2023 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 predictionserviceModule from '../src'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function 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); +} + +describe('v1.PredictionServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + predictionserviceModule.v1.PredictionServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + predictionserviceModule.v1.PredictionServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = predictionserviceModule.v1.PredictionServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new predictionserviceModule.v1.PredictionServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.predictionServiceStub, undefined); + await client.initialize(); + assert(client.predictionServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.predictionServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.predictionServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + 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 predictionserviceModule.v1.PredictionServiceClient({ + 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('predict', () => { + it('invokes predict without error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.PredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.PredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.PredictResponse() + ); + client.innerApiCalls.predict = stubSimpleCall(expectedResponse); + const [response] = await client.predict(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes predict without error using callback', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.PredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.PredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.PredictResponse() + ); + client.innerApiCalls.predict = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.predict( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1.IPredictResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes predict with error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.PredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.PredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.predict = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.predict(request), expectedError); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes predict with closed client', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.PredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.PredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.predict(request), expectedError); + }); + }); + + describe('batchPredict', () => { + it('invokes batchPredict without error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.BatchPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.BatchPredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchPredict = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchPredict(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchPredict without error using callback', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.BatchPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.BatchPredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchPredict = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchPredict( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchPredict with call error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.BatchPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.BatchPredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchPredict = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.batchPredict(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchPredict with LRO error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.BatchPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.BatchPredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchPredict = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.batchPredict(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchPredictProgress without error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + 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.checkBatchPredictProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchPredictProgress with error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + 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.checkBatchPredictProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('Path templates', () => { + describe('annotationSpec', () => { + const fakePath = '/rendered/path/annotationSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + annotation_spec: 'annotationSpecValue', + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'annotationSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = + client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'annotationSpecValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataset', () => { + const fakePath = '/rendered/path/dataset'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + 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', + 'locationValue', + '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('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, 'locationValue'); + 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('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath( + 'projectValue', + 'locationValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = '/rendered/path/modelEvaluation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + model_evaluation: 'modelEvaluationValue', + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath( + 'projectValue', + 'locationValue', + 'modelValue', + 'modelEvaluationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelEvaluationFromModelEvaluationName', () => { + const result = + client.matchModelEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelEvaluationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-automl/test/gapic_prediction_service_v1beta1.ts b/packages/google-cloud-automl/test/gapic_prediction_service_v1beta1.ts new file mode 100644 index 00000000000..8a1b8804682 --- /dev/null +++ b/packages/google-cloud-automl/test/gapic_prediction_service_v1beta1.ts @@ -0,0 +1,986 @@ +// Copyright 2023 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 predictionserviceModule from '../src'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function 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); +} + +describe('v1beta1.PredictionServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + predictionserviceModule.v1beta1.PredictionServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + predictionserviceModule.v1beta1.PredictionServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = predictionserviceModule.v1beta1.PredictionServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.predictionServiceStub, undefined); + await client.initialize(); + assert(client.predictionServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.predictionServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.predictionServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + 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 predictionserviceModule.v1beta1.PredictionServiceClient({ + 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('predict', () => { + it('invokes predict without error', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.PredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.PredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.PredictResponse() + ); + client.innerApiCalls.predict = stubSimpleCall(expectedResponse); + const [response] = await client.predict(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes predict without error using callback', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.PredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.PredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.PredictResponse() + ); + client.innerApiCalls.predict = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.predict( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IPredictResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes predict with error', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.PredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.PredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.predict = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.predict(request), expectedError); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes predict with closed client', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.PredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.PredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.predict(request), expectedError); + }); + }); + + describe('batchPredict', () => { + it('invokes batchPredict without error', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.BatchPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.BatchPredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchPredict = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchPredict(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchPredict without error using callback', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.BatchPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.BatchPredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchPredict = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchPredict( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchPredict with call error', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.BatchPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.BatchPredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchPredict = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.batchPredict(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchPredict with LRO error', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.BatchPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.BatchPredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchPredict = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.batchPredict(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchPredictProgress without error', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + 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.checkBatchPredictProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchPredictProgress with error', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + 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.checkBatchPredictProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('Path templates', () => { + describe('annotationSpec', () => { + const fakePath = '/rendered/path/annotationSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + annotation_spec: 'annotationSpecValue', + }; + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'annotationSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = + client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'annotationSpecValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('columnSpec', () => { + const fakePath = '/rendered/path/columnSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + table_spec: 'tableSpecValue', + column_spec: 'columnSpecValue', + }; + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.columnSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.columnSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('columnSpecPath', () => { + const result = client.columnSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'tableSpecValue', + 'columnSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.columnSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromColumnSpecName', () => { + const result = client.matchProjectFromColumnSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.columnSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromColumnSpecName', () => { + const result = client.matchLocationFromColumnSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.columnSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromColumnSpecName', () => { + const result = client.matchDatasetFromColumnSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.columnSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTableSpecFromColumnSpecName', () => { + const result = client.matchTableSpecFromColumnSpecName(fakePath); + assert.strictEqual(result, 'tableSpecValue'); + assert( + (client.pathTemplates.columnSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchColumnSpecFromColumnSpecName', () => { + const result = client.matchColumnSpecFromColumnSpecName(fakePath); + assert.strictEqual(result, 'columnSpecValue'); + assert( + (client.pathTemplates.columnSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataset', () => { + const fakePath = '/rendered/path/dataset'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + }; + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + 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', + 'locationValue', + '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('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, 'locationValue'); + 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('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + }; + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath( + 'projectValue', + 'locationValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = '/rendered/path/modelEvaluation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + model_evaluation: 'modelEvaluationValue', + }; + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath( + 'projectValue', + 'locationValue', + 'modelValue', + 'modelEvaluationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelEvaluationFromModelEvaluationName', () => { + const result = + client.matchModelEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelEvaluationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tableSpec', () => { + const fakePath = '/rendered/path/tableSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + table_spec: 'tableSpecValue', + }; + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tableSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tableSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tableSpecPath', () => { + const result = client.tableSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'tableSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tableSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTableSpecName', () => { + const result = client.matchProjectFromTableSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tableSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTableSpecName', () => { + const result = client.matchLocationFromTableSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tableSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromTableSpecName', () => { + const result = client.matchDatasetFromTableSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.tableSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTableSpecFromTableSpecName', () => { + const result = client.matchTableSpecFromTableSpecName(fakePath); + assert.strictEqual(result, 'tableSpecValue'); + assert( + (client.pathTemplates.tableSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-automl/tsconfig.json b/packages/google-cloud-automl/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-automl/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-automl/webpack.config.js b/packages/google-cloud-automl/webpack.config.js new file mode 100644 index 00000000000..d8f4d4f6c9b --- /dev/null +++ b/packages/google-cloud-automl/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: 'automl', + filename: './automl.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 b90c33b23a0..7a0561668bf 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -1,6 +1,7 @@ { "initial-version": "0.1.0", "packages": { + "packages/google-ai-generativelanguage": {}, "packages/google-analytics-admin": {}, "packages/google-analytics-data": {}, "packages/google-api-apikeys": {}, @@ -10,11 +11,14 @@ "packages/google-appengine": {}, "packages/google-area120-tables": {}, "packages/google-cloud-accessapproval": {}, + "packages/google-cloud-advisorynotifications": {}, "packages/google-cloud-aiplatform": {}, + "packages/google-cloud-alloydb": {}, "packages/google-cloud-apigateway": {}, "packages/google-cloud-apigeeconnect": {}, "packages/google-cloud-asset": {}, "packages/google-cloud-assuredworkloads": {}, + "packages/google-cloud-automl": {}, "packages/google-cloud-baremetalsolution": {}, "packages/google-cloud-batch": {}, "packages/google-cloud-beyondcorp-appconnections": {}, @@ -34,7 +38,11 @@ "packages/google-cloud-certificatemanager": {}, "packages/google-cloud-channel": {}, "packages/google-cloud-clouddms": {}, + "packages/google-cloud-commerce-consumer-procurement": {}, "packages/google-cloud-compute": {}, + "packages/google-cloud-confidentialcomputing": {}, + "packages/google-cloud-config": {}, + "packages/google-cloud-connectors": {}, "packages/google-cloud-contactcenterinsights": {}, "packages/google-cloud-contentwarehouse": {}, "packages/google-cloud-datacatalog": {}, @@ -52,6 +60,7 @@ "packages/google-cloud-discoveryengine": {}, "packages/google-cloud-documentai": {}, "packages/google-cloud-domains": {}, + "packages/google-cloud-edgecontainer": {}, "packages/google-cloud-essentialcontacts": {}, "packages/google-cloud-eventarc": {}, "packages/google-cloud-eventarc-publishing": {}, @@ -66,16 +75,20 @@ "packages/google-cloud-ids": {}, "packages/google-cloud-iot": {}, "packages/google-cloud-kms": {}, + "packages/google-cloud-kms-inventory": {}, "packages/google-cloud-language": {}, "packages/google-cloud-lifesciences": {}, "packages/google-cloud-managedidentities": {}, "packages/google-cloud-mediatranslation": {}, "packages/google-cloud-memcache": {}, "packages/google-cloud-metastore": {}, + "packages/google-cloud-migrationcenter": {}, "packages/google-cloud-monitoring": {}, + "packages/google-cloud-netapp": {}, "packages/google-cloud-networkconnectivity": {}, "packages/google-cloud-networkmanagement": {}, "packages/google-cloud-networksecurity": {}, + "packages/google-cloud-networkservices": {}, "packages/google-cloud-notebooks": {}, "packages/google-cloud-optimization": {}, "packages/google-cloud-orchestration-airflow-service": {}, @@ -83,8 +96,11 @@ "packages/google-cloud-osconfig": {}, "packages/google-cloud-oslogin": {}, "packages/google-cloud-phishingprotection": {}, + "packages/google-cloud-policysimulator": {}, "packages/google-cloud-policytroubleshooter": {}, + "packages/google-cloud-policytroubleshooter-iam": {}, "packages/google-cloud-privatecatalog": {}, + "packages/google-cloud-rapidmigrationassessment": {}, "packages/google-cloud-recaptchaenterprise": {}, "packages/google-cloud-recommender": {}, "packages/google-cloud-redis": {}, @@ -100,6 +116,9 @@ "packages/google-cloud-servicedirectory": {}, "packages/google-cloud-shell": {}, "packages/google-cloud-speech": {}, + "packages/google-cloud-sql": {}, + "packages/google-cloud-storageinsights": {}, + "packages/google-cloud-support": {}, "packages/google-cloud-talent": {}, "packages/google-cloud-tasks": {}, "packages/google-cloud-texttospeech": {}, @@ -116,43 +135,25 @@ "packages/google-cloud-webrisk": {}, "packages/google-cloud-websecurityscanner": {}, "packages/google-cloud-workflows-executions": {}, + "packages/google-cloud-workstations": {}, "packages/google-container": {}, "packages/google-dataflow": {}, "packages/google-devtools-artifactregistry": {}, "packages/google-devtools-cloudbuild": {}, + "packages/google-devtools-cloudprofiler": {}, "packages/google-devtools-containeranalysis": {}, "packages/google-iam": {}, "packages/google-iam-credentials": {}, "packages/google-identity-accesscontextmanager": {}, "packages/google-maps-addressvalidation": {}, "packages/google-maps-mapsplatformdatasets": {}, + "packages/google-maps-places": {}, "packages/google-maps-routing": {}, "packages/google-monitoring-dashboard": {}, "packages/google-privacy-dlp": {}, "packages/google-storagetransfer": {}, "packages/grafeas": {}, - "packages/google-cloud-kms-inventory": {}, - "packages/google-cloud-advisorynotifications": {}, - "packages/typeless-sample-bot": {}, - "packages/google-cloud-alloydb": {}, - "packages/google-cloud-workstations": {}, - "packages/google-cloud-confidentialcomputing": {}, - "packages/google-ai-generativelanguage": {}, - "packages/google-cloud-storageinsights": {}, - "packages/google-cloud-support": {}, - "packages/google-maps-places": {}, - "packages/google-cloud-rapidmigrationassessment": {}, - "packages/google-cloud-migrationcenter": {}, - "packages/google-cloud-sql": {}, - "packages/google-cloud-commerce-consumer-procurement": {}, - "packages/google-cloud-policytroubleshooter-iam": {}, - "packages/google-cloud-config": {}, - "packages/google-cloud-netapp": {}, - "packages/google-cloud-connectors": {}, - "packages/google-cloud-policysimulator": {}, - "packages/google-cloud-edgecontainer": {}, - "packages/google-devtools-cloudprofiler": {}, - "packages/google-cloud-networkservices": {} + "packages/typeless-sample-bot": {} }, "plugins": [ {