diff --git a/packages/google-cloud-talent/.eslintignore b/packages/google-cloud-talent/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-talent/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-talent/.eslintrc.json b/packages/google-cloud-talent/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-talent/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-talent/.gitattributes b/packages/google-cloud-talent/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-talent/.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-talent/.github/.OwlBot.yaml b/packages/google-cloud-talent/.github/.OwlBot.yaml new file mode 100644 index 00000000000..eb2bb450c99 --- /dev/null +++ b/packages/google-cloud-talent/.github/.OwlBot.yaml @@ -0,0 +1,23 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +docker: + image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/talent/(.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 + diff --git a/packages/google-cloud-talent/.gitignore b/packages/google-cloud-talent/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-talent/.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-talent/.jsdoc.js b/packages/google-cloud-talent/.jsdoc.js new file mode 100644 index 00000000000..717c4717a57 --- /dev/null +++ b/packages/google-cloud-talent/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/talent', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-talent/.mocharc.js b/packages/google-cloud-talent/.mocharc.js new file mode 100644 index 00000000000..0b600509bed --- /dev/null +++ b/packages/google-cloud-talent/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/google-cloud-talent/.nycrc b/packages/google-cloud-talent/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-talent/.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-talent/.prettierignore b/packages/google-cloud-talent/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-talent/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-talent/.prettierrc.js b/packages/google-cloud-talent/.prettierrc.js new file mode 100644 index 00000000000..d1b95106f4c --- /dev/null +++ b/packages/google-cloud-talent/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-talent/.repo-metadata.json b/packages/google-cloud-talent/.repo-metadata.json new file mode 100644 index 00000000000..d0f244752eb --- /dev/null +++ b/packages/google-cloud-talent/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/talent/latest", + "api_id": "jobs.googleapis.com", + "distribution_name": "@google-cloud/talent", + "release_level": "stable", + "default_version": "v4", + "language": "nodejs", + "name_pretty": "Google Cloud Talent Solution", + "repo": "googleapis/nodejs-talent", + "product_documentation": "https://cloud.google.com/solutions/talent-solution/", + "requires_billing": true, + "name": "talent", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559664", + "api_shortname": "jobs", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-talent/CHANGELOG.md b/packages/google-cloud-talent/CHANGELOG.md new file mode 100644 index 00000000000..ba21a5f5b2b --- /dev/null +++ b/packages/google-cloud-talent/CHANGELOG.md @@ -0,0 +1,388 @@ +# Changelog + +[npm history][1] + +[1]: https://www.npmjs.com/package/@google-cloud/talent?activeTab=versions + +## [5.0.1](https://github.com/googleapis/nodejs-talent/compare/v5.0.0...v5.0.1) (2022-11-11) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#447](https://github.com/googleapis/nodejs-talent/issues/447)) ([49c2e64](https://github.com/googleapis/nodejs-talent/commit/49c2e64b364328a145899af100bf4e3c38f24548)) +* Regenerated protos JS and TS definitions ([#451](https://github.com/googleapis/nodejs-talent/issues/451)) ([adfce28](https://github.com/googleapis/nodejs-talent/commit/adfce2881da0f9c86279ed4cde0a9227072f0e19)) + +## [5.0.0](https://github.com/googleapis/nodejs-talent/compare/v4.1.1...v5.0.0) (2022-09-22) + + +### ⚠ BREAKING CHANGES + +* Remove LRO mixin methods where not needed (#443) +* Remove application and profile services from v4beta1 (#440) + +### Bug Fixes + +* Change import long to require ([#435](https://github.com/googleapis/nodejs-talent/issues/435)) ([27a132a](https://github.com/googleapis/nodejs-talent/commit/27a132aff0249d1edc05a10d4be16de6f8acc69f)) +* **deps:** Update dependency uuid to v9 ([#439](https://github.com/googleapis/nodejs-talent/issues/439)) ([ea9f3aa](https://github.com/googleapis/nodejs-talent/commit/ea9f3aa73bcffb0fc82555494fdf7207892fb798)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-talent/issues/1553)) ([#438](https://github.com/googleapis/nodejs-talent/issues/438)) ([d59378e](https://github.com/googleapis/nodejs-talent/commit/d59378e52295af4ef5757d8ae3e740b4fec0da44)) +* Remove application and profile services from v4beta1 ([#440](https://github.com/googleapis/nodejs-talent/issues/440)) ([c5fd3aa](https://github.com/googleapis/nodejs-talent/commit/c5fd3aa18796c9baeb6c0df2d67b8a6f0c01c954)) +* Remove LRO mixin methods where not needed ([#443](https://github.com/googleapis/nodejs-talent/issues/443)) ([bb6bd48](https://github.com/googleapis/nodejs-talent/commit/bb6bd48c42da8987f294f88959253d075204b1e8)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-talent/issues/1546)) ([#437](https://github.com/googleapis/nodejs-talent/issues/437)) ([f641557](https://github.com/googleapis/nodejs-talent/commit/f6415579ec3b8822f5d4a05004ee154b0870ecb8)) +* use google-gax v3.3.0 ([d59378e](https://github.com/googleapis/nodejs-talent/commit/d59378e52295af4ef5757d8ae3e740b4fec0da44)) + +## [4.1.1](https://github.com/googleapis/nodejs-talent/compare/v4.1.0...v4.1.1) (2022-07-12) + + +### Bug Fixes + +* update generator version ([#430](https://github.com/googleapis/nodejs-talent/issues/430)) ([ef5216c](https://github.com/googleapis/nodejs-talent/commit/ef5216cf865fef5106869e1c6acb9d29da249afe)) + +## [4.1.0](https://github.com/googleapis/nodejs-talent/compare/v4.0.0...v4.1.0) (2022-06-03) + + +### Features + +* Add a new operator on companyDisplayNames filter to further support fuzzy match by treating input value as a multi word token ([#422](https://github.com/googleapis/nodejs-talent/issues/422)) ([b8b2181](https://github.com/googleapis/nodejs-talent/commit/b8b2181826dbb93a8bd7f3eb4234fb65ae9b0573)) + +## [4.0.0](https://github.com/googleapis/nodejs-talent/compare/v3.5.1...v4.0.0) (2022-05-17) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#420) + +### Build System + +* update library to use Node 12 ([#420](https://github.com/googleapis/nodejs-talent/issues/420)) ([1032175](https://github.com/googleapis/nodejs-talent/commit/103217596c4e423f2e8c6b1b1a559f66ee40e2b7)) + +### [3.5.1](https://www.github.com/googleapis/nodejs-talent/compare/v3.5.0...v3.5.1) (2021-10-20) + + +### Bug Fixes + +* flaky sample test two ways ([#375](https://www.github.com/googleapis/nodejs-talent/issues/375)) ([d722bdb](https://www.github.com/googleapis/nodejs-talent/commit/d722bdb0523e8fb5907d4760b33ba75901572747)) + +## [3.5.0](https://www.github.com/googleapis/nodejs-talent/compare/v3.4.1...v3.5.0) (2021-09-15) + + +### Features + +* Added a new `KeywordMatchMode` field to support more keyword matching options feat: Added more `DiversificationLevel` configuration options ([#365](https://www.github.com/googleapis/nodejs-talent/issues/365)) ([bc2c5cf](https://www.github.com/googleapis/nodejs-talent/commit/bc2c5cfc7dd465dd476c027acd978e07ed18b298)) + +### [3.4.1](https://www.github.com/googleapis/nodejs-talent/compare/v3.4.0...v3.4.1) (2021-09-10) + + +### Bug Fixes + +* **build:** set default branch to main ([#362](https://www.github.com/googleapis/nodejs-talent/issues/362)) ([be3048a](https://www.github.com/googleapis/nodejs-talent/commit/be3048a67de34346b6e7ae3f6963c8fe437e3227)) + +## [3.4.0](https://www.github.com/googleapis/nodejs-talent/compare/v3.3.0...v3.4.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#359](https://www.github.com/googleapis/nodejs-talent/issues/359)) ([9796041](https://www.github.com/googleapis/nodejs-talent/commit/9796041914464e108afd8581aed7e60d5439e565)) + +## [3.3.0](https://www.github.com/googleapis/nodejs-talent/compare/v3.2.7...v3.3.0) (2021-08-17) + + +### Features + +* Add new commute methods in Search APIs feat: Add new histogram type 'publish_time_in_day' feat: Support filtering by requisitionId is ListJobs API ([#356](https://www.github.com/googleapis/nodejs-talent/issues/356)) ([6ff8783](https://www.github.com/googleapis/nodejs-talent/commit/6ff87834432014db8ddcdd0a1342346f85354d51)) + +### [3.2.7](https://www.github.com/googleapis/nodejs-talent/compare/v3.2.6...v3.2.7) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#355](https://www.github.com/googleapis/nodejs-talent/issues/355)) ([241f0ac](https://www.github.com/googleapis/nodejs-talent/commit/241f0ac2a3d49205feec269e0007d536df2fb367)) + +### [3.2.6](https://www.github.com/googleapis/nodejs-talent/compare/v3.2.5...v3.2.6) (2021-07-16) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#347](https://www.github.com/googleapis/nodejs-talent/issues/347)) ([cd75d00](https://www.github.com/googleapis/nodejs-talent/commit/cd75d006a631ebad4c4c4390a326fe30af074802)) + +### [3.2.5](https://www.github.com/googleapis/nodejs-talent/compare/v3.2.4...v3.2.5) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#345](https://www.github.com/googleapis/nodejs-talent/issues/345)) ([85c9f44](https://www.github.com/googleapis/nodejs-talent/commit/85c9f442fc9b2054af19e479ded0cb04f8846161)) + +### [3.2.4](https://www.github.com/googleapis/nodejs-talent/compare/v3.2.3...v3.2.4) (2021-06-30) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#341](https://www.github.com/googleapis/nodejs-talent/issues/341)) ([2c240e8](https://www.github.com/googleapis/nodejs-talent/commit/2c240e8cf02566285836b506addbfdfcc76cfa98)) + +### [3.2.3](https://www.github.com/googleapis/nodejs-talent/compare/v3.2.2...v3.2.3) (2021-06-22) + + +### Bug Fixes + +* make request optional in all cases ([#335](https://www.github.com/googleapis/nodejs-talent/issues/335)) ([7ba1f51](https://www.github.com/googleapis/nodejs-talent/commit/7ba1f51db25cf37b33f9a611e031c7294112649a)) + +### [3.2.2](https://www.github.com/googleapis/nodejs-talent/compare/v3.2.1...v3.2.2) (2021-05-25) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#324](https://www.github.com/googleapis/nodejs-talent/issues/324)) ([912fb40](https://www.github.com/googleapis/nodejs-talent/commit/912fb40b63085c1cde18b669b13be0a1c1422d4e)) + +### [3.2.1](https://www.github.com/googleapis/nodejs-talent/compare/v3.2.0...v3.2.1) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#315](https://www.github.com/googleapis/nodejs-talent/issues/315)) ([e2bb1fc](https://www.github.com/googleapis/nodejs-talent/commit/e2bb1fc5b03cd3ce7ca8c655012935aa83e37921)) +* use require() to load JSON protos ([#318](https://www.github.com/googleapis/nodejs-talent/issues/318)) ([d4e91b9](https://www.github.com/googleapis/nodejs-talent/commit/d4e91b9a623acfce93411a20a37c499b1a5bc3a5)) + +## [3.2.0](https://www.github.com/googleapis/nodejs-talent/compare/v3.1.0...v3.2.0) (2021-03-02) + + +### Features + +* **docs:** indicate library is ga ([#287](https://www.github.com/googleapis/nodejs-talent/issues/287)) ([5051732](https://www.github.com/googleapis/nodejs-talent/commit/5051732b4467ba33ecd44de1ef79cc5b655c7f36)) + +## [3.1.0](https://www.github.com/googleapis/nodejs-talent/compare/v3.0.2...v3.1.0) (2021-01-09) + + +### Features + +* adds style enumeration ([#281](https://www.github.com/googleapis/nodejs-talent/issues/281)) ([88651c2](https://www.github.com/googleapis/nodejs-talent/commit/88651c2a95638e685235fd8bdf478d4ce71ce941)) + +### [3.0.2](https://www.github.com/googleapis/nodejs-talent/compare/v3.0.1...v3.0.2) (2020-11-25) + + +### Bug Fixes + +* **browser:** check for fetch on window ([#274](https://www.github.com/googleapis/nodejs-talent/issues/274)) ([a25c71f](https://www.github.com/googleapis/nodejs-talent/commit/a25c71ff62a46138e088f01d5b9cd8b165588bbd)) + +### [3.0.1](https://www.github.com/googleapis/nodejs-talent/compare/v3.0.0...v3.0.1) (2020-11-07) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#264](https://www.github.com/googleapis/nodejs-talent/issues/264)) ([260b152](https://www.github.com/googleapis/nodejs-talent/commit/260b152fe76b2cbe63dba8378710716feb793c82)) + +## [3.0.0](https://www.github.com/googleapis/nodejs-talent/compare/v2.1.0...v3.0.0) (2020-10-13) + + +### ⚠ BREAKING CHANGES + +* moves v4 API to default (#243) + +### Features + +* moves v4 API to default ([#243](https://www.github.com/googleapis/nodejs-talent/issues/243)) ([72cc13a](https://www.github.com/googleapis/nodejs-talent/commit/72cc13a27bd53b5b949d8a909649705131feab59)) +* Remove commute methods from Job Search v4 API ([#249](https://www.github.com/googleapis/nodejs-talent/issues/249)) ([9e22b14](https://www.github.com/googleapis/nodejs-talent/commit/9e22b1492bbbbbd4b8eafb242de5e54ad842cd9c)) + +## [2.1.0](https://www.github.com/googleapis/nodejs-talent/compare/v2.0.0...v2.1.0) (2020-06-29) + + +### Features + +* **secrets:** begin migration to secret manager from keystore ([#213](https://www.github.com/googleapis/nodejs-talent/issues/213)) ([8cba7c3](https://www.github.com/googleapis/nodejs-talent/commit/8cba7c33ca1d631e7d369ec06ebf2bdf39530ffd)) + + +### Bug Fixes + +* handle fallback option properly ([#216](https://www.github.com/googleapis/nodejs-talent/issues/216)) ([ae2ecc5](https://www.github.com/googleapis/nodejs-talent/commit/ae2ecc51bc12fa410e766bd06e7668e51f01d627)) +* update node issue template ([#217](https://www.github.com/googleapis/nodejs-talent/issues/217)) ([82ece56](https://www.github.com/googleapis/nodejs-talent/commit/82ece56e1edce6e4074b6256aba9c858a00c6466)) + +## [2.0.0](https://www.github.com/googleapis/nodejs-talent/compare/v1.7.1...v2.0.0) (2020-06-04) + + +### ⚠ BREAKING CHANGES + +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. +* remove the ProjectOrTenant resource and its references +* removed auto-pagination from searchJobs +* move API to Typescript code generation (#163) + +### Features + +* check status of long running operation by its name ([#205](https://www.github.com/googleapis/nodejs-talent/issues/205)) ([66d3b2e](https://www.github.com/googleapis/nodejs-talent/commit/66d3b2e6c5c6293733a6aa209eb30d940b73dd8d)) +* deferred client initialization ([#171](https://www.github.com/googleapis/nodejs-talent/issues/171)) ([f5b2220](https://www.github.com/googleapis/nodejs-talent/commit/f5b222001c9510ccc0857322c6d9f9c67ec8c00c)) +* drop node8 support, support for async iterators ([#185](https://www.github.com/googleapis/nodejs-talent/issues/185)) ([cf2af92](https://www.github.com/googleapis/nodejs-talent/commit/cf2af92fef92ebf2e93a934117aed1c87a85ab6e)) +* move API to Typescript code generation ([#163](https://www.github.com/googleapis/nodejs-talent/issues/163)) ([81e9639](https://www.github.com/googleapis/nodejs-talent/commit/81e963990013ce0d0b6909243621befac1a15e75)) +* removed auto-pagination from searchJobs ([28c9234](https://www.github.com/googleapis/nodejs-talent/commit/28c92340ffa1c5f3800d85247cda578608a7125e)) + + +### Bug Fixes + +* export explicit version from protos.js ([#189](https://www.github.com/googleapis/nodejs-talent/issues/189)) ([64d8de6](https://www.github.com/googleapis/nodejs-talent/commit/64d8de6ea8a5fd3fc9128e8ec21408f9fa65408e)) +* remove eslint, update gax, fix generated protos, run the generator ([#194](https://www.github.com/googleapis/nodejs-talent/issues/194)) ([cbef571](https://www.github.com/googleapis/nodejs-talent/commit/cbef5715a1d85ac19bbad76b3a5ebfecbb9f2ee5)) +* synth.py clean up for multiple version ([#207](https://www.github.com/googleapis/nodejs-talent/issues/207)) ([49c403a](https://www.github.com/googleapis/nodejs-talent/commit/49c403a44748d52bd4bf663c016b7584afab6b3a)) + + +### Code Refactoring + +* remove the ProjectOrTenant resource and its references ([3784e63](https://www.github.com/googleapis/nodejs-talent/commit/3784e63807b9c102b10b2f1d608ec9601bcc59e3)) + +### [1.7.1](https://www.github.com/googleapis/nodejs-talent/compare/v1.7.0...v1.7.1) (2020-01-29) + + +### Bug Fixes + +* enum, bytes, and Long types now accept strings ([15f03b7](https://www.github.com/googleapis/nodejs-talent/commit/15f03b7fce125422207467fbb40e21f9054fa75e)) + +## [1.7.0](https://www.github.com/googleapis/nodejs-talent/compare/v1.6.2...v1.7.0) (2020-01-28) + + +### Features + +* adds new type annotations ([341e495](https://www.github.com/googleapis/nodejs-talent/commit/341e4957b7586986c9a141b63913942881510a67)) + +### [1.6.2](https://www.github.com/googleapis/nodejs-talent/compare/v1.6.1...v1.6.2) (2019-12-31) + + +### Bug Fixes + +* **deps:** pin TypeScript below 3.7.0 ([1166c22](https://www.github.com/googleapis/nodejs-talent/commit/1166c22a68aab561c0dcf85ae051f6d1cdc66c88)) +* adds missing proto import ([220bec0](https://www.github.com/googleapis/nodejs-talent/commit/220bec0d190419ab24724eb678002a734dc2488d)) +* import long type into proto ts declaration file ([#127](https://www.github.com/googleapis/nodejs-talent/issues/127)) ([c4b9e4a](https://www.github.com/googleapis/nodejs-talent/commit/c4b9e4a12bbbe0ff55b3fd6c9fd73ea180013d26)) + +### [1.6.1](https://www.github.com/googleapis/nodejs-talent/compare/v1.6.0...v1.6.1) (2019-11-15) + + +### Bug Fixes + +* **docs:** bump release level to beta ([#124](https://www.github.com/googleapis/nodejs-talent/issues/124)) ([f5f0ab9](https://www.github.com/googleapis/nodejs-talent/commit/f5f0ab92034eb6f52b13c180b05faaed4c02de91)) +* **docs:** snippets are now replaced in jsdoc comments ([#122](https://www.github.com/googleapis/nodejs-talent/issues/122)) ([9f8af78](https://www.github.com/googleapis/nodejs-talent/commit/9f8af789a2275bae0268d5589aa1a7c4ef00e831)) + +## [1.6.0](https://www.github.com/googleapis/nodejs-talent/compare/v1.5.1...v1.6.0) (2019-11-08) + + +### Features + +* add query language code parameter ([#118](https://www.github.com/googleapis/nodejs-talent/issues/118)) ([71845bf](https://www.github.com/googleapis/nodejs-talent/commit/71845bf76d677268ec1a17d926da6fb1fadef930)) + +### [1.5.1](https://www.github.com/googleapis/nodejs-talent/compare/v1.5.0...v1.5.1) (2019-10-22) + + +### Bug Fixes + +* **deps:** bump google-gax to 1.7.5 ([#114](https://www.github.com/googleapis/nodejs-talent/issues/114)) ([2ea4371](https://www.github.com/googleapis/nodejs-talent/commit/2ea43715fff4d9a0704c8629b0ba04269834db0a)) + +## [1.5.0](https://www.github.com/googleapis/nodejs-talent/compare/v1.4.0...v1.5.0) (2019-10-09) + + +### Bug Fixes + +* use compatible version of google-gax ([1100369](https://www.github.com/googleapis/nodejs-talent/commit/1100369)) + + +### Features + +* .d.ts for protos ([fa78385](https://www.github.com/googleapis/nodejs-talent/commit/fa78385)) +* .d.ts for protos ([#104](https://www.github.com/googleapis/nodejs-talent/issues/104)) ([cda77b7](https://www.github.com/googleapis/nodejs-talent/commit/cda77b7)) + +## [1.4.0](https://www.github.com/googleapis/nodejs-talent/compare/v1.3.0...v1.4.0) (2019-09-16) + + +### Features + +* candidate applications and assignments support ([#98](https://www.github.com/googleapis/nodejs-talent/issues/98)) ([0a9e8c1](https://www.github.com/googleapis/nodejs-talent/commit/0a9e8c1)) +* filter support ([#97](https://www.github.com/googleapis/nodejs-talent/issues/97)) ([3496527](https://www.github.com/googleapis/nodejs-talent/commit/3496527)) +* load protos from JSON, grpc-fallback support ([a0cee41](https://www.github.com/googleapis/nodejs-talent/commit/a0cee41)) + +## [1.3.0](https://www.github.com/googleapis/nodejs-talent/compare/v1.2.0...v1.3.0) (2019-08-08) + + +### Features + +* allow calls with no request; adds JSON proto; introduces PersonNameFilter ([51b0a58](https://www.github.com/googleapis/nodejs-talent/commit/51b0a58)) + +## [1.2.0](https://www.github.com/googleapis/nodejs-talent/compare/v1.1.0...v1.2.0) (2019-07-16) + + +### Features + +* add new filters, path templates, and update docs ([#76](https://www.github.com/googleapis/nodejs-talent/issues/76)) ([f28802c](https://www.github.com/googleapis/nodejs-talent/commit/f28802c)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-talent/compare/v1.0.2...v1.1.0) (2019-06-28) + + +### Features + +* batch operation support ([#69](https://www.github.com/googleapis/nodejs-talent/issues/69)) ([9c76a71](https://www.github.com/googleapis/nodejs-talent/commit/9c76a71)) + +### [1.0.2](https://www.github.com/googleapis/nodejs-talent/compare/v1.0.1...v1.0.2) (2019-06-26) + + +### Bug Fixes + +* **docs:** link to reference docs section on googleapis.dev ([#71](https://www.github.com/googleapis/nodejs-talent/issues/71)) ([e2d0791](https://www.github.com/googleapis/nodejs-talent/commit/e2d0791)) + +### [1.0.1](https://www.github.com/googleapis/nodejs-talent/compare/v1.0.0...v1.0.1) (2019-06-13) + + +### Bug Fixes + +* **docs:** move to new client docs URL ([#67](https://www.github.com/googleapis/nodejs-talent/issues/67)) ([6434066](https://www.github.com/googleapis/nodejs-talent/commit/6434066)) + +## [1.0.0](https://www.github.com/googleapis/nodejs-talent/compare/v0.3.0...v1.0.0) (2019-05-14) + + +### Bug Fixes + +* use SummarizedProfile over HistogramQueryResult ([#54](https://www.github.com/googleapis/nodejs-talent/issues/54)) ([87036f0](https://www.github.com/googleapis/nodejs-talent/commit/87036f0)) +* **deps:** update dependency google-gax to v1 ([#51](https://www.github.com/googleapis/nodejs-talent/issues/51)) ([4ad1db5](https://www.github.com/googleapis/nodejs-talent/commit/4ad1db5)) +* DEADLINE_EXCEEDED is idempotent ([#52](https://www.github.com/googleapis/nodejs-talent/issues/52)) ([6f8dd1b](https://www.github.com/googleapis/nodejs-talent/commit/6f8dd1b)) + +## [0.3.0](https://www.github.com/googleapis/nodejs-talent/compare/v0.2.0...v0.3.0) (2019-05-09) + + +### Bug Fixes + +* **deps:** update dependency google-gax to ^0.26.0 ([#40](https://www.github.com/googleapis/nodejs-talent/issues/40)) ([3ae00c8](https://www.github.com/googleapis/nodejs-talent/commit/3ae00c8)) + + +### Build System + +* upgrade engines field to >=8.10.0 ([#41](https://www.github.com/googleapis/nodejs-talent/issues/41)) ([4fdec5e](https://www.github.com/googleapis/nodejs-talent/commit/4fdec5e)) + + +### Features + +* add Resume and keywordSearchableProfileCustomAttributes ([#49](https://www.github.com/googleapis/nodejs-talent/issues/49)) ([d96a482](https://www.github.com/googleapis/nodejs-talent/commit/d96a482)) +* add templates for company old path ([03c6bc5](https://www.github.com/googleapis/nodejs-talent/commit/03c6bc5)) + + +### BREAKING CHANGES + +* upgrade engines field to >=8.10.0 (#41) + +## v0.2.0 + +03-29-2019 13:05 PDT + +### Implementation Changes + +**🚨 BREAKING CHANGE 🚨** + +This release includes several breaking changes since v0.1.0: + +- Removes `ResumeServiceClient`. +- Removes support for any string template paths relating to `projectPath` and `companyPath`, it now supports `tenantPath` and `companyOldPath` instead. + +### New Features +- feat: v4beta1 application support and proto sync ([#29](https://github.com/googleapis/nodejs-talent/pull/29)) + - Adds `ApplicationServiceClient` + +### Documentation +- docs: fix broken urls in proto comments ([#22](https://github.com/googleapis/nodejs-talent/pull/22)) + +### Internal / Testing Changes +- chore: publish to npm using wombat ([#25](https://github.com/googleapis/nodejs-talent/pull/25)) +- build: use per-repo npm publish token ([#23](https://github.com/googleapis/nodejs-talent/pull/23)) + +## v0.1.0 + +03-12-2019 21:57 PDT + +First release! diff --git a/packages/google-cloud-talent/CODE_OF_CONDUCT.md b/packages/google-cloud-talent/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-talent/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-talent/CONTRIBUTING.md b/packages/google-cloud-talent/CONTRIBUTING.md new file mode 100644 index 00000000000..fb785dc496e --- /dev/null +++ b/packages/google-cloud-talent/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google Cloud Talent Solution 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=jobs.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-talent/LICENSE b/packages/google-cloud-talent/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-talent/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-talent/README.md b/packages/google-cloud-talent/README.md new file mode 100644 index 00000000000..9b8291f2faf --- /dev/null +++ b/packages/google-cloud-talent/README.md @@ -0,0 +1,126 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google Cloud Talent Solution: Node.js Client](https://github.com/googleapis/nodejs-talent) + +[![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/talent.svg)](https://www.npmjs.org/package/@google-cloud/talent) + + + + +Cloud Talent Solution API client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-talent/blob/main/CHANGELOG.md). + +* [Google Cloud Talent Solution Node.js Client API Reference][client-docs] +* [Google Cloud Talent Solution Documentation][product-docs] +* [github.com/googleapis/nodejs-talent](https://github.com/googleapis/nodejs-talent) + +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) + + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google Cloud Talent Solution 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/talent +``` + + + + + +The [Google Cloud Talent Solution Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/talent@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-talent/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-talent/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/talent/latest +[product-docs]: https://cloud.google.com/solutions/talent-solution/ +[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=jobs.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-talent/linkinator.config.json b/packages/google-cloud-talent/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-cloud-talent/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-talent/package.json b/packages/google-cloud-talent/package.json new file mode 100644 index 00000000000..576d3da2046 --- /dev/null +++ b/packages/google-cloud-talent/package.json @@ -0,0 +1,67 @@ +{ + "name": "@google-cloud/talent", + "description": "Cloud Talent Solution API client for Node.js", + "version": "5.0.1", + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "repository": "googleapis/nodejs-talent", + "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 jobs", + "jobs", + "Cloud Talent Solution API" + ], + "scripts": { + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", + "system-test": "mocha build/system-test", + "lint": "gts check", + "fix": "gts fix", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "prelint": "cd samples; npm link ../; npm install", + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "prepare": "npm run compile-protos && npm run compile", + "precompile": "gts clean" + }, + "dependencies": { + "google-gax": "^3.5.2" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^18.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.0.0", + "gts": "^3.1.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4", + "webpack": "^5.0.0", + "webpack-cli": "^4.0.0" + } +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4/common.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4/common.proto new file mode 100644 index 00000000000..79dbb2d5c13 --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4/common.proto @@ -0,0 +1,870 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/type/latlng.proto"; +import "google/type/money.proto"; +import "google/type/postal_address.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4;talent"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.talent.v4"; +option objc_class_prefix = "CTS"; + +// Message representing a period of time between two timestamps. +message TimestampRange { + // Begin of the period (inclusive). + google.protobuf.Timestamp start_time = 1; + + // End of the period (exclusive). + google.protobuf.Timestamp end_time = 2; +} + +// An enum that represents the size of the company. +enum CompanySize { + // Default value if the size isn't specified. + COMPANY_SIZE_UNSPECIFIED = 0; + + // The company has less than 50 employees. + MINI = 1; + + // The company has between 50 and 99 employees. + SMALL = 2; + + // The company has between 100 and 499 employees. + SMEDIUM = 3; + + // The company has between 500 and 999 employees. + MEDIUM = 4; + + // The company has between 1,000 and 4,999 employees. + BIG = 5; + + // The company has between 5,000 and 9,999 employees. + BIGGER = 6; + + // The company has 10,000 or more employees. + GIANT = 7; +} + +// An enum that represents employee benefits included with the job. +enum JobBenefit { + // Default value if the type isn't specified. + JOB_BENEFIT_UNSPECIFIED = 0; + + // The job includes access to programs that support child care, such + // as daycare. + CHILD_CARE = 1; + + // The job includes dental services covered by a dental + // insurance plan. + DENTAL = 2; + + // The job offers specific benefits to domestic partners. + DOMESTIC_PARTNER = 3; + + // The job allows for a flexible work schedule. + FLEXIBLE_HOURS = 4; + + // The job includes health services covered by a medical insurance plan. + MEDICAL = 5; + + // The job includes a life insurance plan provided by the employer or + // available for purchase by the employee. + LIFE_INSURANCE = 6; + + // The job allows for a leave of absence to a parent to care for a newborn + // child. + PARENTAL_LEAVE = 7; + + // The job includes a workplace retirement plan provided by the + // employer or available for purchase by the employee. + RETIREMENT_PLAN = 8; + + // The job allows for paid time off due to illness. + SICK_DAYS = 9; + + // The job includes paid time off for vacation. + VACATION = 10; + + // The job includes vision services covered by a vision + // insurance plan. + VISION = 11; +} + +// Educational degree level defined in International Standard Classification +// of Education (ISCED). +enum DegreeType { + // Default value. Represents no degree, or early childhood education. + // Maps to ISCED code 0. + // Ex) Kindergarten + DEGREE_TYPE_UNSPECIFIED = 0; + + // Primary education which is typically the first stage of compulsory + // education. ISCED code 1. + // Ex) Elementary school + PRIMARY_EDUCATION = 1; + + // Lower secondary education; First stage of secondary education building on + // primary education, typically with a more subject-oriented curriculum. + // ISCED code 2. + // Ex) Middle school + LOWER_SECONDARY_EDUCATION = 2; + + // Middle education; Second/final stage of secondary education preparing for + // tertiary education and/or providing skills relevant to employment. + // Usually with an increased range of subject options and streams. ISCED + // code 3. + // Ex) High school + UPPER_SECONDARY_EDUCATION = 3; + + // Adult Remedial Education; Programmes providing learning experiences that + // build on secondary education and prepare for labour market entry and/or + // tertiary education. The content is broader than secondary but not as + // complex as tertiary education. ISCED code 4. + ADULT_REMEDIAL_EDUCATION = 4; + + // Associate's or equivalent; Short first tertiary programmes that are + // typically practically-based, occupationally-specific and prepare for + // labour market entry. These programmes may also provide a pathway to other + // tertiary programmes. ISCED code 5. + ASSOCIATES_OR_EQUIVALENT = 5; + + // Bachelor's or equivalent; Programmes designed to provide intermediate + // academic and/or professional knowledge, skills and competencies leading + // to a first tertiary degree or equivalent qualification. ISCED code 6. + BACHELORS_OR_EQUIVALENT = 6; + + // Master's or equivalent; Programmes designed to provide advanced academic + // and/or professional knowledge, skills and competencies leading to a + // second tertiary degree or equivalent qualification. ISCED code 7. + MASTERS_OR_EQUIVALENT = 7; + + // Doctoral or equivalent; Programmes designed primarily to lead to an + // advanced research qualification, usually concluding with the submission + // and defense of a substantive dissertation of publishable quality based on + // original research. ISCED code 8. + DOCTORAL_OR_EQUIVALENT = 8; +} + +// An enum that represents the employment type of a job. +enum EmploymentType { + // The default value if the employment type isn't specified. + EMPLOYMENT_TYPE_UNSPECIFIED = 0; + + // The job requires working a number of hours that constitute full + // time employment, typically 40 or more hours per week. + FULL_TIME = 1; + + // The job entails working fewer hours than a full time job, + // typically less than 40 hours a week. + PART_TIME = 2; + + // The job is offered as a contracted, as opposed to a salaried employee, + // position. + CONTRACTOR = 3; + + // The job is offered as a contracted position with the understanding + // that it's converted into a full-time position at the end of the + // contract. Jobs of this type are also returned by a search for + // [EmploymentType.CONTRACTOR][google.cloud.talent.v4.EmploymentType.CONTRACTOR] jobs. + CONTRACT_TO_HIRE = 4; + + // The job is offered as a temporary employment opportunity, usually + // a short-term engagement. + TEMPORARY = 5; + + // The job is a fixed-term opportunity for students or entry-level job + // seekers to obtain on-the-job training, typically offered as a summer + // position. + INTERN = 6; + + // The is an opportunity for an individual to volunteer, where there's no + // expectation of compensation for the provided services. + VOLUNTEER = 7; + + // The job requires an employee to work on an as-needed basis with a + // flexible schedule. + PER_DIEM = 8; + + // The job involves employing people in remote areas and flying them + // temporarily to the work site instead of relocating employees and their + // families permanently. + FLY_IN_FLY_OUT = 9; + + // The job does not fit any of the other listed types. + OTHER_EMPLOYMENT_TYPE = 10; +} + +// An enum that represents the required experience level required for the job. +enum JobLevel { + // The default value if the level isn't specified. + JOB_LEVEL_UNSPECIFIED = 0; + + // Entry-level individual contributors, typically with less than 2 years of + // experience in a similar role. Includes interns. + ENTRY_LEVEL = 1; + + // Experienced individual contributors, typically with 2+ years of + // experience in a similar role. + EXPERIENCED = 2; + + // Entry- to mid-level managers responsible for managing a team of people. + MANAGER = 3; + + // Senior-level managers responsible for managing teams of managers. + DIRECTOR = 4; + + // Executive-level managers and above, including C-level positions. + EXECUTIVE = 5; +} + +// An enum that represents the categorization or primary focus of specific +// role. This value is different than the "industry" associated with a role, +// which is related to the categorization of the company listing the job. +enum JobCategory { + // The default value if the category isn't specified. + JOB_CATEGORY_UNSPECIFIED = 0; + + // An accounting and finance job, such as an Accountant. + ACCOUNTING_AND_FINANCE = 1; + + // An administrative and office job, such as an Administrative Assistant. + ADMINISTRATIVE_AND_OFFICE = 2; + + // An advertising and marketing job, such as Marketing Manager. + ADVERTISING_AND_MARKETING = 3; + + // An animal care job, such as Veterinarian. + ANIMAL_CARE = 4; + + // An art, fashion, or design job, such as Designer. + ART_FASHION_AND_DESIGN = 5; + + // A business operations job, such as Business Operations Manager. + BUSINESS_OPERATIONS = 6; + + // A cleaning and facilities job, such as Custodial Staff. + CLEANING_AND_FACILITIES = 7; + + // A computer and IT job, such as Systems Administrator. + COMPUTER_AND_IT = 8; + + // A construction job, such as General Laborer. + CONSTRUCTION = 9; + + // A customer service job, such s Cashier. + CUSTOMER_SERVICE = 10; + + // An education job, such as School Teacher. + EDUCATION = 11; + + // An entertainment and travel job, such as Flight Attendant. + ENTERTAINMENT_AND_TRAVEL = 12; + + // A farming or outdoor job, such as Park Ranger. + FARMING_AND_OUTDOORS = 13; + + // A healthcare job, such as Registered Nurse. + HEALTHCARE = 14; + + // A human resources job, such as Human Resources Director. + HUMAN_RESOURCES = 15; + + // An installation, maintenance, or repair job, such as Electrician. + INSTALLATION_MAINTENANCE_AND_REPAIR = 16; + + // A legal job, such as Law Clerk. + LEGAL = 17; + + // A management job, often used in conjunction with another category, + // such as Store Manager. + MANAGEMENT = 18; + + // A manufacturing or warehouse job, such as Assembly Technician. + MANUFACTURING_AND_WAREHOUSE = 19; + + // A media, communications, or writing job, such as Media Relations. + MEDIA_COMMUNICATIONS_AND_WRITING = 20; + + // An oil, gas or mining job, such as Offshore Driller. + OIL_GAS_AND_MINING = 21; + + // A personal care and services job, such as Hair Stylist. + PERSONAL_CARE_AND_SERVICES = 22; + + // A protective services job, such as Security Guard. + PROTECTIVE_SERVICES = 23; + + // A real estate job, such as Buyer's Agent. + REAL_ESTATE = 24; + + // A restaurant and hospitality job, such as Restaurant Server. + RESTAURANT_AND_HOSPITALITY = 25; + + // A sales and/or retail job, such Sales Associate. + SALES_AND_RETAIL = 26; + + // A science and engineering job, such as Lab Technician. + SCIENCE_AND_ENGINEERING = 27; + + // A social services or non-profit job, such as Case Worker. + SOCIAL_SERVICES_AND_NON_PROFIT = 28; + + // A sports, fitness, or recreation job, such as Personal Trainer. + SPORTS_FITNESS_AND_RECREATION = 29; + + // A transportation or logistics job, such as Truck Driver. + TRANSPORTATION_AND_LOGISTICS = 30; +} + +// An enum that represents the job posting region. In most cases, job postings +// don't need to specify a region. If a region is given, jobs are +// eligible for searches in the specified region. +enum PostingRegion { + // If the region is unspecified, the job is only returned if it + // matches the [LocationFilter][google.cloud.talent.v4.LocationFilter]. + POSTING_REGION_UNSPECIFIED = 0; + + // In addition to exact location matching, job posting is returned when the + // [LocationFilter][google.cloud.talent.v4.LocationFilter] in the search query is in the same administrative area + // as the returned job posting. For example, if a `ADMINISTRATIVE_AREA` job + // is posted in "CA, USA", it's returned if [LocationFilter][google.cloud.talent.v4.LocationFilter] has + // "Mountain View". + // + // Administrative area refers to top-level administrative subdivision of this + // country. For example, US state, IT region, UK constituent nation and + // JP prefecture. + ADMINISTRATIVE_AREA = 1; + + // In addition to exact location matching, job is returned when + // [LocationFilter][google.cloud.talent.v4.LocationFilter] in search query is in the same country as this job. + // For example, if a `NATION_WIDE` job is posted in "USA", it's + // returned if [LocationFilter][google.cloud.talent.v4.LocationFilter] has 'Mountain View'. + NATION = 2; + + // Job allows employees to work remotely (telecommute). + // If locations are provided with this value, the job is + // considered as having a location, but telecommuting is allowed. + TELECOMMUTE = 3; +} + +// Deprecated. All resources are only visible to the owner. +// +// An enum that represents who has view access to the resource. +enum Visibility { + option deprecated = true; + + // Default value. + VISIBILITY_UNSPECIFIED = 0; + + // The resource is only visible to the GCP account who owns it. + ACCOUNT_ONLY = 1; + + // The resource is visible to the owner and may be visible to other + // applications and processes at Google. + SHARED_WITH_GOOGLE = 2; + + // The resource is visible to the owner and may be visible to all other API + // clients. + SHARED_WITH_PUBLIC = 3; +} + +// Option for HTML content sanitization on user input fields, for example, job +// description. By setting this option, user can determine whether and how +// sanitization is performed on these fields. +enum HtmlSanitization { + // Default value. + HTML_SANITIZATION_UNSPECIFIED = 0; + + // Disables sanitization on HTML input. + HTML_SANITIZATION_DISABLED = 1; + + // Sanitizes HTML input, only accepts bold, italic, ordered list, and + // unordered list markup tags. + SIMPLE_FORMATTING_ONLY = 2; +} + +// Method for commute. Walking, biking and wheelchair accessible transit is +// still in the Preview stage. +enum CommuteMethod { + // Commute method isn't specified. + COMMUTE_METHOD_UNSPECIFIED = 0; + + // Commute time is calculated based on driving time. + DRIVING = 1; + + // Commute time is calculated based on public transit including bus, metro, + // subway, and so on. + TRANSIT = 2; + + // Commute time is calculated based on walking time. + WALKING = 3; + + // Commute time is calculated based on biking time. + CYCLING = 4; + + // Commute time is calculated based on public transit that is wheelchair + // accessible. + TRANSIT_ACCESSIBLE = 5; +} + +// A resource that represents a location with full geographic information. +message Location { + // An enum which represents the type of a location. + enum LocationType { + // Default value if the type isn't specified. + LOCATION_TYPE_UNSPECIFIED = 0; + + // A country level location. + COUNTRY = 1; + + // A state or equivalent level location. + ADMINISTRATIVE_AREA = 2; + + // A county or equivalent level location. + SUB_ADMINISTRATIVE_AREA = 3; + + // A city or equivalent level location. + LOCALITY = 4; + + // A postal code level location. + POSTAL_CODE = 5; + + // A sublocality is a subdivision of a locality, for example a city borough, + // ward, or arrondissement. Sublocalities are usually recognized by a local + // political authority. For example, Manhattan and Brooklyn are recognized + // as boroughs by the City of New York, and are therefore modeled as + // sublocalities. + SUB_LOCALITY = 6; + + // A district or equivalent level location. + SUB_LOCALITY_1 = 7; + + // A smaller district or equivalent level display. + SUB_LOCALITY_2 = 8; + + // A neighborhood level location. + NEIGHBORHOOD = 9; + + // A street address level location. + STREET_ADDRESS = 10; + } + + // The type of a location, which corresponds to the address lines field of + // [google.type.PostalAddress][google.type.PostalAddress]. For example, "Downtown, Atlanta, GA, USA" + // has a type of [LocationType.NEIGHBORHOOD][google.cloud.talent.v4.Location.LocationType.NEIGHBORHOOD], and "Kansas City, KS, USA" + // has a type of [LocationType.LOCALITY][google.cloud.talent.v4.Location.LocationType.LOCALITY]. + LocationType location_type = 1; + + // Postal address of the location that includes human readable information, + // such as postal delivery and payments addresses. Given a postal address, + // a postal service can deliver items to a premises, P.O. Box, or other + // delivery location. + google.type.PostalAddress postal_address = 2; + + // An object representing a latitude/longitude pair. + google.type.LatLng lat_lng = 3; + + // Radius in miles of the job location. This value is derived from the + // location bounding box in which a circle with the specified radius + // centered from [google.type.LatLng][google.type.LatLng] covers the area associated with the + // job location. + // For example, currently, "Mountain View, CA, USA" has a radius of + // 6.17 miles. + double radius_miles = 4; +} + +// Meta information related to the job searcher or entity +// conducting the job search. This information is used to improve the +// performance of the service. +message RequestMetadata { + // Required if [allow_missing_ids][google.cloud.talent.v4.RequestMetadata.allow_missing_ids] is unset or `false`. + // + // The client-defined scope or source of the service call, which typically + // is the domain on + // which the service has been implemented and is currently being run. + // + // For example, if the service is being run by client Foo, Inc., on + // job board www.foo.com and career site www.bar.com, then this field is + // set to "foo.com" for use on the job board, and "bar.com" for use on the + // career site. + // + // Note that any improvements to the model for a particular tenant site rely + // on this field being set correctly to a unique domain. + // + // The maximum number of allowed characters is 255. + string domain = 1; + + // Required if [allow_missing_ids][google.cloud.talent.v4.RequestMetadata.allow_missing_ids] is unset or `false`. + // + // A unique session identification string. A session is defined as the + // duration of an end user's interaction with the service over a certain + // period. + // Obfuscate this field for privacy concerns before + // providing it to the service. + // + // Note that any improvements to the model for a particular tenant site rely + // on this field being set correctly to a unique session ID. + // + // The maximum number of allowed characters is 255. + string session_id = 2; + + // Required if [allow_missing_ids][google.cloud.talent.v4.RequestMetadata.allow_missing_ids] is unset or `false`. + // + // A unique user identification string, as determined by the client. + // To have the strongest positive impact on search quality + // make sure the client-level is unique. + // Obfuscate this field for privacy concerns before + // providing it to the service. + // + // Note that any improvements to the model for a particular tenant site rely + // on this field being set correctly to a unique user ID. + // + // The maximum number of allowed characters is 255. + string user_id = 3; + + // Only set when any of [domain][google.cloud.talent.v4.RequestMetadata.domain], [session_id][google.cloud.talent.v4.RequestMetadata.session_id] and [user_id][google.cloud.talent.v4.RequestMetadata.user_id] isn't + // available for some reason. It is highly recommended not to set this field + // and provide accurate [domain][google.cloud.talent.v4.RequestMetadata.domain], [session_id][google.cloud.talent.v4.RequestMetadata.session_id] and [user_id][google.cloud.talent.v4.RequestMetadata.user_id] for the + // best service experience. + bool allow_missing_ids = 4; + + // The type of device used by the job seeker at the time of the call to the + // service. + DeviceInfo device_info = 5; +} + +// Additional information returned to client, such as debugging information. +message ResponseMetadata { + // A unique id associated with this call. + // This id is logged for tracking purposes. + string request_id = 1; +} + +// Device information collected from the job seeker, candidate, or +// other entity conducting the job search. Providing this information improves +// the quality of the search results across devices. +message DeviceInfo { + // An enumeration describing an API access portal and exposure mechanism. + enum DeviceType { + // The device type isn't specified. + DEVICE_TYPE_UNSPECIFIED = 0; + + // A desktop web browser, such as, Chrome, Firefox, Safari, or Internet + // Explorer) + WEB = 1; + + // A mobile device web browser, such as a phone or tablet with a Chrome + // browser. + MOBILE_WEB = 2; + + // An Android device native application. + ANDROID = 3; + + // An iOS device native application. + IOS = 4; + + // A bot, as opposed to a device operated by human beings, such as a web + // crawler. + BOT = 5; + + // Other devices types. + OTHER = 6; + } + + // Type of the device. + DeviceType device_type = 1; + + // A device-specific ID. The ID must be a unique identifier that + // distinguishes the device from other devices. + string id = 2; +} + +// Custom attribute values that are either filterable or non-filterable. +message CustomAttribute { + // Exactly one of [string_values][google.cloud.talent.v4.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4.CustomAttribute.long_values] must be specified. + // + // This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or + // `CASE_INSENSITIVE_MATCH`) search. + // For filterable `string_value`s, a maximum total number of 200 values + // is allowed, with each `string_value` has a byte size of no more than + // 500B. For unfilterable `string_values`, the maximum total byte size of + // unfilterable `string_values` is 50KB. + // + // Empty string isn't allowed. + repeated string string_values = 1; + + // Exactly one of [string_values][google.cloud.talent.v4.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4.CustomAttribute.long_values] must be specified. + // + // This field is used to perform number range search. + // (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`. + // + // Currently at most 1 [long_values][google.cloud.talent.v4.CustomAttribute.long_values] is supported. + repeated int64 long_values = 2; + + // If the `filterable` flag is true, the custom field values may be used for + // custom attribute filters [JobQuery.custom_attribute_filter][google.cloud.talent.v4.JobQuery.custom_attribute_filter]. + // If false, these values may not be used for custom attribute filters. + // + // Default is false. + bool filterable = 3; + + // If the `keyword_searchable` flag is true, the keywords in custom fields are + // searchable by keyword match. + // If false, the values are not searchable by keyword match. + // + // Default is false. + bool keyword_searchable = 4; +} + +// Spell check result. +message SpellingCorrection { + // Indicates if the query was corrected by the spell checker. + bool corrected = 1; + + // Correction output consisting of the corrected keyword string. + string corrected_text = 2; + + // Corrected output with html tags to highlight the corrected words. + // Corrected words are called out with the "..." html tags. + // + // For example, the user input query is "software enginear", where the second + // word, "enginear," is incorrect. It should be "engineer". When spelling + // correction is enabled, this value is + // "software engineer". + string corrected_html = 3; +} + +// Job compensation details. +message CompensationInfo { + // A compensation entry that represents one component of compensation, such + // as base pay, bonus, or other compensation type. + // + // Annualization: One compensation entry can be annualized if + // - it contains valid [amount][google.cloud.talent.v4.CompensationInfo.CompensationEntry.amount] or [range][google.cloud.talent.v4.CompensationInfo.CompensationEntry.range]. + // - and its [expected_units_per_year][google.cloud.talent.v4.CompensationInfo.CompensationEntry.expected_units_per_year] is set or can be derived. + // Its annualized range is determined as ([amount][google.cloud.talent.v4.CompensationInfo.CompensationEntry.amount] or [range][google.cloud.talent.v4.CompensationInfo.CompensationEntry.range]) times + // [expected_units_per_year][google.cloud.talent.v4.CompensationInfo.CompensationEntry.expected_units_per_year]. + message CompensationEntry { + // Compensation type. + // + // Default is [CompensationType.COMPENSATION_TYPE_UNSPECIFIED][google.cloud.talent.v4.CompensationInfo.CompensationType.COMPENSATION_TYPE_UNSPECIFIED]. + CompensationType type = 1; + + // Frequency of the specified amount. + // + // Default is [CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED][google.cloud.talent.v4.CompensationInfo.CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED]. + CompensationUnit unit = 2; + + // Compensation amount. It could be a fixed amount or a floating range. + oneof compensation_amount { + // Compensation amount. + google.type.Money amount = 3; + + // Compensation range. + CompensationRange range = 4; + } + + // Compensation description. For example, could + // indicate equity terms or provide additional context to an estimated + // bonus. + string description = 5; + + // Expected number of units paid each year. If not specified, when + // [Job.employment_types][google.cloud.talent.v4.Job.employment_types] is FULLTIME, a default value is inferred + // based on [unit][google.cloud.talent.v4.CompensationInfo.CompensationEntry.unit]. Default values: + // - HOURLY: 2080 + // - DAILY: 260 + // - WEEKLY: 52 + // - MONTHLY: 12 + // - ANNUAL: 1 + google.protobuf.DoubleValue expected_units_per_year = 6; + } + + // The type of compensation. + // + // For compensation amounts specified in non-monetary amounts, + // describe the compensation scheme in the [CompensationEntry.description][google.cloud.talent.v4.CompensationInfo.CompensationEntry.description]. + // + // For example, tipping format is described in + // [CompensationEntry.description][google.cloud.talent.v4.CompensationInfo.CompensationEntry.description] (for example, "expect 15-20% tips based + // on customer bill.") and an estimate of the tips provided in + // [CompensationEntry.amount][google.cloud.talent.v4.CompensationInfo.CompensationEntry.amount] or [CompensationEntry.range][google.cloud.talent.v4.CompensationInfo.CompensationEntry.range] ($10 per hour). + // + // For example, equity is described in [CompensationEntry.description][google.cloud.talent.v4.CompensationInfo.CompensationEntry.description] + // (for example, "1% - 2% equity vesting over 4 years, 1 year cliff") and + // value estimated in [CompensationEntry.amount][google.cloud.talent.v4.CompensationInfo.CompensationEntry.amount] or + // [CompensationEntry.range][google.cloud.talent.v4.CompensationInfo.CompensationEntry.range]. If no value estimate is possible, units are + // [CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED][google.cloud.talent.v4.CompensationInfo.CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED] and then further + // clarified in [CompensationEntry.description][google.cloud.talent.v4.CompensationInfo.CompensationEntry.description] field. + enum CompensationType { + // Default value. + COMPENSATION_TYPE_UNSPECIFIED = 0; + + // Base compensation: Refers to the fixed amount of money paid to an + // employee by an employer in return for work performed. Base compensation + // does not include benefits, bonuses or any other potential compensation + // from an employer. + BASE = 1; + + // Bonus. + BONUS = 2; + + // Signing bonus. + SIGNING_BONUS = 3; + + // Equity. + EQUITY = 4; + + // Profit sharing. + PROFIT_SHARING = 5; + + // Commission. + COMMISSIONS = 6; + + // Tips. + TIPS = 7; + + // Other compensation type. + OTHER_COMPENSATION_TYPE = 8; + } + + // Pay frequency. + enum CompensationUnit { + // Default value. + COMPENSATION_UNIT_UNSPECIFIED = 0; + + // Hourly. + HOURLY = 1; + + // Daily. + DAILY = 2; + + // Weekly + WEEKLY = 3; + + // Monthly. + MONTHLY = 4; + + // Yearly. + YEARLY = 5; + + // One time. + ONE_TIME = 6; + + // Other compensation units. + OTHER_COMPENSATION_UNIT = 7; + } + + // Compensation range. + message CompensationRange { + // The maximum amount of compensation. If left empty, the value is set + // to a maximal compensation value and the currency code is set to + // match the [currency code][google.type.Money.currency_code] of + // min_compensation. + google.type.Money max_compensation = 2; + + // The minimum amount of compensation. If left empty, the value is set + // to zero and the currency code is set to match the + // [currency code][google.type.Money.currency_code] of max_compensation. + google.type.Money min_compensation = 1; + } + + // Job compensation information. + // + // At most one entry can be of type + // [CompensationInfo.CompensationType.BASE][google.cloud.talent.v4.CompensationInfo.CompensationType.BASE], which is + // referred as **base compensation entry** for the job. + repeated CompensationEntry entries = 1; + + // Output only. Annualized base compensation range. Computed as base compensation entry's + // [CompensationEntry.amount][google.cloud.talent.v4.CompensationInfo.CompensationEntry.amount] times + // [CompensationEntry.expected_units_per_year][google.cloud.talent.v4.CompensationInfo.CompensationEntry.expected_units_per_year]. + // + // See [CompensationEntry][google.cloud.talent.v4.CompensationInfo.CompensationEntry] for explanation on compensation annualization. + CompensationRange annualized_base_compensation_range = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Annualized total compensation range. Computed as all compensation entries' + // [CompensationEntry.amount][google.cloud.talent.v4.CompensationInfo.CompensationEntry.amount] times + // [CompensationEntry.expected_units_per_year][google.cloud.talent.v4.CompensationInfo.CompensationEntry.expected_units_per_year]. + // + // See [CompensationEntry][google.cloud.talent.v4.CompensationInfo.CompensationEntry] for explanation on compensation annualization. + CompensationRange annualized_total_compensation_range = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Metadata used for long running operations returned by CTS batch APIs. +// It's used to replace [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata]. +message BatchOperationMetadata { + enum State { + // Default value. + STATE_UNSPECIFIED = 0; + + // The batch operation is being prepared for processing. + INITIALIZING = 1; + + // The batch operation is actively being processed. + PROCESSING = 2; + + // The batch operation is processed, and at least one item has been + // successfully processed. + SUCCEEDED = 3; + + // The batch operation is done and no item has been successfully processed. + FAILED = 4; + + // The batch operation is in the process of cancelling after + // [google.longrunning.Operations.CancelOperation][google.longrunning.Operations.CancelOperation] is called. + CANCELLING = 5; + + // The batch operation is done after + // [google.longrunning.Operations.CancelOperation][google.longrunning.Operations.CancelOperation] is called. Any items + // processed before cancelling are returned in the response. + CANCELLED = 6; + } + + // The state of a long running operation. + State state = 1; + + // More detailed information about operation state. + string state_description = 2; + + // Count of successful item(s) inside an operation. + int32 success_count = 3; + + // Count of failed item(s) inside an operation. + int32 failure_count = 4; + + // Count of total item(s) inside an operation. + int32 total_count = 5; + + // The time when the batch operation is created. + google.protobuf.Timestamp create_time = 6; + + // The time when the batch operation status is updated. The metadata and the + // [update_time][google.cloud.talent.v4.BatchOperationMetadata.update_time] is refreshed every minute otherwise cached data is + // returned. + google.protobuf.Timestamp update_time = 7; + + // The time when the batch operation is finished and + // [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to `true`. + google.protobuf.Timestamp end_time = 8; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4/company.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4/company.proto new file mode 100644 index 00000000000..075e7bcfbb2 --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4/company.proto @@ -0,0 +1,117 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/talent/v4/common.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4;talent"; +option java_multiple_files = true; +option java_outer_classname = "CompanyProto"; +option java_package = "com.google.cloud.talent.v4"; +option objc_class_prefix = "CTS"; + +// A Company resource represents a company in the service. A company is the +// entity that owns job postings, that is, the hiring entity responsible for +// employing applicants for the job position. +message Company { + option (google.api.resource) = { + type: "jobs.googleapis.com/Company" + pattern: "projects/{project}/tenants/{tenant}/companies/{company}" + }; + + // Derived details about the company. + message DerivedInfo { + // A structured headquarters location of the company, resolved from + // [Company.headquarters_address][google.cloud.talent.v4.Company.headquarters_address] if provided. + Location headquarters_location = 1; + } + + // Required during company update. + // + // The resource name for a company. This is generated by the service when a + // company is created. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for + // example, "projects/foo/tenants/bar/companies/baz". + string name = 1; + + // Required. The display name of the company, for example, "Google LLC". + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Client side company identifier, used to uniquely identify the + // company. + // + // The maximum number of allowed characters is 255. + string external_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // The employer's company size. + CompanySize size = 4; + + // The street address of the company's main headquarters, which may be + // different from the job location. The service attempts + // to geolocate the provided address, and populates a more specific + // location wherever possible in [DerivedInfo.headquarters_location][google.cloud.talent.v4.Company.DerivedInfo.headquarters_location]. + string headquarters_address = 5; + + // Set to true if it is the hiring agency that post jobs for other + // employers. + // + // Defaults to false if not provided. + bool hiring_agency = 6; + + // Equal Employment Opportunity legal disclaimer text to be + // associated with all jobs, and typically to be displayed in all + // roles. + // + // The maximum number of allowed characters is 500. + string eeo_text = 7; + + // The URI representing the company's primary web site or home page, + // for example, "https://www.google.com". + // + // The maximum number of allowed characters is 255. + string website_uri = 8; + + // The URI to employer's career site or careers page on the employer's web + // site, for example, "https://careers.google.com". + string career_site_uri = 9; + + // A URI that hosts the employer's company logo. + string image_uri = 10; + + // This field is deprecated. Please set the searchability of the custom + // attribute in the [Job.custom_attributes][google.cloud.talent.v4.Job.custom_attributes] going forward. + // + // A list of keys of filterable [Job.custom_attributes][google.cloud.talent.v4.Job.custom_attributes], whose + // corresponding `string_values` are used in keyword searches. Jobs with + // `string_values` under these specified field keys are returned if any + // of the values match the search keyword. Custom field values with + // parenthesis, brackets and special symbols are not searchable as-is, + // and those keyword queries must be surrounded by quotes. + repeated string keyword_searchable_job_custom_attributes = 11 [deprecated = true]; + + // Output only. Derived details about the company. + DerivedInfo derived_info = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates whether a company is flagged to be suspended from + // public availability by the service when job content appears suspicious, + // abusive, or spammy. + bool suspended = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4/company_service.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4/company_service.proto new file mode 100644 index 00000000000..797d92108cb --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4/company_service.proto @@ -0,0 +1,187 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/talent/v4/common.proto"; +import "google/cloud/talent/v4/company.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4;talent"; +option java_multiple_files = true; +option java_outer_classname = "CompanyServiceProto"; +option java_package = "com.google.cloud.talent.v4"; +option objc_class_prefix = "CTS"; + +// A service that handles company management, including CRUD and enumeration. +service CompanyService { + option (google.api.default_host) = "jobs.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/jobs"; + + // Creates a new company entity. + rpc CreateCompany(CreateCompanyRequest) returns (Company) { + option (google.api.http) = { + post: "/v4/{parent=projects/*/tenants/*}/companies" + body: "company" + }; + option (google.api.method_signature) = "parent,company"; + } + + // Retrieves specified company. + rpc GetCompany(GetCompanyRequest) returns (Company) { + option (google.api.http) = { + get: "/v4/{name=projects/*/tenants/*/companies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates specified company. + rpc UpdateCompany(UpdateCompanyRequest) returns (Company) { + option (google.api.http) = { + patch: "/v4/{company.name=projects/*/tenants/*/companies/*}" + body: "company" + }; + option (google.api.method_signature) = "company,update_mask"; + } + + // Deletes specified company. + // Prerequisite: The company has no jobs associated with it. + rpc DeleteCompany(DeleteCompanyRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v4/{name=projects/*/tenants/*/companies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all companies associated with the project. + rpc ListCompanies(ListCompaniesRequest) returns (ListCompaniesResponse) { + option (google.api.http) = { + get: "/v4/{parent=projects/*/tenants/*}/companies" + }; + option (google.api.method_signature) = "parent"; + } +} + +// The Request of the CreateCompany method. +message CreateCompanyRequest { + // Required. Resource name of the tenant under which the company is created. + // + // The format is "projects/{project_id}/tenants/{tenant_id}", for example, + // "projects/foo/tenants/bar". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "jobs.googleapis.com/Tenant" + } + ]; + + // Required. The company to be created. + Company company = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for getting a company by name. +message GetCompanyRequest { + // Required. The resource name of the company to be retrieved. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for + // example, "projects/api-test-project/tenants/foo/companies/bar". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "jobs.googleapis.com/Company" + } + ]; +} + +// Request for updating a specified company. +message UpdateCompanyRequest { + // Required. The company resource to replace the current resource in the system. + Company company = 1 [(google.api.field_behavior) = REQUIRED]; + + // Strongly recommended for the best service experience. + // + // If [update_mask][google.cloud.talent.v4.UpdateCompanyRequest.update_mask] is provided, only the specified fields in + // [company][google.cloud.talent.v4.UpdateCompanyRequest.company] are updated. Otherwise all the fields are updated. + // + // A field mask to specify the company fields to be updated. Only + // top level fields of [Company][google.cloud.talent.v4.Company] are supported. + google.protobuf.FieldMask update_mask = 2; +} + +// Request to delete a company. +message DeleteCompanyRequest { + // Required. The resource name of the company to be deleted. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for + // example, "projects/foo/tenants/bar/companies/baz". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "jobs.googleapis.com/Company" + } + ]; +} + +// List companies for which the client has ACL visibility. +message ListCompaniesRequest { + // Required. Resource name of the tenant under which the company is created. + // + // The format is "projects/{project_id}/tenants/{tenant_id}", for example, + // "projects/foo/tenants/bar". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "jobs.googleapis.com/Tenant" + } + ]; + + // The starting indicator from which to return results. + string page_token = 2; + + // The maximum number of companies to be returned, at most 100. + // Default is 100 if a non-positive number is provided. + int32 page_size = 3; + + // Set to true if the companies requested must have open jobs. + // + // Defaults to false. + // + // If true, at most [page_size][google.cloud.talent.v4.ListCompaniesRequest.page_size] of companies are fetched, among which + // only those with open jobs are returned. + bool require_open_jobs = 4; +} + +// The List companies response object. +message ListCompaniesResponse { + // Companies for the current client. + repeated Company companies = 1; + + // A token to retrieve the next page of results. + string next_page_token = 2; + + // Additional information for the API invocation, such as the request + // tracking id. + ResponseMetadata metadata = 3; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4/completion_service.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4/completion_service.proto new file mode 100644 index 00000000000..c053c6ce1b3 --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4/completion_service.proto @@ -0,0 +1,154 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/talent/v4/common.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4;talent"; +option java_multiple_files = true; +option java_outer_classname = "CompletionServiceProto"; +option java_package = "com.google.cloud.talent.v4"; +option objc_class_prefix = "CTS"; + +// A service handles auto completion. +service Completion { + option (google.api.default_host) = "jobs.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/jobs"; + + // Completes the specified prefix with keyword suggestions. + // Intended for use by a job search auto-complete search box. + rpc CompleteQuery(CompleteQueryRequest) returns (CompleteQueryResponse) { + option (google.api.http) = { + get: "/v4/{tenant=projects/*/tenants/*}:completeQuery" + }; + } +} + +// Auto-complete parameters. +message CompleteQueryRequest { + // Enum to specify the scope of completion. + enum CompletionScope { + // Default value. + COMPLETION_SCOPE_UNSPECIFIED = 0; + + // Suggestions are based only on the data provided by the client. + TENANT = 1; + + // Suggestions are based on all jobs data in the system that's visible to + // the client + PUBLIC = 2; + } + + // Enum to specify auto-completion topics. + enum CompletionType { + // Default value. + COMPLETION_TYPE_UNSPECIFIED = 0; + + // Suggest job titles for jobs autocomplete. + // + // For [CompletionType.JOB_TITLE][google.cloud.talent.v4.CompleteQueryRequest.CompletionType.JOB_TITLE] type, only open jobs with the same + // [language_codes][google.cloud.talent.v4.CompleteQueryRequest.language_codes] are returned. + JOB_TITLE = 1; + + // Suggest company names for jobs autocomplete. + // + // For [CompletionType.COMPANY_NAME][google.cloud.talent.v4.CompleteQueryRequest.CompletionType.COMPANY_NAME] type, + // only companies having open jobs with the same [language_codes][google.cloud.talent.v4.CompleteQueryRequest.language_codes] are + // returned. + COMPANY_NAME = 2; + + // Suggest both job titles and company names for jobs autocomplete. + // + // For [CompletionType.COMBINED][google.cloud.talent.v4.CompleteQueryRequest.CompletionType.COMBINED] type, only open jobs with the same + // [language_codes][google.cloud.talent.v4.CompleteQueryRequest.language_codes] or companies having open jobs with the same + // [language_codes][google.cloud.talent.v4.CompleteQueryRequest.language_codes] are returned. + COMBINED = 3; + } + + // Required. Resource name of tenant the completion is performed within. + // + // The format is "projects/{project_id}/tenants/{tenant_id}", for example, + // "projects/foo/tenants/bar". + string tenant = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "jobs.googleapis.com/Tenant" + } + ]; + + // Required. The query used to generate suggestions. + // + // The maximum number of allowed characters is 255. + string query = 2 [(google.api.field_behavior) = REQUIRED]; + + // The list of languages of the query. This is + // the BCP-47 language code, such as "en-US" or "sr-Latn". + // For more information, see + // [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + // + // The maximum number of allowed characters is 255. + repeated string language_codes = 3; + + // Required. Completion result count. + // + // The maximum allowed page size is 10. + int32 page_size = 4 [(google.api.field_behavior) = REQUIRED]; + + // If provided, restricts completion to specified company. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for + // example, "projects/foo/tenants/bar/companies/baz". + string company = 5 [(google.api.resource_reference) = { + type: "jobs.googleapis.com/Company" + }]; + + // The scope of the completion. The defaults is [CompletionScope.PUBLIC][google.cloud.talent.v4.CompleteQueryRequest.CompletionScope.PUBLIC]. + CompletionScope scope = 6; + + // The completion topic. The default is [CompletionType.COMBINED][google.cloud.talent.v4.CompleteQueryRequest.CompletionType.COMBINED]. + CompletionType type = 7; +} + +// Response of auto-complete query. +message CompleteQueryResponse { + // Resource that represents completion results. + message CompletionResult { + // The suggestion for the query. + string suggestion = 1; + + // The completion topic. + CompleteQueryRequest.CompletionType type = 2; + + // The URI of the company image for + // [COMPANY_NAME][google.cloud.talent.v4.CompleteQueryRequest.CompletionType.COMPANY_NAME]. + string image_uri = 3; + } + + // Results of the matching job/company candidates. + repeated CompletionResult completion_results = 1; + + // Additional information for the API invocation, such as the request + // tracking id. + ResponseMetadata metadata = 2; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4/event.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4/event.proto new file mode 100644 index 00000000000..53545d65852 --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4/event.proto @@ -0,0 +1,170 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4;talent"; +option java_multiple_files = true; +option java_outer_classname = "EventProto"; +option java_package = "com.google.cloud.talent.v4"; +option objc_class_prefix = "CTS"; + +// An event issued when an end user interacts with the application that +// implements Cloud Talent Solution. Providing this information improves the +// quality of results for the API clients, enabling the +// service to perform optimally. The number of events sent must be consistent +// with other calls, such as job searches, issued to the service by the client. +message ClientEvent { + // Strongly recommended for the best service experience. + // + // A unique ID generated in the API responses. It can be found in + // [ResponseMetadata.request_id][google.cloud.talent.v4.ResponseMetadata.request_id]. + string request_id = 1; + + // Required. A unique identifier, generated by the client application. + string event_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The timestamp of the event. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. + // + // The detail information of a specific event type. + oneof event { + // An event issued when a job seeker interacts with the application that + // implements Cloud Talent Solution. + JobEvent job_event = 5; + } + + // Notes about the event provided by recruiters or other users, for example, + // feedback on why a job was bookmarked. + string event_notes = 9; +} + +// An event issued when a job seeker interacts with the application that +// implements Cloud Talent Solution. +message JobEvent { + // An enumeration of an event attributed to the behavior of the end user, + // such as a job seeker. + enum JobEventType { + // The event is unspecified by other provided values. + JOB_EVENT_TYPE_UNSPECIFIED = 0; + + // The job seeker or other entity interacting with the service has + // had a job rendered in their view, such as in a list of search results in + // a compressed or clipped format. This event is typically associated with + // the viewing of a jobs list on a single page by a job seeker. + IMPRESSION = 1; + + // The job seeker, or other entity interacting with the service, has + // viewed the details of a job, including the full description. This + // event doesn't apply to the viewing a snippet of a job appearing as a + // part of the job search results. Viewing a snippet is associated with an + // [impression][google.cloud.talent.v4.JobEvent.JobEventType.IMPRESSION]). + VIEW = 2; + + // The job seeker or other entity interacting with the service + // performed an action to view a job and was redirected to a different + // website for job. + VIEW_REDIRECT = 3; + + // The job seeker or other entity interacting with the service + // began the process or demonstrated the intention of applying for a job. + APPLICATION_START = 4; + + // The job seeker or other entity interacting with the service + // submitted an application for a job. + APPLICATION_FINISH = 5; + + // The job seeker or other entity interacting with the service + // submitted an application for a job with a single click without + // entering information. If a job seeker performs this action, send only + // this event to the service. Do not also send + // [JobEventType.APPLICATION_START][google.cloud.talent.v4.JobEvent.JobEventType.APPLICATION_START] or [JobEventType.APPLICATION_FINISH][google.cloud.talent.v4.JobEvent.JobEventType.APPLICATION_FINISH] + // events. + APPLICATION_QUICK_SUBMISSION = 6; + + // The job seeker or other entity interacting with the service + // performed an action to apply to a job and was redirected to a different + // website to complete the application. + APPLICATION_REDIRECT = 7; + + // The job seeker or other entity interacting with the service began the + // process or demonstrated the intention of applying for a job from the + // search results page without viewing the details of the job posting. + // If sending this event, JobEventType.VIEW event shouldn't be sent. + APPLICATION_START_FROM_SEARCH = 8; + + // The job seeker, or other entity interacting with the service, performs an + // action with a single click from the search results page to apply to a job + // (without viewing the details of the job posting), and is redirected + // to a different website to complete the application. If a candidate + // performs this action, send only this event to the service. Do not also + // send [JobEventType.APPLICATION_START][google.cloud.talent.v4.JobEvent.JobEventType.APPLICATION_START], + // [JobEventType.APPLICATION_FINISH][google.cloud.talent.v4.JobEvent.JobEventType.APPLICATION_FINISH] or [JobEventType.VIEW][google.cloud.talent.v4.JobEvent.JobEventType.VIEW] events. + APPLICATION_REDIRECT_FROM_SEARCH = 9; + + // This event should be used when a company submits an application + // on behalf of a job seeker. This event is intended for use by staffing + // agencies attempting to place candidates. + APPLICATION_COMPANY_SUBMIT = 10; + + // The job seeker or other entity interacting with the service demonstrated + // an interest in a job by bookmarking or saving it. + BOOKMARK = 11; + + // The job seeker or other entity interacting with the service was + // sent a notification, such as an email alert or device notification, + // containing one or more jobs listings generated by the service. + NOTIFICATION = 12; + + // The job seeker or other entity interacting with the service was + // employed by the hiring entity (employer). Send this event + // only if the job seeker was hired through an application that was + // initiated by a search conducted through the Cloud Talent Solution + // service. + HIRED = 13; + + // A recruiter or staffing agency submitted an application on behalf of the + // candidate after interacting with the service to identify a suitable job + // posting. + SENT_CV = 14; + + // The entity interacting with the service (for example, the job seeker), + // was granted an initial interview by the hiring entity (employer). This + // event should only be sent if the job seeker was granted an interview as + // part of an application that was initiated by a search conducted through / + // recommendation provided by the Cloud Talent Solution service. + INTERVIEW_GRANTED = 15; + } + + // Required. The type of the event (see [JobEventType][google.cloud.talent.v4.JobEvent.JobEventType]). + JobEventType type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The [job name(s)][google.cloud.talent.v4.Job.name] associated with this event. + // For example, if this is an [impression][google.cloud.talent.v4.JobEvent.JobEventType.IMPRESSION] event, + // this field contains the identifiers of all jobs shown to the job seeker. + // If this was a [view][google.cloud.talent.v4.JobEvent.JobEventType.VIEW] event, this field contains the + // identifier of the viewed job. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}", for + // example, "projects/foo/tenants/bar/jobs/baz". + repeated string jobs = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4/event_service.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4/event_service.proto new file mode 100644 index 00000000000..40f6c7e2100 --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4/event_service.proto @@ -0,0 +1,70 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/talent/v4/event.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4;talent"; +option java_multiple_files = true; +option java_outer_classname = "EventServiceProto"; +option java_package = "com.google.cloud.talent.v4"; +option objc_class_prefix = "CTS"; + +// A service handles client event report. +service EventService { + option (google.api.default_host) = "jobs.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/jobs"; + + // Report events issued when end user interacts with customer's application + // that uses Cloud Talent Solution. You may inspect the created events in + // [self service + // tools](https://console.cloud.google.com/talent-solution/overview). + // [Learn + // more](https://cloud.google.com/talent-solution/docs/management-tools) + // about self service tools. + rpc CreateClientEvent(CreateClientEventRequest) returns (ClientEvent) { + option (google.api.http) = { + post: "/v4/{parent=projects/*/tenants/*}/clientEvents" + body: "client_event" + }; + option (google.api.method_signature) = "parent,client_event"; + } +} + +// The report event request. +message CreateClientEventRequest { + // Required. Resource name of the tenant under which the event is created. + // + // The format is "projects/{project_id}/tenants/{tenant_id}", for example, + // "projects/foo/tenants/bar". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "jobs.googleapis.com/Tenant" + } + ]; + + // Required. Events issued when end user interacts with customer's application that + // uses Cloud Talent Solution. + ClientEvent client_event = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4/filters.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4/filters.proto new file mode 100644 index 00000000000..8018dc5516b --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4/filters.proto @@ -0,0 +1,363 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4; + +import "google/api/field_behavior.proto"; +import "google/cloud/talent/v4/common.proto"; +import "google/protobuf/duration.proto"; +import "google/type/latlng.proto"; +import "google/type/timeofday.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4;talent"; +option java_multiple_files = true; +option java_outer_classname = "FiltersProto"; +option java_package = "com.google.cloud.talent.v4"; +option objc_class_prefix = "CTS"; + +// The query required to perform a search query. +message JobQuery { + // The query string that matches against the job title, description, and + // location fields. + // + // The maximum number of allowed characters is 255. + string query = 1; + + // The language code of [query][google.cloud.talent.v4.JobQuery.query]. For example, "en-US". This field helps to + // better interpret the query. + // + // If a value isn't specified, the query language code is automatically + // detected, which may not be accurate. + // + // Language code should be in BCP-47 format, such as "en-US" or "sr-Latn". + // For more information, see + // [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + string query_language_code = 14; + + // This filter specifies the company entities to search against. + // + // If a value isn't specified, jobs are searched for against all + // companies. + // + // If multiple values are specified, jobs are searched against the + // companies specified. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}". For + // example, "projects/foo/tenants/bar/companies/baz". + // + // At most 20 company filters are allowed. + repeated string companies = 2; + + // The location filter specifies geo-regions containing the jobs to + // search against. See [LocationFilter][google.cloud.talent.v4.LocationFilter] for more information. + // + // If a location value isn't specified, jobs fitting the other search + // criteria are retrieved regardless of where they're located. + // + // If multiple values are specified, jobs are retrieved from any of the + // specified locations. If different values are specified for the + // [LocationFilter.distance_in_miles][google.cloud.talent.v4.LocationFilter.distance_in_miles] parameter, the maximum provided + // distance is used for all locations. + // + // At most 5 location filters are allowed. + repeated LocationFilter location_filters = 3; + + // The category filter specifies the categories of jobs to search against. + // See [JobCategory][google.cloud.talent.v4.JobCategory] for more information. + // + // If a value isn't specified, jobs from any category are searched against. + // + // If multiple values are specified, jobs from any of the specified + // categories are searched against. + repeated JobCategory job_categories = 4; + + // Allows filtering jobs by commute time with different travel methods (for + // example, driving or public transit). + // + // Note: This only works when you specify a [CommuteMethod][google.cloud.talent.v4.CommuteMethod]. In this case, + // [location_filters][google.cloud.talent.v4.JobQuery.location_filters] is ignored. + // + // Currently we don't support sorting by commute time. + CommuteFilter commute_filter = 5; + + // This filter specifies the company [Company.display_name][google.cloud.talent.v4.Company.display_name] + // of the jobs to search against. The company name must match the value + // exactly. + // + // Alternatively, the value being searched for can be wrapped in different + // match operators. + // `SUBSTRING_MATCH([value])` + // The company name must contain a case insensitive substring match of the + // value. Using this function may increase latency. + // + // Sample Value: `SUBSTRING_MATCH(google)` + // + // `MULTI_WORD_TOKEN_MATCH([value])` + // The value will be treated as a multi word token and the company name must + // contain a case insensitive match of the value. Using this function may + // increase latency. + // + // Sample Value: `MULTI_WORD_TOKEN_MATCH(google)` + // + // If a value isn't specified, jobs within the search results are + // associated with any company. + // + // If multiple values are specified, jobs within the search results may be + // associated with any of the specified companies. + // + // At most 20 company display name filters are allowed. + repeated string company_display_names = 6; + + // This search filter is applied only to + // [Job.compensation_info][google.cloud.talent.v4.Job.compensation_info]. For example, if the filter is specified + // as "Hourly job with per-hour compensation > $15", only jobs meeting + // these criteria are searched. If a filter isn't defined, all open jobs + // are searched. + CompensationFilter compensation_filter = 7; + + // This filter specifies a structured syntax to match against the + // [Job.custom_attributes][google.cloud.talent.v4.Job.custom_attributes] marked as `filterable`. + // + // The syntax for this expression is a subset of SQL syntax. + // + // Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the + // left of the operator is a custom field key and the right of the operator + // is a number or a quoted string. You must escape backslash (\\) and + // quote (\") characters. + // + // Supported functions are `LOWER([field_name])` to + // perform a case insensitive match and `EMPTY([field_name])` to filter on the + // existence of a key. + // + // Boolean expressions (AND/OR/NOT) are supported up to 3 levels of + // nesting (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100 + // comparisons or functions are allowed in the expression. The expression + // must be < 10000 bytes in length. + // + // Sample Query: + // `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND + // driving_years > 10` + string custom_attribute_filter = 8; + + // This flag controls the spell-check feature. If false, the + // service attempts to correct a misspelled query, + // for example, "enginee" is corrected to "engineer". + // + // Defaults to false: a spell check is performed. + bool disable_spell_check = 9; + + // The employment type filter specifies the employment type of jobs to + // search against, such as [EmploymentType.FULL_TIME][google.cloud.talent.v4.EmploymentType.FULL_TIME]. + // + // If a value isn't specified, jobs in the search results includes any + // employment type. + // + // If multiple values are specified, jobs in the search results include + // any of the specified employment types. + repeated EmploymentType employment_types = 10; + + // This filter specifies the locale of jobs to search against, + // for example, "en-US". + // + // If a value isn't specified, the search results can contain jobs in any + // locale. + // + // + // Language codes should be in BCP-47 format, such as "en-US" or "sr-Latn". + // For more information, see + // [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + // + // At most 10 language code filters are allowed. + repeated string language_codes = 11; + + // Jobs published within a range specified by this filter are searched + // against. + TimestampRange publish_time_range = 12; + + // This filter specifies a list of job names to be excluded during search. + // + // At most 400 excluded job names are allowed. + repeated string excluded_jobs = 13; +} + +// Geographic region of the search. +message LocationFilter { + // Specify whether to include telecommute jobs. + enum TelecommutePreference { + // Default value if the telecommute preference isn't specified. + TELECOMMUTE_PREFERENCE_UNSPECIFIED = 0; + + // Deprecated: Ignore telecommute status of jobs. Use + // TELECOMMUTE_JOBS_EXCLUDED if want to exclude telecommute jobs. + TELECOMMUTE_EXCLUDED = 1 [deprecated = true]; + + // Allow telecommute jobs. + TELECOMMUTE_ALLOWED = 2; + + // Exclude telecommute jobs. + TELECOMMUTE_JOBS_EXCLUDED = 3; + } + + // The address name, such as "Mountain View" or "Bay Area". + string address = 1; + + // CLDR region code of the country/region. This field may be used in two ways: + // + // 1) If telecommute preference is not set, this field is used address + // ambiguity of the user-input address. For example, "Liverpool" may refer to + // "Liverpool, NY, US" or "Liverpool, UK". This region code biases the + // address resolution toward a specific country or territory. If this field is + // not set, address resolution is biased toward the United States by default. + // + // 2) If telecommute preference is set to TELECOMMUTE_ALLOWED, the + // telecommute location filter will be limited to the region specified in this + // field. If this field is not set, the telecommute job locations will not be + // + // See + // https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/territory_information.html + // for details. Example: "CH" for Switzerland. + string region_code = 2; + + // The latitude and longitude of the geographic center to search from. This + // field is ignored if `address` is provided. + google.type.LatLng lat_lng = 3; + + // The distance_in_miles is applied when the location being searched for is + // identified as a city or smaller. This field is ignored if the location + // being searched for is a state or larger. + double distance_in_miles = 4; + + // Allows the client to return jobs without a + // set location, specifically, telecommuting jobs (telecommuting is considered + // by the service as a special location). + // [Job.posting_region][google.cloud.talent.v4.Job.posting_region] indicates if a job permits telecommuting. + // If this field is set to [TelecommutePreference.TELECOMMUTE_ALLOWED][google.cloud.talent.v4.LocationFilter.TelecommutePreference.TELECOMMUTE_ALLOWED], + // telecommuting jobs are searched, and [address][google.cloud.talent.v4.LocationFilter.address] and [lat_lng][google.cloud.talent.v4.LocationFilter.lat_lng] are + // ignored. If not set or set to + // [TelecommutePreference.TELECOMMUTE_EXCLUDED][google.cloud.talent.v4.LocationFilter.TelecommutePreference.TELECOMMUTE_EXCLUDED], the telecommute status of + // the jobs is ignored. Jobs that have [PostingRegion.TELECOMMUTE][google.cloud.talent.v4.PostingRegion.TELECOMMUTE] and have + // additional [Job.addresses][google.cloud.talent.v4.Job.addresses] may still be matched based on other location + // filters using [address][google.cloud.talent.v4.LocationFilter.address] or [latlng][]. + // + // This filter can be used by itself to search exclusively for telecommuting + // jobs, or it can be combined with another location + // filter to search for a combination of job locations, + // such as "Mountain View" or "telecommuting" jobs. However, when used in + // combination with other location filters, telecommuting jobs can be + // treated as less relevant than other jobs in the search response. + // + // This field is only used for job search requests. + TelecommutePreference telecommute_preference = 5; +} + +// Filter on job compensation type and amount. +message CompensationFilter { + // Specify the type of filtering. + enum FilterType { + // Filter type unspecified. Position holder, INVALID, should never be used. + FILTER_TYPE_UNSPECIFIED = 0; + + // Filter by `base compensation entry's` unit. A job is a match if and + // only if the job contains a base CompensationEntry and the base + // CompensationEntry's unit matches provided [units][google.cloud.talent.v4.CompensationFilter.units]. + // Populate one or more [units][google.cloud.talent.v4.CompensationFilter.units]. + // + // See [CompensationInfo.CompensationEntry][google.cloud.talent.v4.CompensationInfo.CompensationEntry] for definition of + // base compensation entry. + UNIT_ONLY = 1; + + // Filter by `base compensation entry's` unit and amount / range. A job + // is a match if and only if the job contains a base CompensationEntry, and + // the base entry's unit matches provided + // [CompensationUnit][google.cloud.talent.v4.CompensationInfo.CompensationUnit] and + // amount or range overlaps with provided + // [CompensationRange][google.cloud.talent.v4.CompensationInfo.CompensationRange]. + // + // See [CompensationInfo.CompensationEntry][google.cloud.talent.v4.CompensationInfo.CompensationEntry] for definition of + // base compensation entry. + // + // Set exactly one [units][google.cloud.talent.v4.CompensationFilter.units] and populate [range][google.cloud.talent.v4.CompensationFilter.range]. + UNIT_AND_AMOUNT = 2; + + // Filter by annualized base compensation amount and `base compensation + // entry's` unit. Populate [range][google.cloud.talent.v4.CompensationFilter.range] and zero or more [units][google.cloud.talent.v4.CompensationFilter.units]. + ANNUALIZED_BASE_AMOUNT = 3; + + // Filter by annualized total compensation amount and `base compensation + // entry's` unit . Populate [range][google.cloud.talent.v4.CompensationFilter.range] and zero or more [units][google.cloud.talent.v4.CompensationFilter.units]. + ANNUALIZED_TOTAL_AMOUNT = 4; + } + + // Required. Type of filter. + FilterType type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Specify desired `base compensation entry's` + // [CompensationInfo.CompensationUnit][google.cloud.talent.v4.CompensationInfo.CompensationUnit]. + repeated CompensationInfo.CompensationUnit units = 2 [(google.api.field_behavior) = REQUIRED]; + + // Compensation range. + CompensationInfo.CompensationRange range = 3; + + // If set to true, jobs with unspecified compensation range fields are + // included. + bool include_jobs_with_unspecified_compensation_range = 4; +} + +// Parameters needed for commute search. +message CommuteFilter { + // The traffic density to use when calculating commute time. + enum RoadTraffic { + // Road traffic situation isn't specified. + ROAD_TRAFFIC_UNSPECIFIED = 0; + + // Optimal commute time without considering any traffic impact. + TRAFFIC_FREE = 1; + + // Commute time calculation takes in account the peak traffic impact. + BUSY_HOUR = 2; + } + + // Required. The method of transportation to calculate the commute time for. + CommuteMethod commute_method = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The latitude and longitude of the location to calculate the + // commute time from. + google.type.LatLng start_coordinates = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The maximum travel time in seconds. The maximum allowed value is `3600s` + // (one hour). Format is `123s`. + google.protobuf.Duration travel_duration = 3 [(google.api.field_behavior) = REQUIRED]; + + // If `true`, jobs without street level addresses may also be returned. + // For city level addresses, the city center is used. For state and coarser + // level addresses, text matching is used. + // If this field is set to `false` or isn't specified, only jobs that include + // street level addresses will be returned by commute search. + bool allow_imprecise_addresses = 4; + + // Traffic factor to take into account while searching by commute. + oneof traffic_option { + // Specifies the traffic density to use when calculating commute time. + RoadTraffic road_traffic = 5; + + // The departure time used to calculate traffic impact, represented as + // [google.type.TimeOfDay][google.type.TimeOfDay] in local time zone. + // + // Currently traffic model is restricted to hour level resolution. + google.type.TimeOfDay departure_time = 6; + } +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4/histogram.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4/histogram.proto new file mode 100644 index 00000000000..0c3c9969b76 --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4/histogram.proto @@ -0,0 +1,50 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4;talent"; +option java_multiple_files = true; +option java_outer_classname = "HistogramProto"; +option java_package = "com.google.cloud.talent.v4"; +option objc_class_prefix = "CTS"; + +// The histogram request. +message HistogramQuery { + // An expression specifies a histogram request against matching jobs for + // searches. + // + // See [SearchJobsRequest.histogram_queries][google.cloud.talent.v4.SearchJobsRequest.histogram_queries] for details about syntax. + string histogram_query = 1; +} + +// Histogram result that matches [HistogramQuery][google.cloud.talent.v4.HistogramQuery] specified in searches. +message HistogramQueryResult { + // Requested histogram expression. + string histogram_query = 1; + + // A map from the values of the facet associated with distinct values to the + // number of matching entries with corresponding value. + // + // The key format is: + // + // * (for string histogram) string values stored in the field. + // * (for named numeric bucket) name specified in `bucket()` function, like + // for `bucket(0, MAX, "non-negative")`, the key will be `non-negative`. + // * (for anonymous numeric bucket) range formatted as `-`, for + // example, `0-1000`, `MIN-0`, and `0-MAX`. + map histogram = 2; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4/job.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4/job.proto new file mode 100644 index 00000000000..bd31568426e --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4/job.proto @@ -0,0 +1,350 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/talent/v4/common.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4;talent"; +option java_multiple_files = true; +option java_outer_classname = "JobProto"; +option java_package = "com.google.cloud.talent.v4"; +option objc_class_prefix = "CTS"; + +// A Job resource represents a job posting (also referred to as a "job listing" +// or "job requisition"). A job belongs to a [Company][google.cloud.talent.v4.Company], which is the hiring +// entity responsible for the job. +message Job { + option (google.api.resource) = { + type: "jobs.googleapis.com/Job" + pattern: "projects/{project}/tenants/{tenant}/jobs/{job}" + }; + + // Application related details of a job posting. + message ApplicationInfo { + // Use this field to specify email address(es) to which resumes or + // applications can be sent. + // + // The maximum number of allowed characters for each entry is 255. + repeated string emails = 1; + + // Use this field to provide instructions, such as "Mail your application + // to ...", that a candidate can follow to apply for the job. + // + // This field accepts and sanitizes HTML input, and also accepts + // bold, italic, ordered list, and unordered list markup tags. + // + // The maximum number of allowed characters is 3,000. + string instruction = 2; + + // Use this URI field to direct an applicant to a website, for example to + // link to an online application form. + // + // The maximum number of allowed characters for each entry is 2,000. + repeated string uris = 3; + } + + // Derived details about the job posting. + message DerivedInfo { + // Structured locations of the job, resolved from [Job.addresses][google.cloud.talent.v4.Job.addresses]. + // + // [locations][google.cloud.talent.v4.Job.DerivedInfo.locations] are exactly matched to [Job.addresses][google.cloud.talent.v4.Job.addresses] in the same + // order. + repeated Location locations = 1; + + // Job categories derived from [Job.title][google.cloud.talent.v4.Job.title] and [Job.description][google.cloud.talent.v4.Job.description]. + repeated JobCategory job_categories = 3; + } + + // Options for job processing. + message ProcessingOptions { + // If set to `true`, the service does not attempt to resolve a + // more precise address for the job. + bool disable_street_address_resolution = 1; + + // Option for job HTML content sanitization. Applied fields are: + // + // * description + // * applicationInfo.instruction + // * incentives + // * qualifications + // * responsibilities + // + // HTML tags in these fields may be stripped if sanitiazation isn't + // disabled. + // + // Defaults to [HtmlSanitization.SIMPLE_FORMATTING_ONLY][google.cloud.talent.v4.HtmlSanitization.SIMPLE_FORMATTING_ONLY]. + HtmlSanitization html_sanitization = 2; + } + + // Required during job update. + // + // The resource name for the job. This is generated by the service when a + // job is created. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For + // example, "projects/foo/tenants/bar/jobs/baz". + // + // Use of this field in job queries and API calls is preferred over the use of + // [requisition_id][google.cloud.talent.v4.Job.requisition_id] since this value is unique. + string name = 1; + + // Required. The resource name of the company listing the job. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}". For + // example, "projects/foo/tenants/bar/companies/baz". + string company = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "jobs.googleapis.com/Company" + } + ]; + + // Required. The requisition ID, also referred to as the posting ID, is assigned by the + // client to identify a job. This field is intended to be used by clients + // for client identification and tracking of postings. A job isn't allowed + // to be created if there is another job with the same [company][google.cloud.talent.v4.Job.name], + // [language_code][google.cloud.talent.v4.Job.language_code] and [requisition_id][google.cloud.talent.v4.Job.requisition_id]. + // + // The maximum number of allowed characters is 255. + string requisition_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The title of the job, such as "Software Engineer" + // + // The maximum number of allowed characters is 500. + string title = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The description of the job, which typically includes a multi-paragraph + // description of the company and related information. Separate fields are + // provided on the job object for [responsibilities][google.cloud.talent.v4.Job.responsibilities], + // [qualifications][google.cloud.talent.v4.Job.qualifications], and other job characteristics. Use of + // these separate job fields is recommended. + // + // This field accepts and sanitizes HTML input, and also accepts + // bold, italic, ordered list, and unordered list markup tags. + // + // The maximum number of allowed characters is 100,000. + string description = 5 [(google.api.field_behavior) = REQUIRED]; + + // Strongly recommended for the best service experience. + // + // Location(s) where the employer is looking to hire for this job posting. + // + // Specifying the full street address(es) of the hiring location enables + // better API results, especially job searches by commute time. + // + // At most 50 locations are allowed for best search performance. If a job has + // more locations, it is suggested to split it into multiple jobs with unique + // [requisition_id][google.cloud.talent.v4.Job.requisition_id]s (e.g. 'ReqA' becomes 'ReqA-1', 'ReqA-2', and so on.) as + // multiple jobs with the same [company][google.cloud.talent.v4.Job.company], [language_code][google.cloud.talent.v4.Job.language_code] and + // [requisition_id][google.cloud.talent.v4.Job.requisition_id] are not allowed. If the original [requisition_id][google.cloud.talent.v4.Job.requisition_id] must + // be preserved, a custom field should be used for storage. It is also + // suggested to group the locations that close to each other in the same job + // for better search experience. + // + // Jobs with multiple addresses must have their addresses with the same + // [LocationType][] to allow location filtering to work properly. (For + // example, a Job with addresses "1600 Amphitheatre Parkway, Mountain View, + // CA, USA" and "London, UK" may not have location filters applied correctly + // at search time since the first is a [LocationType.STREET_ADDRESS][] and the + // second is a [LocationType.LOCALITY][].) If a job needs to have multiple + // addresses, it is suggested to split it into multiple jobs with same + // LocationTypes. + // + // The maximum number of allowed characters is 500. + repeated string addresses = 6; + + // Job application information. + ApplicationInfo application_info = 7; + + // The benefits included with the job. + repeated JobBenefit job_benefits = 8; + + // Job compensation information (a.k.a. "pay rate") i.e., the compensation + // that will paid to the employee. + CompensationInfo compensation_info = 9; + + // A map of fields to hold both filterable and non-filterable custom job + // attributes that are not covered by the provided structured fields. + // + // The keys of the map are strings up to 64 bytes and must match the + // pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, key0LikeThis or + // KEY_1_LIKE_THIS. + // + // At most 100 filterable and at most 100 unfilterable keys are supported. + // For filterable `string_values`, across all keys at most 200 values are + // allowed, with each string no more than 255 characters. For unfilterable + // `string_values`, the maximum total size of `string_values` across all keys + // is 50KB. + map custom_attributes = 10; + + // The desired education degrees for the job, such as Bachelors, Masters. + repeated DegreeType degree_types = 11; + + // The department or functional area within the company with the open + // position. + // + // The maximum number of allowed characters is 255. + string department = 12; + + // The employment type(s) of a job, for example, + // [full time][google.cloud.talent.v4.EmploymentType.FULL_TIME] or + // [part time][google.cloud.talent.v4.EmploymentType.PART_TIME]. + repeated EmploymentType employment_types = 13; + + // A description of bonus, commission, and other compensation + // incentives associated with the job not including salary or pay. + // + // The maximum number of allowed characters is 10,000. + string incentives = 14; + + // The language of the posting. This field is distinct from + // any requirements for fluency that are associated with the job. + // + // Language codes must be in BCP-47 format, such as "en-US" or "sr-Latn". + // For more information, see + // [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47){: + // class="external" target="_blank" }. + // + // If this field is unspecified and [Job.description][google.cloud.talent.v4.Job.description] is present, detected + // language code based on [Job.description][google.cloud.talent.v4.Job.description] is assigned, otherwise + // defaults to 'en_US'. + string language_code = 15; + + // The experience level associated with the job, such as "Entry Level". + JobLevel job_level = 16; + + // A promotion value of the job, as determined by the client. + // The value determines the sort order of the jobs returned when searching for + // jobs using the featured jobs search call, with higher promotional values + // being returned first and ties being resolved by relevance sort. Only the + // jobs with a promotionValue >0 are returned in a FEATURED_JOB_SEARCH. + // + // Default value is 0, and negative values are treated as 0. + int32 promotion_value = 17; + + // A description of the qualifications required to perform the + // job. The use of this field is recommended + // as an alternative to using the more general [description][google.cloud.talent.v4.Job.description] field. + // + // This field accepts and sanitizes HTML input, and also accepts + // bold, italic, ordered list, and unordered list markup tags. + // + // The maximum number of allowed characters is 10,000. + string qualifications = 18; + + // A description of job responsibilities. The use of this field is + // recommended as an alternative to using the more general [description][google.cloud.talent.v4.Job.description] + // field. + // + // This field accepts and sanitizes HTML input, and also accepts + // bold, italic, ordered list, and unordered list markup tags. + // + // The maximum number of allowed characters is 10,000. + string responsibilities = 19; + + // The job [PostingRegion][google.cloud.talent.v4.PostingRegion] (for example, state, country) throughout + // which the job is available. If this field is set, a [LocationFilter][google.cloud.talent.v4.LocationFilter] + // in a search query within the job region finds this job posting if an + // exact location match isn't specified. If this field is set to + // [PostingRegion.NATION][google.cloud.talent.v4.PostingRegion.NATION] or [PostingRegion.ADMINISTRATIVE_AREA][google.cloud.talent.v4.PostingRegion.ADMINISTRATIVE_AREA], + // setting job [Job.addresses][google.cloud.talent.v4.Job.addresses] to the same location level as this field + // is strongly recommended. + PostingRegion posting_region = 20; + + // Deprecated. The job is only visible to the owner. + // + // The visibility of the job. + // + // Defaults to [Visibility.ACCOUNT_ONLY][google.cloud.talent.v4.Visibility.ACCOUNT_ONLY] if not specified. + Visibility visibility = 21 [deprecated = true]; + + // The start timestamp of the job in UTC time zone. Typically this field + // is used for contracting engagements. Invalid timestamps are ignored. + google.protobuf.Timestamp job_start_time = 22; + + // The end timestamp of the job. Typically this field is used for contracting + // engagements. Invalid timestamps are ignored. + google.protobuf.Timestamp job_end_time = 23; + + // The timestamp this job posting was most recently published. The default + // value is the time the request arrives at the server. Invalid timestamps are + // ignored. + google.protobuf.Timestamp posting_publish_time = 24; + + // Strongly recommended for the best service experience. + // + // The expiration timestamp of the job. After this timestamp, the + // job is marked as expired, and it no longer appears in search results. The + // expired job can't be listed by the [ListJobs][google.cloud.talent.v4.JobService.ListJobs] API, + // but it can be retrieved with the [GetJob][google.cloud.talent.v4.JobService.GetJob] API or + // updated with the [UpdateJob][google.cloud.talent.v4.JobService.UpdateJob] API or deleted with + // the [DeleteJob][google.cloud.talent.v4.JobService.DeleteJob] API. An expired job can + // be updated and opened again by using a future expiration timestamp. + // Updating an expired job fails if there is another existing open job with + // same [company][google.cloud.talent.v4.Job.company], [language_code][google.cloud.talent.v4.Job.language_code] and [requisition_id][google.cloud.talent.v4.Job.requisition_id]. + // + // The expired jobs are retained in our system for 90 days. However, the + // overall expired job count cannot exceed 3 times the maximum number of + // open jobs over previous 7 days. If this threshold is exceeded, + // expired jobs are cleaned out in order of earliest expire time. + // Expired jobs are no longer accessible after they are cleaned + // out. + // + // Invalid timestamps are ignored, and treated as expire time not provided. + // + // If the timestamp is before the instant request is made, the job + // is treated as expired immediately on creation. This kind of job can + // not be updated. And when creating a job with past timestamp, the + // [posting_publish_time][google.cloud.talent.v4.Job.posting_publish_time] must be set before + // [posting_expire_time][google.cloud.talent.v4.Job.posting_expire_time]. The purpose of this feature is + // to allow other objects, such as [Application][], to refer a job + // that didn't exist in the system prior to becoming expired. If you + // want to modify a job that was expired on creation, + // delete it and create a new one. + // + // If this value isn't provided at the time of job creation or is invalid, + // the job posting expires after 30 days from the job's creation time. For + // example, if the job was created on 2017/01/01 13:00AM UTC with an + // unspecified expiration date, the job expires after 2017/01/31 13:00AM UTC. + // + // If this value isn't provided on job update, it depends on the field masks + // set by [UpdateJobRequest.update_mask][google.cloud.talent.v4.UpdateJobRequest.update_mask]. If the field masks include + // [job_end_time][google.cloud.talent.v4.Job.job_end_time], or the masks are empty meaning that every field is + // updated, the job posting expires after 30 days from the job's last + // update time. Otherwise the expiration date isn't updated. + google.protobuf.Timestamp posting_expire_time = 25; + + // Output only. The timestamp when this job posting was created. + google.protobuf.Timestamp posting_create_time = 26 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when this job posting was last updated. + google.protobuf.Timestamp posting_update_time = 27 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Display name of the company listing the job. + string company_display_name = 28 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Derived details about the job posting. + DerivedInfo derived_info = 29 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Options for job processing. + ProcessingOptions processing_options = 30; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4/job_service.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4/job_service.proto new file mode 100644 index 00000000000..3e93164c9f8 --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4/job_service.proto @@ -0,0 +1,940 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/talent/v4/common.proto"; +import "google/cloud/talent/v4/filters.proto"; +import "google/cloud/talent/v4/histogram.proto"; +import "google/cloud/talent/v4/job.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/rpc/status.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4;talent"; +option java_multiple_files = true; +option java_outer_classname = "JobServiceProto"; +option java_package = "com.google.cloud.talent.v4"; +option objc_class_prefix = "CTS"; + +// A service handles job management, including job CRUD, enumeration and search. +service JobService { + option (google.api.default_host) = "jobs.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/jobs"; + + // Creates a new job. + // + // Typically, the job becomes searchable within 10 seconds, but it may take + // up to 5 minutes. + rpc CreateJob(CreateJobRequest) returns (Job) { + option (google.api.http) = { + post: "/v4/{parent=projects/*/tenants/*}/jobs" + body: "job" + }; + option (google.api.method_signature) = "parent,job"; + } + + // Begins executing a batch create jobs operation. + rpc BatchCreateJobs(BatchCreateJobsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v4/{parent=projects/*/tenants/*}/jobs:batchCreate" + body: "*" + }; + option (google.api.method_signature) = "parent,jobs"; + option (google.longrunning.operation_info) = { + response_type: "BatchCreateJobsResponse" + metadata_type: "BatchOperationMetadata" + }; + } + + // Retrieves the specified job, whose status is OPEN or recently EXPIRED + // within the last 90 days. + rpc GetJob(GetJobRequest) returns (Job) { + option (google.api.http) = { + get: "/v4/{name=projects/*/tenants/*/jobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates specified job. + // + // Typically, updated contents become visible in search results within 10 + // seconds, but it may take up to 5 minutes. + rpc UpdateJob(UpdateJobRequest) returns (Job) { + option (google.api.http) = { + patch: "/v4/{job.name=projects/*/tenants/*/jobs/*}" + body: "job" + }; + option (google.api.method_signature) = "job,update_mask"; + } + + // Begins executing a batch update jobs operation. + rpc BatchUpdateJobs(BatchUpdateJobsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v4/{parent=projects/*/tenants/*}/jobs:batchUpdate" + body: "*" + }; + option (google.api.method_signature) = "parent,jobs"; + option (google.longrunning.operation_info) = { + response_type: "BatchUpdateJobsResponse" + metadata_type: "BatchOperationMetadata" + }; + } + + // Deletes the specified job. + // + // Typically, the job becomes unsearchable within 10 seconds, but it may take + // up to 5 minutes. + rpc DeleteJob(DeleteJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v4/{name=projects/*/tenants/*/jobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Begins executing a batch delete jobs operation. + rpc BatchDeleteJobs(BatchDeleteJobsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v4/{parent=projects/*/tenants/*}/jobs:batchDelete" + body: "*" + }; + option (google.api.method_signature) = "parent,names"; + option (google.longrunning.operation_info) = { + response_type: "BatchDeleteJobsResponse" + metadata_type: "BatchOperationMetadata" + }; + } + + // Lists jobs by filter. + rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { + option (google.api.http) = { + get: "/v4/{parent=projects/*/tenants/*}/jobs" + }; + option (google.api.method_signature) = "parent,filter"; + } + + // Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest]. + // + // This call constrains the [visibility][google.cloud.talent.v4.Job.visibility] of jobs + // present in the database, and only returns jobs that the caller has + // permission to search against. + rpc SearchJobs(SearchJobsRequest) returns (SearchJobsResponse) { + option (google.api.http) = { + post: "/v4/{parent=projects/*/tenants/*}/jobs:search" + body: "*" + }; + } + + // Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest]. + // + // This API call is intended for the use case of targeting passive job + // seekers (for example, job seekers who have signed up to receive email + // alerts about potential job opportunities), it has different algorithmic + // adjustments that are designed to specifically target passive job seekers. + // + // This call constrains the [visibility][google.cloud.talent.v4.Job.visibility] of jobs + // present in the database, and only returns jobs the caller has + // permission to search against. + rpc SearchJobsForAlert(SearchJobsRequest) returns (SearchJobsResponse) { + option (google.api.http) = { + post: "/v4/{parent=projects/*/tenants/*}/jobs:searchForAlert" + body: "*" + }; + } +} + +// Create job request. +message CreateJobRequest { + // Required. The resource name of the tenant under which the job is created. + // + // The format is "projects/{project_id}/tenants/{tenant_id}". For example, + // "projects/foo/tenants/bar". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "jobs.googleapis.com/Job" + } + ]; + + // Required. The Job to be created. + Job job = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Get job request. +message GetJobRequest { + // Required. The resource name of the job to retrieve. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For + // example, "projects/foo/tenants/bar/jobs/baz". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "jobs.googleapis.com/Job" + } + ]; +} + +// Update job request. +message UpdateJobRequest { + // Required. The Job to be updated. + Job job = 1 [(google.api.field_behavior) = REQUIRED]; + + // Strongly recommended for the best service experience. + // + // If [update_mask][google.cloud.talent.v4.UpdateJobRequest.update_mask] is provided, only the specified fields in + // [job][google.cloud.talent.v4.UpdateJobRequest.job] are updated. Otherwise all the fields are updated. + // + // A field mask to restrict the fields that are updated. Only + // top level fields of [Job][google.cloud.talent.v4.Job] are supported. + google.protobuf.FieldMask update_mask = 2; +} + +// Delete job request. +message DeleteJobRequest { + // Required. The resource name of the job to be deleted. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For + // example, "projects/foo/tenants/bar/jobs/baz". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "jobs.googleapis.com/Job" + } + ]; +} + +// An enum that specifies the job attributes that are returned in the +// [MatchingJob.job][google.cloud.talent.v4.SearchJobsResponse.MatchingJob.job] or +// [ListJobsResponse.jobs][google.cloud.talent.v4.ListJobsResponse.jobs] fields. +enum JobView { + // Default value. + JOB_VIEW_UNSPECIFIED = 0; + + // A ID only view of job, with following attributes: + // [Job.name][google.cloud.talent.v4.Job.name], [Job.requisition_id][google.cloud.talent.v4.Job.requisition_id], [Job.language_code][google.cloud.talent.v4.Job.language_code]. + JOB_VIEW_ID_ONLY = 1; + + // A minimal view of the job, with the following attributes: + // [Job.name][google.cloud.talent.v4.Job.name], [Job.requisition_id][google.cloud.talent.v4.Job.requisition_id], [Job.title][google.cloud.talent.v4.Job.title], + // [Job.company][google.cloud.talent.v4.Job.company], [Job.DerivedInfo.locations][google.cloud.talent.v4.Job.DerivedInfo.locations], [Job.language_code][google.cloud.talent.v4.Job.language_code]. + JOB_VIEW_MINIMAL = 2; + + // A small view of the job, with the following attributes in the search + // results: [Job.name][google.cloud.talent.v4.Job.name], [Job.requisition_id][google.cloud.talent.v4.Job.requisition_id], [Job.title][google.cloud.talent.v4.Job.title], + // [Job.company][google.cloud.talent.v4.Job.company], [Job.DerivedInfo.locations][google.cloud.talent.v4.Job.DerivedInfo.locations], [Job.visibility][google.cloud.talent.v4.Job.visibility], + // [Job.language_code][google.cloud.talent.v4.Job.language_code], [Job.description][google.cloud.talent.v4.Job.description]. + JOB_VIEW_SMALL = 3; + + // All available attributes are included in the search results. + JOB_VIEW_FULL = 4; +} + +// List jobs request. +message ListJobsRequest { + // Required. The resource name of the tenant under which the job is created. + // + // The format is "projects/{project_id}/tenants/{tenant_id}". For example, + // "projects/foo/tenants/bar". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "jobs.googleapis.com/Job" + } + ]; + + // Required. The filter string specifies the jobs to be enumerated. + // + // Supported operator: =, AND + // + // The fields eligible for filtering are: + // + // * `companyName` + // * `requisitionId` + // * `status` Available values: OPEN, EXPIRED, ALL. Defaults to + // OPEN if no value is specified. + // + // At least one of `companyName` and `requisitionId` must present or an + // INVALID_ARGUMENT error is thrown. + // + // Sample Query: + // + // * companyName = "projects/foo/tenants/bar/companies/baz" + // * companyName = "projects/foo/tenants/bar/companies/baz" AND + // requisitionId = "req-1" + // * companyName = "projects/foo/tenants/bar/companies/baz" AND + // status = "EXPIRED" + // * requisitionId = "req-1" + // * requisitionId = "req-1" AND status = "EXPIRED" + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // The starting point of a query result. + string page_token = 3; + + // The maximum number of jobs to be returned per page of results. + // + // If [job_view][google.cloud.talent.v4.ListJobsRequest.job_view] is set to [JobView.JOB_VIEW_ID_ONLY][google.cloud.talent.v4.JobView.JOB_VIEW_ID_ONLY], the maximum allowed + // page size is 1000. Otherwise, the maximum allowed page size is 100. + // + // Default is 100 if empty or a number < 1 is specified. + int32 page_size = 4; + + // The desired job attributes returned for jobs in the + // search response. Defaults to [JobView.JOB_VIEW_FULL][google.cloud.talent.v4.JobView.JOB_VIEW_FULL] if no value is + // specified. + JobView job_view = 5; +} + +// List jobs response. +message ListJobsResponse { + // The Jobs for a given company. + // + // The maximum number of items returned is based on the limit field + // provided in the request. + repeated Job jobs = 1; + + // A token to retrieve the next page of results. + string next_page_token = 2; + + // Additional information for the API invocation, such as the request + // tracking id. + ResponseMetadata metadata = 3; +} + +// The Request body of the `SearchJobs` call. +message SearchJobsRequest { + // A string-represented enumeration of the job search mode. The service + // operate differently for different modes of service. + enum SearchMode { + // The mode of the search method isn't specified. The default search + // behavior is identical to JOB_SEARCH search behavior. + SEARCH_MODE_UNSPECIFIED = 0; + + // The job search matches against all jobs, and featured jobs + // (jobs with promotionValue > 0) are not specially handled. + JOB_SEARCH = 1; + + // The job search matches only against featured jobs (jobs with a + // promotionValue > 0). This method doesn't return any jobs having a + // promotionValue <= 0. The search results order is determined by the + // promotionValue (jobs with a higher promotionValue are returned higher up + // in the search results), with relevance being used as a tiebreaker. + FEATURED_JOB_SEARCH = 2; + } + + // Controls whether highly similar jobs are returned next to each other in + // the search results. Jobs are identified as highly similar based on + // their titles, job categories, and locations. Highly similar results are + // clustered so that only one representative job of the cluster is + // displayed to the job seeker higher up in the results, with the other jobs + // being displayed lower down in the results. + // + // If you are using pageToken to page through the result set, + // latency might be lower but we can't guarantee that all results are + // returned. If you are using page offset, latency might be higher but all + // results are returned. + enum DiversificationLevel { + // The diversification level isn't specified. + DIVERSIFICATION_LEVEL_UNSPECIFIED = 0; + + // Disables diversification. Jobs that would normally be pushed to the last + // page would not have their positions altered. This may result in highly + // similar jobs appearing in sequence in the search results. + DISABLED = 1; + + // Default diversifying behavior. The result list is ordered so that + // highly similar results are pushed to the end of the last page of search + // results. + SIMPLE = 2; + + // Only one job from the same company will be shown at once, other jobs + // under same company are pushed to the end of the last page of search + // result. + ONE_PER_COMPANY = 3; + + // Similar to ONE_PER_COMPANY, but it allows at most two jobs in the + // same company to be shown at once, the other jobs under same company are + // pushed to the end of the last page of search result. + TWO_PER_COMPANY = 4; + + // The result list is ordered such that somewhat similar results are pushed + // to the end of the last page of the search results. This option is + // recommended if SIMPLE diversification does not diversify enough. + DIVERSIFY_BY_LOOSER_SIMILARITY = 5; + } + + // Controls what keyword matching behavior the search has. When keyword + // matching is enabled, a keyword match returns jobs that may not match given + // category filters when there are matching keywords. For example, for the + // query "program manager" with KeywordMatchMode set to KEYWORD_MATCH_ALL, a + // job posting with the title "software developer," which doesn't fall into + // "program manager" ontology, and "program manager" appearing in its + // description will be surfaced. + // + // For queries like "cloud" that don't contain title or + // location specific ontology, jobs with "cloud" keyword matches are returned + // regardless of this enum's value. + // + // Use [Company.keyword_searchable_job_custom_attributes][google.cloud.talent.v4.Company.keyword_searchable_job_custom_attributes] if + // company-specific globally matched custom field/attribute string values are + // needed. Enabling keyword match improves recall of subsequent search + // requests. + enum KeywordMatchMode { + // The keyword match option isn't specified. Defaults to + // [KeywordMatchMode.KEYWORD_MATCH_ALL][google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL] behavior. + KEYWORD_MATCH_MODE_UNSPECIFIED = 0; + + // Disables keyword matching. + KEYWORD_MATCH_DISABLED = 1; + + // Enable keyword matching over [Job.title][google.cloud.talent.v4.Job.title], + // [Job.description][google.cloud.talent.v4.Job.description], [Job.company_display_name][google.cloud.talent.v4.Job.company_display_name], [Job.addresses][google.cloud.talent.v4.Job.addresses], + // [Job.qualifications][google.cloud.talent.v4.Job.qualifications], and keyword searchable [Job.custom_attributes][google.cloud.talent.v4.Job.custom_attributes] + // fields. + KEYWORD_MATCH_ALL = 2; + + // Only enable keyword matching over [Job.title][google.cloud.talent.v4.Job.title]. + KEYWORD_MATCH_TITLE_ONLY = 3; + } + + // Custom ranking information for [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest]. + message CustomRankingInfo { + // The importance level for [CustomRankingInfo.ranking_expression][google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ranking_expression]. + enum ImportanceLevel { + // Default value if the importance level isn't specified. + IMPORTANCE_LEVEL_UNSPECIFIED = 0; + + // The given ranking expression is of None importance, existing relevance + // score (determined by API algorithm) dominates job's final ranking + // position. + NONE = 1; + + // The given ranking expression is of Low importance in terms of job's + // final ranking position compared to existing relevance + // score (determined by API algorithm). + LOW = 2; + + // The given ranking expression is of Mild importance in terms of job's + // final ranking position compared to existing relevance + // score (determined by API algorithm). + MILD = 3; + + // The given ranking expression is of Medium importance in terms of job's + // final ranking position compared to existing relevance + // score (determined by API algorithm). + MEDIUM = 4; + + // The given ranking expression is of High importance in terms of job's + // final ranking position compared to existing relevance + // score (determined by API algorithm). + HIGH = 5; + + // The given ranking expression is of Extreme importance, and dominates + // job's final ranking position with existing relevance + // score (determined by API algorithm) ignored. + EXTREME = 6; + } + + // Required. Controls over how important the score of + // [CustomRankingInfo.ranking_expression][google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ranking_expression] gets applied to job's final + // ranking position. + // + // An error is thrown if not specified. + ImportanceLevel importance_level = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Controls over how job documents get ranked on top of existing relevance + // score (determined by API algorithm). A combination of the ranking + // expression and relevance score is used to determine job's final ranking + // position. + // + // The syntax for this expression is a subset of Google SQL syntax. + // + // Supported operators are: +, -, *, /, where the left and right side of + // the operator is either a numeric [Job.custom_attributes][google.cloud.talent.v4.Job.custom_attributes] key, + // integer/double value or an expression that can be evaluated to a number. + // + // Parenthesis are supported to adjust calculation precedence. The + // expression must be < 200 characters in length. + // + // The expression is considered invalid for a job if the expression + // references custom attributes that are not populated on the job or if the + // expression results in a divide by zero. If an expression is invalid for a + // job, that job is demoted to the end of the results. + // + // Sample ranking expression + // (year + 25) * 0.25 - (freshness / 0.5) + string ranking_expression = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. The resource name of the tenant to search within. + // + // The format is "projects/{project_id}/tenants/{tenant_id}". For example, + // "projects/foo/tenants/bar". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "jobs.googleapis.com/Job" + } + ]; + + // Mode of a search. + // + // Defaults to [SearchMode.JOB_SEARCH][google.cloud.talent.v4.SearchJobsRequest.SearchMode.JOB_SEARCH]. + SearchMode search_mode = 2; + + // Required. The meta information collected about the job searcher, used to improve the + // search quality of the service. The identifiers (such as `user_id`) are + // provided by users, and must be unique and consistent. + RequestMetadata request_metadata = 3 [(google.api.field_behavior) = REQUIRED]; + + // Query used to search against jobs, such as keyword, location filters, etc. + JobQuery job_query = 4; + + // Controls whether to broaden the search when it produces sparse results. + // Broadened queries append results to the end of the matching results + // list. + // + // Defaults to false. + bool enable_broadening = 5; + + // An expression specifies a histogram request against matching jobs. + // + // Expression syntax is an aggregation function call with histogram facets and + // other options. + // + // Available aggregation function calls are: + // * `count(string_histogram_facet)`: Count the number of matching entities, + // for each distinct attribute value. + // * `count(numeric_histogram_facet, list of buckets)`: Count the number of + // matching entities within each bucket. + // + // A maximum of 200 histogram buckets are supported. + // + // Data types: + // + // * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + // * String: string like "any string with backslash escape for quote(\")." + // * Number: whole number and floating point number like 10, -1 and -0.01. + // * List: list of elements with comma(,) separator surrounded by square + // brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + // + // Built-in constants: + // + // * MIN (minimum number similar to java Double.MIN_VALUE) + // * MAX (maximum number similar to java Double.MAX_VALUE) + // + // Built-in functions: + // + // * bucket(start, end[, label]): bucket built-in function creates a bucket + // with range of [start, end). Note that the end is exclusive, for example, + // bucket(1, MAX, "positive number") or bucket(1, 10). + // + // Job histogram facets: + // + // * company_display_name: histogram by [Job.company_display_name][google.cloud.talent.v4.Job.company_display_name]. + // * employment_type: histogram by [Job.employment_types][google.cloud.talent.v4.Job.employment_types], for example, + // "FULL_TIME", "PART_TIME". + // * company_size (DEPRECATED): histogram by [CompanySize][google.cloud.talent.v4.CompanySize], for example, + // "SMALL", "MEDIUM", "BIG". + // * publish_time_in_day: histogram by the [Job.posting_publish_time][google.cloud.talent.v4.Job.posting_publish_time] + // in days. + // Must specify list of numeric buckets in spec. + // * publish_time_in_month: histogram by the [Job.posting_publish_time][google.cloud.talent.v4.Job.posting_publish_time] + // in months. + // Must specify list of numeric buckets in spec. + // * publish_time_in_year: histogram by the [Job.posting_publish_time][google.cloud.talent.v4.Job.posting_publish_time] + // in years. + // Must specify list of numeric buckets in spec. + // * degree_types: histogram by the [Job.degree_types][google.cloud.talent.v4.Job.degree_types], for example, + // "Bachelors", "Masters". + // * job_level: histogram by the [Job.job_level][google.cloud.talent.v4.Job.job_level], for example, "Entry + // Level". + // * country: histogram by the country code of jobs, for example, "US", "FR". + // * admin1: histogram by the admin1 code of jobs, which is a global + // placeholder referring to the state, province, or the particular term a + // country uses to define the geographic structure below the country level, + // for example, "CA", "IL". + // * city: histogram by a combination of the "city name, admin1 code". For + // example, "Mountain View, CA", "New York, NY". + // * admin1_country: histogram by a combination of the "admin1 code, country", + // for example, "CA, US", "IL, US". + // * city_coordinate: histogram by the city center's GPS coordinates (latitude + // and longitude), for example, 37.4038522,-122.0987765. Since the + // coordinates of a city center can change, customers may need to refresh + // them periodically. + // * locale: histogram by the [Job.language_code][google.cloud.talent.v4.Job.language_code], for example, "en-US", + // "fr-FR". + // * language: histogram by the language subtag of the [Job.language_code][google.cloud.talent.v4.Job.language_code], + // for example, "en", "fr". + // * category: histogram by the [JobCategory][google.cloud.talent.v4.JobCategory], for example, + // "COMPUTER_AND_IT", "HEALTHCARE". + // * base_compensation_unit: histogram by the + // [CompensationInfo.CompensationUnit][google.cloud.talent.v4.CompensationInfo.CompensationUnit] of base + // salary, for example, "WEEKLY", "MONTHLY". + // * base_compensation: histogram by the base salary. Must specify list of + // numeric buckets to group results by. + // * annualized_base_compensation: histogram by the base annualized salary. + // Must specify list of numeric buckets to group results by. + // * annualized_total_compensation: histogram by the total annualized salary. + // Must specify list of numeric buckets to group results by. + // * string_custom_attribute: histogram by string [Job.custom_attributes][google.cloud.talent.v4.Job.custom_attributes]. + // Values can be accessed via square bracket notations like + // string_custom_attribute["key1"]. + // * numeric_custom_attribute: histogram by numeric [Job.custom_attributes][google.cloud.talent.v4.Job.custom_attributes]. + // Values can be accessed via square bracket notations like + // numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + // group results by. + // + // Example expressions: + // + // * `count(admin1)` + // * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + // bucket(100000, MAX)])` + // * `count(string_custom_attribute["some-string-custom-attribute"])` + // * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + // [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + repeated HistogramQuery histogram_queries = 7; + + // The desired job attributes returned for jobs in the search response. + // Defaults to [JobView.JOB_VIEW_SMALL][google.cloud.talent.v4.JobView.JOB_VIEW_SMALL] if no value is specified. + JobView job_view = 8; + + // An integer that specifies the current offset (that is, starting result + // location, amongst the jobs deemed by the API as relevant) in search + // results. This field is only considered if [page_token][google.cloud.talent.v4.SearchJobsRequest.page_token] is unset. + // + // The maximum allowed value is 5000. Otherwise an error is thrown. + // + // For example, 0 means to return results starting from the first matching + // job, and 10 means to return from the 11th job. This can be used for + // pagination, (for example, pageSize = 10 and offset = 10 means to return + // from the second page). + int32 offset = 9; + + // A limit on the number of jobs returned in the search results. + // Increasing this value above the default value of 10 can increase search + // response time. The value can be between 1 and 100. + int32 max_page_size = 10; + + // The token specifying the current offset within + // search results. See [SearchJobsResponse.next_page_token][google.cloud.talent.v4.SearchJobsResponse.next_page_token] for + // an explanation of how to obtain the next set of query results. + string page_token = 11; + + // The criteria determining how search results are sorted. Default is + // `"relevance desc"`. + // + // Supported options are: + // + // * `"relevance desc"`: By relevance descending, as determined by the API + // algorithms. Relevance thresholding of query results is only available + // with this ordering. + // * `"posting_publish_time desc"`: By [Job.posting_publish_time][google.cloud.talent.v4.Job.posting_publish_time] + // descending. + // * `"posting_update_time desc"`: By [Job.posting_update_time][google.cloud.talent.v4.Job.posting_update_time] + // descending. + // * `"title"`: By [Job.title][google.cloud.talent.v4.Job.title] ascending. + // * `"title desc"`: By [Job.title][google.cloud.talent.v4.Job.title] descending. + // * `"annualized_base_compensation"`: By job's + // [CompensationInfo.annualized_base_compensation_range][google.cloud.talent.v4.CompensationInfo.annualized_base_compensation_range] ascending. Jobs + // whose annualized base compensation is unspecified are put at the end of + // search results. + // * `"annualized_base_compensation desc"`: By job's + // [CompensationInfo.annualized_base_compensation_range][google.cloud.talent.v4.CompensationInfo.annualized_base_compensation_range] descending. Jobs + // whose annualized base compensation is unspecified are put at the end of + // search results. + // * `"annualized_total_compensation"`: By job's + // [CompensationInfo.annualized_total_compensation_range][google.cloud.talent.v4.CompensationInfo.annualized_total_compensation_range] ascending. Jobs + // whose annualized base compensation is unspecified are put at the end of + // search results. + // * `"annualized_total_compensation desc"`: By job's + // [CompensationInfo.annualized_total_compensation_range][google.cloud.talent.v4.CompensationInfo.annualized_total_compensation_range] descending. Jobs + // whose annualized base compensation is unspecified are put at the end of + // search results. + // * `"custom_ranking desc"`: By the relevance score adjusted to the + // [SearchJobsRequest.CustomRankingInfo.ranking_expression][google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ranking_expression] with weight + // factor assigned by + // [SearchJobsRequest.CustomRankingInfo.importance_level][google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.importance_level] in descending + // order. + // * Location sorting: Use the special syntax to order jobs by distance:
+ // `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ // `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ // `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + // multiple locations. See details below.
+ // `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + // multiple locations. See details below.
+ // The string can have a maximum of 256 characters. When multiple distance + // centers are provided, a job that is close to any of the distance centers + // would have a high rank. When a job has multiple locations, the job + // location closest to one of the distance centers will be used. Jobs that + // don't have locations will be ranked at the bottom. Distance is calculated + // with a precision of 11.3 meters (37.4 feet). Diversification strategy is + // still applied unless explicitly disabled in + // [diversification_level][google.cloud.talent.v4.SearchJobsRequest.diversification_level]. + string order_by = 12; + + // Controls whether highly similar jobs are returned next to each other in + // the search results. Jobs are identified as highly similar based on + // their titles, job categories, and locations. Highly similar results are + // clustered so that only one representative job of the cluster is + // displayed to the job seeker higher up in the results, with the other jobs + // being displayed lower down in the results. + // + // Defaults to [DiversificationLevel.SIMPLE][google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel.SIMPLE] if no value + // is specified. + DiversificationLevel diversification_level = 13; + + // Controls over how job documents get ranked on top of existing relevance + // score (determined by API algorithm). + CustomRankingInfo custom_ranking_info = 14; + + // This field is deprecated. Please use + // [SearchJobsRequest.keyword_match_mode][google.cloud.talent.v4.SearchJobsRequest.keyword_match_mode] going forward. + // + // To migrate, disable_keyword_match set to false maps to + // [KeywordMatchMode.KEYWORD_MATCH_ALL][google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL], and disable_keyword_match set to + // true maps to [KeywordMatchMode.KEYWORD_MATCH_DISABLED][google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_DISABLED]. If + // [SearchJobsRequest.keyword_match_mode][google.cloud.talent.v4.SearchJobsRequest.keyword_match_mode] is set, this field is ignored. + // + // Controls whether to disable exact keyword match on [Job.title][google.cloud.talent.v4.Job.title], + // [Job.description][google.cloud.talent.v4.Job.description], [Job.company_display_name][google.cloud.talent.v4.Job.company_display_name], [Job.addresses][google.cloud.talent.v4.Job.addresses], + // [Job.qualifications][google.cloud.talent.v4.Job.qualifications]. When disable keyword match is turned off, a + // keyword match returns jobs that do not match given category filters when + // there are matching keywords. For example, for the query "program manager," + // a result is returned even if the job posting has the title "software + // developer," which doesn't fall into "program manager" ontology, but does + // have "program manager" appearing in its description. + // + // For queries like "cloud" that don't contain title or + // location specific ontology, jobs with "cloud" keyword matches are returned + // regardless of this flag's value. + // + // Use [Company.keyword_searchable_job_custom_attributes][google.cloud.talent.v4.Company.keyword_searchable_job_custom_attributes] if + // company-specific globally matched custom field/attribute string values are + // needed. Enabling keyword match improves recall of subsequent search + // requests. + // + // Defaults to false. + bool disable_keyword_match = 16 [deprecated = true]; + + // Controls what keyword match options to use. If both keyword_match_mode and + // disable_keyword_match are set, keyword_match_mode will take precedence. + // + // Defaults to [KeywordMatchMode.KEYWORD_MATCH_ALL][google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL] if no value + // is specified. + KeywordMatchMode keyword_match_mode = 18; +} + +// Response for SearchJob method. +message SearchJobsResponse { + // Job entry with metadata inside [SearchJobsResponse][google.cloud.talent.v4.SearchJobsResponse]. + message MatchingJob { + // Job resource that matches the specified [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest]. + Job job = 1; + + // A summary of the job with core information that's displayed on the search + // results listing page. + string job_summary = 2; + + // Contains snippets of text from the [Job.title][google.cloud.talent.v4.Job.title] field most + // closely matching a search query's keywords, if available. The matching + // query keywords are enclosed in HTML bold tags. + string job_title_snippet = 3; + + // Contains snippets of text from the [Job.description][google.cloud.talent.v4.Job.description] and similar + // fields that most closely match a search query's keywords, if available. + // All HTML tags in the original fields are stripped when returned in this + // field, and matching query keywords are enclosed in HTML bold tags. + string search_text_snippet = 4; + + // Commute information which is generated based on specified + // [CommuteFilter][google.cloud.talent.v4.CommuteFilter]. + CommuteInfo commute_info = 5; + } + + // Commute details related to this job. + message CommuteInfo { + // Location used as the destination in the commute calculation. + Location job_location = 1; + + // The number of seconds required to travel to the job location from the + // query location. A duration of 0 seconds indicates that the job isn't + // reachable within the requested duration, but was returned as part of an + // expanded query. + google.protobuf.Duration travel_duration = 2; + } + + // The Job entities that match the specified [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest]. + repeated MatchingJob matching_jobs = 1; + + // The histogram results that match with specified + // [SearchJobsRequest.histogram_queries][google.cloud.talent.v4.SearchJobsRequest.histogram_queries]. + repeated HistogramQueryResult histogram_query_results = 2; + + // The token that specifies the starting position of the next page of results. + // This field is empty if there are no more results. + string next_page_token = 3; + + // The location filters that the service applied to the specified query. If + // any filters are lat-lng based, the [Location.location_type][google.cloud.talent.v4.Location.location_type] is + // [Location.LocationType.LOCATION_TYPE_UNSPECIFIED][google.cloud.talent.v4.Location.LocationType.LOCATION_TYPE_UNSPECIFIED]. + repeated Location location_filters = 4; + + // Number of jobs that match the specified query. + // + // Note: This size is precise only if the total is less than 100,000. + int32 total_size = 6; + + // Additional information for the API invocation, such as the request + // tracking id. + ResponseMetadata metadata = 7; + + // If query broadening is enabled, we may append additional results from the + // broadened query. This number indicates how many of the jobs returned in the + // jobs field are from the broadened query. These results are always at the + // end of the jobs list. In particular, a value of 0, or if the field isn't + // set, all the jobs in the jobs list are from the original + // (without broadening) query. If this field is non-zero, subsequent requests + // with offset after this result set should contain all broadened results. + int32 broadened_query_jobs_count = 8; + + // The spell checking result, and correction. + SpellingCorrection spell_correction = 9; +} + +// Request to create a batch of jobs. +message BatchCreateJobsRequest { + // Required. The resource name of the tenant under which the job is created. + // + // The format is "projects/{project_id}/tenants/{tenant_id}". For example, + // "projects/foo/tenants/bar". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "jobs.googleapis.com/Job" + } + ]; + + // Required. The jobs to be created. + // A maximum of 200 jobs can be created in a batch. + repeated Job jobs = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request to update a batch of jobs. +message BatchUpdateJobsRequest { + // Required. The resource name of the tenant under which the job is created. + // + // The format is "projects/{project_id}/tenants/{tenant_id}". For example, + // "projects/foo/tenants/bar". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "jobs.googleapis.com/Job" + } + ]; + + // Required. The jobs to be updated. + // A maximum of 200 jobs can be updated in a batch. + repeated Job jobs = 2 [(google.api.field_behavior) = REQUIRED]; + + // Strongly recommended for the best service experience. Be aware that it will + // also increase latency when checking the status of a batch operation. + // + // If [update_mask][google.cloud.talent.v4.BatchUpdateJobsRequest.update_mask] is provided, only the specified fields in + // [Job][google.cloud.talent.v4.Job] are updated. Otherwise all the fields are updated. + // + // A field mask to restrict the fields that are updated. Only + // top level fields of [Job][google.cloud.talent.v4.Job] are supported. + // + // If [update_mask][google.cloud.talent.v4.BatchUpdateJobsRequest.update_mask] is provided, The [Job][google.cloud.talent.v4.Job] inside + // [JobResult][JobOperationResult.JobResult] + // will only contains fields that is updated, plus the Id of the Job. + // Otherwise, [Job][google.cloud.talent.v4.Job] will include all fields, which can yield a very + // large response. + google.protobuf.FieldMask update_mask = 3; +} + +// Request to delete a batch of jobs. +message BatchDeleteJobsRequest { + // Required. The resource name of the tenant under which the job is created. + // + // The format is "projects/{project_id}/tenants/{tenant_id}". For example, + // "projects/foo/tenants/bar". + // + // The parent of all of the jobs specified in `names` must match this field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "jobs.googleapis.com/Tenant" + } + ]; + + // The names of the jobs to delete. + // + // The format is "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". + // For example, "projects/foo/tenants/bar/jobs/baz". + // + // A maximum of 200 jobs can be deleted in a batch. + repeated string names = 2 [(google.api.resource_reference) = { + type: "jobs.googleapis.com/Job" + }]; +} + +// Mutation result of a job from a batch operation. +message JobResult { + // Here [Job][google.cloud.talent.v4.Job] only contains basic information including [name][google.cloud.talent.v4.Job.name], + // [company][google.cloud.talent.v4.Job.company], [language_code][google.cloud.talent.v4.Job.language_code] + // and [requisition_id][google.cloud.talent.v4.Job.requisition_id], use getJob method to retrieve + // detailed information of the created/updated job. + Job job = 1; + + // The status of the job processed. This field is populated if the + // processing of the [job][google.cloud.talent.v4.JobResult.job] fails. + google.rpc.Status status = 2; +} + +// The result of [JobService.BatchCreateJobs][google.cloud.talent.v4.JobService.BatchCreateJobs]. It's used to +// replace [google.longrunning.Operation.response][google.longrunning.Operation.response] in case of success. +message BatchCreateJobsResponse { + // List of job mutation results from a batch create operation. It can change + // until operation status is FINISHED, FAILED or CANCELLED. + repeated JobResult job_results = 1; +} + +// The result of [JobService.BatchUpdateJobs][google.cloud.talent.v4.JobService.BatchUpdateJobs]. It's used to +// replace [google.longrunning.Operation.response][google.longrunning.Operation.response] in case of success. +message BatchUpdateJobsResponse { + // List of job mutation results from a batch update operation. It can change + // until operation status is FINISHED, FAILED or CANCELLED. + repeated JobResult job_results = 1; +} + +// The result of [JobService.BatchDeleteJobs][google.cloud.talent.v4.JobService.BatchDeleteJobs]. It's used to +// replace [google.longrunning.Operation.response][google.longrunning.Operation.response] in case of success. +message BatchDeleteJobsResponse { + // List of job mutation results from a batch delete operation. It can change + // until operation status is FINISHED, FAILED or CANCELLED. + repeated JobResult job_results = 1; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4/tenant.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4/tenant.proto new file mode 100644 index 00000000000..018c5db5875 --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4/tenant.proto @@ -0,0 +1,51 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.talent.v4; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4;talent"; +option java_multiple_files = true; +option java_outer_classname = "TenantProto"; +option java_package = "com.google.cloud.talent.v4"; +option objc_class_prefix = "CTS"; + +// A Tenant resource represents a tenant in the service. A tenant is a group or +// entity that shares common access with specific privileges for resources like +// jobs. Customer may create multiple tenants to provide data isolation for +// different groups. +message Tenant { + option (google.api.resource) = { + type: "jobs.googleapis.com/Tenant" + pattern: "projects/{project}/tenants/{tenant}" + }; + + // Required during tenant update. + // + // The resource name for a tenant. This is generated by the service when a + // tenant is created. + // + // The format is "projects/{project_id}/tenants/{tenant_id}", for example, + // "projects/foo/tenants/bar". + string name = 1; + + // Required. Client side tenant identifier, used to uniquely identify the tenant. + // + // The maximum number of allowed characters is 255. + string external_id = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4/tenant_service.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4/tenant_service.proto new file mode 100644 index 00000000000..d509062c806 --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4/tenant_service.proto @@ -0,0 +1,176 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/talent/v4/common.proto"; +import "google/cloud/talent/v4/tenant.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4;talent"; +option java_multiple_files = true; +option java_outer_classname = "TenantServiceProto"; +option java_package = "com.google.cloud.talent.v4"; +option objc_class_prefix = "CTS"; + +// A service that handles tenant management, including CRUD and enumeration. +service TenantService { + option (google.api.default_host) = "jobs.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/jobs"; + + // Creates a new tenant entity. + rpc CreateTenant(CreateTenantRequest) returns (Tenant) { + option (google.api.http) = { + post: "/v4/{parent=projects/*}/tenants" + body: "tenant" + }; + option (google.api.method_signature) = "parent,tenant"; + } + + // Retrieves specified tenant. + rpc GetTenant(GetTenantRequest) returns (Tenant) { + option (google.api.http) = { + get: "/v4/{name=projects/*/tenants/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates specified tenant. + rpc UpdateTenant(UpdateTenantRequest) returns (Tenant) { + option (google.api.http) = { + patch: "/v4/{tenant.name=projects/*/tenants/*}" + body: "tenant" + }; + option (google.api.method_signature) = "tenant,update_mask"; + } + + // Deletes specified tenant. + rpc DeleteTenant(DeleteTenantRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v4/{name=projects/*/tenants/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all tenants associated with the project. + rpc ListTenants(ListTenantsRequest) returns (ListTenantsResponse) { + option (google.api.http) = { + get: "/v4/{parent=projects/*}/tenants" + }; + option (google.api.method_signature) = "parent"; + } +} + +// The Request of the CreateTenant method. +message CreateTenantRequest { + // Required. Resource name of the project under which the tenant is created. + // + // The format is "projects/{project_id}", for example, + // "projects/foo". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The tenant to be created. + Tenant tenant = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for getting a tenant by name. +message GetTenantRequest { + // Required. The resource name of the tenant to be retrieved. + // + // The format is "projects/{project_id}/tenants/{tenant_id}", for example, + // "projects/foo/tenants/bar". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "jobs.googleapis.com/Tenant" + } + ]; +} + +// Request for updating a specified tenant. +message UpdateTenantRequest { + // Required. The tenant resource to replace the current resource in the system. + Tenant tenant = 1 [(google.api.field_behavior) = REQUIRED]; + + // Strongly recommended for the best service experience. + // + // If [update_mask][google.cloud.talent.v4.UpdateTenantRequest.update_mask] is provided, only the specified fields in + // [tenant][google.cloud.talent.v4.UpdateTenantRequest.tenant] are updated. Otherwise all the fields are updated. + // + // A field mask to specify the tenant fields to be updated. Only + // top level fields of [Tenant][google.cloud.talent.v4.Tenant] are supported. + google.protobuf.FieldMask update_mask = 2; +} + +// Request to delete a tenant. +message DeleteTenantRequest { + // Required. The resource name of the tenant to be deleted. + // + // The format is "projects/{project_id}/tenants/{tenant_id}", for example, + // "projects/foo/tenants/bar". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "jobs.googleapis.com/Tenant" + } + ]; +} + +// List tenants for which the client has ACL visibility. +message ListTenantsRequest { + // Required. Resource name of the project under which the tenant is created. + // + // The format is "projects/{project_id}", for example, + // "projects/foo". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // The starting indicator from which to return results. + string page_token = 2; + + // The maximum number of tenants to be returned, at most 100. + // Default is 100 if a non-positive number is provided. + int32 page_size = 3; +} + +// The List tenants response object. +message ListTenantsResponse { + // Tenants for the current client. + repeated Tenant tenants = 1; + + // A token to retrieve the next page of results. + string next_page_token = 2; + + // Additional information for the API invocation, such as the request + // tracking id. + ResponseMetadata metadata = 3; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/batch.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/batch.proto new file mode 100644 index 00000000000..64a40e9cac0 --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/batch.proto @@ -0,0 +1,23 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4beta1; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; +option java_multiple_files = true; +option java_outer_classname = "BatchProto"; +option java_package = "com.google.cloud.talent.v4beta1"; +option objc_class_prefix = "CTS"; diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/common.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/common.proto new file mode 100644 index 00000000000..6125bcc8c17 --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/common.proto @@ -0,0 +1,865 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4beta1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/type/latlng.proto"; +import "google/type/money.proto"; +import "google/type/postal_address.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.talent.v4beta1"; +option objc_class_prefix = "CTS"; + +// Message representing a period of time between two timestamps. +message TimestampRange { + // Begin of the period (inclusive). + google.protobuf.Timestamp start_time = 1; + + // End of the period (exclusive). + google.protobuf.Timestamp end_time = 2; +} + +// An enum that represents the size of the company. +enum CompanySize { + // Default value if the size isn't specified. + COMPANY_SIZE_UNSPECIFIED = 0; + + // The company has less than 50 employees. + MINI = 1; + + // The company has between 50 and 99 employees. + SMALL = 2; + + // The company has between 100 and 499 employees. + SMEDIUM = 3; + + // The company has between 500 and 999 employees. + MEDIUM = 4; + + // The company has between 1,000 and 4,999 employees. + BIG = 5; + + // The company has between 5,000 and 9,999 employees. + BIGGER = 6; + + // The company has 10,000 or more employees. + GIANT = 7; +} + +// An enum that represents employee benefits included with the job. +enum JobBenefit { + // Default value if the type isn't specified. + JOB_BENEFIT_UNSPECIFIED = 0; + + // The job includes access to programs that support child care, such + // as daycare. + CHILD_CARE = 1; + + // The job includes dental services covered by a dental + // insurance plan. + DENTAL = 2; + + // The job offers specific benefits to domestic partners. + DOMESTIC_PARTNER = 3; + + // The job allows for a flexible work schedule. + FLEXIBLE_HOURS = 4; + + // The job includes health services covered by a medical insurance plan. + MEDICAL = 5; + + // The job includes a life insurance plan provided by the employer or + // available for purchase by the employee. + LIFE_INSURANCE = 6; + + // The job allows for a leave of absence to a parent to care for a newborn + // child. + PARENTAL_LEAVE = 7; + + // The job includes a workplace retirement plan provided by the + // employer or available for purchase by the employee. + RETIREMENT_PLAN = 8; + + // The job allows for paid time off due to illness. + SICK_DAYS = 9; + + // The job includes paid time off for vacation. + VACATION = 10; + + // The job includes vision services covered by a vision + // insurance plan. + VISION = 11; +} + +// Educational degree level defined in International Standard Classification +// of Education (ISCED). +enum DegreeType { + // Default value. Represents no degree, or early childhood education. + // Maps to ISCED code 0. + // Ex) Kindergarten + DEGREE_TYPE_UNSPECIFIED = 0; + + // Primary education which is typically the first stage of compulsory + // education. ISCED code 1. + // Ex) Elementary school + PRIMARY_EDUCATION = 1; + + // Lower secondary education; First stage of secondary education building on + // primary education, typically with a more subject-oriented curriculum. + // ISCED code 2. + // Ex) Middle school + LOWER_SECONDARY_EDUCATION = 2; + + // Middle education; Second/final stage of secondary education preparing for + // tertiary education and/or providing skills relevant to employment. + // Usually with an increased range of subject options and streams. ISCED + // code 3. + // Ex) High school + UPPER_SECONDARY_EDUCATION = 3; + + // Adult Remedial Education; Programmes providing learning experiences that + // build on secondary education and prepare for labour market entry and/or + // tertiary education. The content is broader than secondary but not as + // complex as tertiary education. ISCED code 4. + ADULT_REMEDIAL_EDUCATION = 4; + + // Associate's or equivalent; Short first tertiary programmes that are + // typically practically-based, occupationally-specific and prepare for + // labour market entry. These programmes may also provide a pathway to other + // tertiary programmes. ISCED code 5. + ASSOCIATES_OR_EQUIVALENT = 5; + + // Bachelor's or equivalent; Programmes designed to provide intermediate + // academic and/or professional knowledge, skills and competencies leading + // to a first tertiary degree or equivalent qualification. ISCED code 6. + BACHELORS_OR_EQUIVALENT = 6; + + // Master's or equivalent; Programmes designed to provide advanced academic + // and/or professional knowledge, skills and competencies leading to a + // second tertiary degree or equivalent qualification. ISCED code 7. + MASTERS_OR_EQUIVALENT = 7; + + // Doctoral or equivalent; Programmes designed primarily to lead to an + // advanced research qualification, usually concluding with the submission + // and defense of a substantive dissertation of publishable quality based on + // original research. ISCED code 8. + DOCTORAL_OR_EQUIVALENT = 8; +} + +// An enum that represents the employment type of a job. +enum EmploymentType { + // The default value if the employment type isn't specified. + EMPLOYMENT_TYPE_UNSPECIFIED = 0; + + // The job requires working a number of hours that constitute full + // time employment, typically 40 or more hours per week. + FULL_TIME = 1; + + // The job entails working fewer hours than a full time job, + // typically less than 40 hours a week. + PART_TIME = 2; + + // The job is offered as a contracted, as opposed to a salaried employee, + // position. + CONTRACTOR = 3; + + // The job is offered as a contracted position with the understanding + // that it's converted into a full-time position at the end of the + // contract. Jobs of this type are also returned by a search for + // [EmploymentType.CONTRACTOR][google.cloud.talent.v4beta1.EmploymentType.CONTRACTOR] jobs. + CONTRACT_TO_HIRE = 4; + + // The job is offered as a temporary employment opportunity, usually + // a short-term engagement. + TEMPORARY = 5; + + // The job is a fixed-term opportunity for students or entry-level job + // seekers to obtain on-the-job training, typically offered as a summer + // position. + INTERN = 6; + + // The is an opportunity for an individual to volunteer, where there's no + // expectation of compensation for the provided services. + VOLUNTEER = 7; + + // The job requires an employee to work on an as-needed basis with a + // flexible schedule. + PER_DIEM = 8; + + // The job involves employing people in remote areas and flying them + // temporarily to the work site instead of relocating employees and their + // families permanently. + FLY_IN_FLY_OUT = 9; + + // The job does not fit any of the other listed types. + OTHER_EMPLOYMENT_TYPE = 10; +} + +// An enum that represents the required experience level required for the job. +enum JobLevel { + // The default value if the level isn't specified. + JOB_LEVEL_UNSPECIFIED = 0; + + // Entry-level individual contributors, typically with less than 2 years of + // experience in a similar role. Includes interns. + ENTRY_LEVEL = 1; + + // Experienced individual contributors, typically with 2+ years of + // experience in a similar role. + EXPERIENCED = 2; + + // Entry- to mid-level managers responsible for managing a team of people. + MANAGER = 3; + + // Senior-level managers responsible for managing teams of managers. + DIRECTOR = 4; + + // Executive-level managers and above, including C-level positions. + EXECUTIVE = 5; +} + +// An enum that represents the categorization or primary focus of specific +// role. This value is different than the "industry" associated with a role, +// which is related to the categorization of the company listing the job. +enum JobCategory { + // The default value if the category isn't specified. + JOB_CATEGORY_UNSPECIFIED = 0; + + // An accounting and finance job, such as an Accountant. + ACCOUNTING_AND_FINANCE = 1; + + // An administrative and office job, such as an Administrative Assistant. + ADMINISTRATIVE_AND_OFFICE = 2; + + // An advertising and marketing job, such as Marketing Manager. + ADVERTISING_AND_MARKETING = 3; + + // An animal care job, such as Veterinarian. + ANIMAL_CARE = 4; + + // An art, fashion, or design job, such as Designer. + ART_FASHION_AND_DESIGN = 5; + + // A business operations job, such as Business Operations Manager. + BUSINESS_OPERATIONS = 6; + + // A cleaning and facilities job, such as Custodial Staff. + CLEANING_AND_FACILITIES = 7; + + // A computer and IT job, such as Systems Administrator. + COMPUTER_AND_IT = 8; + + // A construction job, such as General Laborer. + CONSTRUCTION = 9; + + // A customer service job, such s Cashier. + CUSTOMER_SERVICE = 10; + + // An education job, such as School Teacher. + EDUCATION = 11; + + // An entertainment and travel job, such as Flight Attendant. + ENTERTAINMENT_AND_TRAVEL = 12; + + // A farming or outdoor job, such as Park Ranger. + FARMING_AND_OUTDOORS = 13; + + // A healthcare job, such as Registered Nurse. + HEALTHCARE = 14; + + // A human resources job, such as Human Resources Director. + HUMAN_RESOURCES = 15; + + // An installation, maintenance, or repair job, such as Electrician. + INSTALLATION_MAINTENANCE_AND_REPAIR = 16; + + // A legal job, such as Law Clerk. + LEGAL = 17; + + // A management job, often used in conjunction with another category, + // such as Store Manager. + MANAGEMENT = 18; + + // A manufacturing or warehouse job, such as Assembly Technician. + MANUFACTURING_AND_WAREHOUSE = 19; + + // A media, communications, or writing job, such as Media Relations. + MEDIA_COMMUNICATIONS_AND_WRITING = 20; + + // An oil, gas or mining job, such as Offshore Driller. + OIL_GAS_AND_MINING = 21; + + // A personal care and services job, such as Hair Stylist. + PERSONAL_CARE_AND_SERVICES = 22; + + // A protective services job, such as Security Guard. + PROTECTIVE_SERVICES = 23; + + // A real estate job, such as Buyer's Agent. + REAL_ESTATE = 24; + + // A restaurant and hospitality job, such as Restaurant Server. + RESTAURANT_AND_HOSPITALITY = 25; + + // A sales and/or retail job, such Sales Associate. + SALES_AND_RETAIL = 26; + + // A science and engineering job, such as Lab Technician. + SCIENCE_AND_ENGINEERING = 27; + + // A social services or non-profit job, such as Case Worker. + SOCIAL_SERVICES_AND_NON_PROFIT = 28; + + // A sports, fitness, or recreation job, such as Personal Trainer. + SPORTS_FITNESS_AND_RECREATION = 29; + + // A transportation or logistics job, such as Truck Driver. + TRANSPORTATION_AND_LOGISTICS = 30; +} + +// An enum that represents the job posting region. In most cases, job postings +// don't need to specify a region. If a region is given, jobs are +// eligible for searches in the specified region. +enum PostingRegion { + // If the region is unspecified, the job is only returned if it + // matches the [LocationFilter][google.cloud.talent.v4beta1.LocationFilter]. + POSTING_REGION_UNSPECIFIED = 0; + + // In addition to exact location matching, job posting is returned when the + // [LocationFilter][google.cloud.talent.v4beta1.LocationFilter] in the search query is in the same administrative area + // as the returned job posting. For example, if a `ADMINISTRATIVE_AREA` job + // is posted in "CA, USA", it's returned if [LocationFilter][google.cloud.talent.v4beta1.LocationFilter] has + // "Mountain View". + // + // Administrative area refers to top-level administrative subdivision of this + // country. For example, US state, IT region, UK constituent nation and + // JP prefecture. + ADMINISTRATIVE_AREA = 1; + + // In addition to exact location matching, job is returned when + // [LocationFilter][google.cloud.talent.v4beta1.LocationFilter] in search query is in the same country as this job. + // For example, if a `NATION_WIDE` job is posted in "USA", it's + // returned if [LocationFilter][google.cloud.talent.v4beta1.LocationFilter] has 'Mountain View'. + NATION = 2; + + // Job allows employees to work remotely (telecommute). + // If locations are provided with this value, the job is + // considered as having a location, but telecommuting is allowed. + TELECOMMUTE = 3; +} + +// Deprecated. All resources are only visible to the owner. +// +// An enum that represents who has view access to the resource. +enum Visibility { + option deprecated = true; + + // Default value. + VISIBILITY_UNSPECIFIED = 0; + + // The resource is only visible to the GCP account who owns it. + ACCOUNT_ONLY = 1; + + // The resource is visible to the owner and may be visible to other + // applications and processes at Google. + SHARED_WITH_GOOGLE = 2; + + // The resource is visible to the owner and may be visible to all other API + // clients. + SHARED_WITH_PUBLIC = 3; +} + +// Option for HTML content sanitization on user input fields, for example, job +// description. By setting this option, user can determine whether and how +// sanitization is performed on these fields. +enum HtmlSanitization { + // Default value. + HTML_SANITIZATION_UNSPECIFIED = 0; + + // Disables sanitization on HTML input. + HTML_SANITIZATION_DISABLED = 1; + + // Sanitizes HTML input, only accepts bold, italic, ordered list, and + // unordered list markup tags. + SIMPLE_FORMATTING_ONLY = 2; +} + +// Method for commute. +enum CommuteMethod { + // Commute method isn't specified. + COMMUTE_METHOD_UNSPECIFIED = 0; + + // Commute time is calculated based on driving time. + DRIVING = 1; + + // Commute time is calculated based on public transit including bus, metro, + // subway, and so on. + TRANSIT = 2; + + // Commute time is calculated based on walking time. + WALKING = 3; + + // Commute time is calculated based on biking time. + CYCLING = 4; +} + +// A resource that represents a location with full geographic information. +message Location { + // An enum which represents the type of a location. + enum LocationType { + // Default value if the type isn't specified. + LOCATION_TYPE_UNSPECIFIED = 0; + + // A country level location. + COUNTRY = 1; + + // A state or equivalent level location. + ADMINISTRATIVE_AREA = 2; + + // A county or equivalent level location. + SUB_ADMINISTRATIVE_AREA = 3; + + // A city or equivalent level location. + LOCALITY = 4; + + // A postal code level location. + POSTAL_CODE = 5; + + // A sublocality is a subdivision of a locality, for example a city borough, + // ward, or arrondissement. Sublocalities are usually recognized by a local + // political authority. For example, Manhattan and Brooklyn are recognized + // as boroughs by the City of New York, and are therefore modeled as + // sublocalities. + SUB_LOCALITY = 6; + + // A district or equivalent level location. + SUB_LOCALITY_1 = 7; + + // A smaller district or equivalent level display. + SUB_LOCALITY_2 = 8; + + // A neighborhood level location. + NEIGHBORHOOD = 9; + + // A street address level location. + STREET_ADDRESS = 10; + } + + // The type of a location, which corresponds to the address lines field of + // [google.type.PostalAddress][google.type.PostalAddress]. For example, "Downtown, Atlanta, GA, USA" + // has a type of [LocationType.NEIGHBORHOOD][google.cloud.talent.v4beta1.Location.LocationType.NEIGHBORHOOD], and "Kansas City, KS, USA" + // has a type of [LocationType.LOCALITY][google.cloud.talent.v4beta1.Location.LocationType.LOCALITY]. + LocationType location_type = 1; + + // Postal address of the location that includes human readable information, + // such as postal delivery and payments addresses. Given a postal address, + // a postal service can deliver items to a premises, P.O. Box, or other + // delivery location. + google.type.PostalAddress postal_address = 2; + + // An object representing a latitude/longitude pair. + google.type.LatLng lat_lng = 3; + + // Radius in miles of the job location. This value is derived from the + // location bounding box in which a circle with the specified radius + // centered from [google.type.LatLng][google.type.LatLng] covers the area associated with the + // job location. + // For example, currently, "Mountain View, CA, USA" has a radius of + // 6.17 miles. + double radius_miles = 4; +} + +// Meta information related to the job searcher or entity +// conducting the job search. This information is used to improve the +// performance of the service. +message RequestMetadata { + // Required if [allow_missing_ids][google.cloud.talent.v4beta1.RequestMetadata.allow_missing_ids] is unset or `false`. + // + // The client-defined scope or source of the service call, which typically + // is the domain on + // which the service has been implemented and is currently being run. + // + // For example, if the service is being run by client Foo, Inc., on + // job board www.foo.com and career site www.bar.com, then this field is + // set to "foo.com" for use on the job board, and "bar.com" for use on the + // career site. + // + // Note that any improvements to the model for a particular tenant site rely + // on this field being set correctly to a unique domain. + // + // The maximum number of allowed characters is 255. + string domain = 1; + + // Required if [allow_missing_ids][google.cloud.talent.v4beta1.RequestMetadata.allow_missing_ids] is unset or `false`. + // + // A unique session identification string. A session is defined as the + // duration of an end user's interaction with the service over a certain + // period. + // Obfuscate this field for privacy concerns before + // providing it to the service. + // + // Note that any improvements to the model for a particular tenant site rely + // on this field being set correctly to a unique session ID. + // + // The maximum number of allowed characters is 255. + string session_id = 2; + + // Required if [allow_missing_ids][google.cloud.talent.v4beta1.RequestMetadata.allow_missing_ids] is unset or `false`. + // + // A unique user identification string, as determined by the client. + // To have the strongest positive impact on search quality + // make sure the client-level is unique. + // Obfuscate this field for privacy concerns before + // providing it to the service. + // + // Note that any improvements to the model for a particular tenant site rely + // on this field being set correctly to a unique user ID. + // + // The maximum number of allowed characters is 255. + string user_id = 3; + + // Only set when any of [domain][google.cloud.talent.v4beta1.RequestMetadata.domain], [session_id][google.cloud.talent.v4beta1.RequestMetadata.session_id] and [user_id][google.cloud.talent.v4beta1.RequestMetadata.user_id] isn't + // available for some reason. It is highly recommended not to set this field + // and provide accurate [domain][google.cloud.talent.v4beta1.RequestMetadata.domain], [session_id][google.cloud.talent.v4beta1.RequestMetadata.session_id] and [user_id][google.cloud.talent.v4beta1.RequestMetadata.user_id] for the + // best service experience. + bool allow_missing_ids = 4; + + // The type of device used by the job seeker at the time of the call to the + // service. + DeviceInfo device_info = 5; +} + +// Additional information returned to client, such as debugging information. +message ResponseMetadata { + // A unique id associated with this call. + // This id is logged for tracking purposes. + string request_id = 1; +} + +// Device information collected from the job seeker, candidate, or +// other entity conducting the job search. Providing this information improves +// the quality of the search results across devices. +message DeviceInfo { + // An enumeration describing an API access portal and exposure mechanism. + enum DeviceType { + // The device type isn't specified. + DEVICE_TYPE_UNSPECIFIED = 0; + + // A desktop web browser, such as, Chrome, Firefox, Safari, or Internet + // Explorer) + WEB = 1; + + // A mobile device web browser, such as a phone or tablet with a Chrome + // browser. + MOBILE_WEB = 2; + + // An Android device native application. + ANDROID = 3; + + // An iOS device native application. + IOS = 4; + + // A bot, as opposed to a device operated by human beings, such as a web + // crawler. + BOT = 5; + + // Other devices types. + OTHER = 6; + } + + // Type of the device. + DeviceType device_type = 1; + + // A device-specific ID. The ID must be a unique identifier that + // distinguishes the device from other devices. + string id = 2; +} + +// Custom attribute values that are either filterable or non-filterable. +message CustomAttribute { + // Exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must be specified. + // + // This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or + // `CASE_INSENSITIVE_MATCH`) search. + // For filterable `string_value`s, a maximum total number of 200 values + // is allowed, with each `string_value` has a byte size of no more than + // 500B. For unfilterable `string_values`, the maximum total byte size of + // unfilterable `string_values` is 50KB. + // + // Empty string isn't allowed. + repeated string string_values = 1; + + // Exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must be specified. + // + // This field is used to perform number range search. + // (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`. + // + // Currently at most 1 [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] is supported. + repeated int64 long_values = 2; + + // If the `filterable` flag is true, the custom field values may be used for + // custom attribute filters [JobQuery.custom_attribute_filter][google.cloud.talent.v4beta1.JobQuery.custom_attribute_filter]. + // If false, these values may not be used for custom attribute filters. + // + // Default is false. + bool filterable = 3; + + // If the `keyword_searchable` flag is true, the keywords in custom fields are + // searchable by keyword match. + // If false, the values are not searchable by keyword match. + // + // Default is false. + bool keyword_searchable = 4; +} + +// Spell check result. +message SpellingCorrection { + // Indicates if the query was corrected by the spell checker. + bool corrected = 1; + + // Correction output consisting of the corrected keyword string. + string corrected_text = 2; + + // Corrected output with html tags to highlight the corrected words. + // Corrected words are called out with the "..." html tags. + // + // For example, the user input query is "software enginear", where the second + // word, "enginear," is incorrect. It should be "engineer". When spelling + // correction is enabled, this value is + // "software engineer". + string corrected_html = 3; +} + +// Job compensation details. +message CompensationInfo { + // A compensation entry that represents one component of compensation, such + // as base pay, bonus, or other compensation type. + // + // Annualization: One compensation entry can be annualized if + // - it contains valid [amount][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.amount] or [range][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.range]. + // - and its [expected_units_per_year][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.expected_units_per_year] is set or can be derived. + // Its annualized range is determined as ([amount][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.amount] or [range][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.range]) times + // [expected_units_per_year][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.expected_units_per_year]. + message CompensationEntry { + // Compensation type. + // + // Default is [CompensationType.COMPENSATION_TYPE_UNSPECIFIED][google.cloud.talent.v4beta1.CompensationInfo.CompensationType.COMPENSATION_TYPE_UNSPECIFIED]. + CompensationType type = 1; + + // Frequency of the specified amount. + // + // Default is [CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED][google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED]. + CompensationUnit unit = 2; + + // Compensation amount. It could be a fixed amount or a floating range. + oneof compensation_amount { + // Compensation amount. + google.type.Money amount = 3; + + // Compensation range. + CompensationRange range = 4; + } + + // Compensation description. For example, could + // indicate equity terms or provide additional context to an estimated + // bonus. + string description = 5; + + // Expected number of units paid each year. If not specified, when + // [Job.employment_types][google.cloud.talent.v4beta1.Job.employment_types] is FULLTIME, a default value is inferred + // based on [unit][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.unit]. Default values: + // - HOURLY: 2080 + // - DAILY: 260 + // - WEEKLY: 52 + // - MONTHLY: 12 + // - ANNUAL: 1 + google.protobuf.DoubleValue expected_units_per_year = 6; + } + + // The type of compensation. + // + // For compensation amounts specified in non-monetary amounts, + // describe the compensation scheme in the [CompensationEntry.description][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.description]. + // + // For example, tipping format is described in + // [CompensationEntry.description][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.description] (for example, "expect 15-20% tips based + // on customer bill.") and an estimate of the tips provided in + // [CompensationEntry.amount][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.amount] or [CompensationEntry.range][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.range] ($10 per hour). + // + // For example, equity is described in [CompensationEntry.description][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.description] + // (for example, "1% - 2% equity vesting over 4 years, 1 year cliff") and + // value estimated in [CompensationEntry.amount][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.amount] or + // [CompensationEntry.range][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.range]. If no value estimate is possible, units are + // [CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED][google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED] and then further + // clarified in [CompensationEntry.description][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.description] field. + enum CompensationType { + // Default value. + COMPENSATION_TYPE_UNSPECIFIED = 0; + + // Base compensation: Refers to the fixed amount of money paid to an + // employee by an employer in return for work performed. Base compensation + // does not include benefits, bonuses or any other potential compensation + // from an employer. + BASE = 1; + + // Bonus. + BONUS = 2; + + // Signing bonus. + SIGNING_BONUS = 3; + + // Equity. + EQUITY = 4; + + // Profit sharing. + PROFIT_SHARING = 5; + + // Commission. + COMMISSIONS = 6; + + // Tips. + TIPS = 7; + + // Other compensation type. + OTHER_COMPENSATION_TYPE = 8; + } + + // Pay frequency. + enum CompensationUnit { + // Default value. + COMPENSATION_UNIT_UNSPECIFIED = 0; + + // Hourly. + HOURLY = 1; + + // Daily. + DAILY = 2; + + // Weekly + WEEKLY = 3; + + // Monthly. + MONTHLY = 4; + + // Yearly. + YEARLY = 5; + + // One time. + ONE_TIME = 6; + + // Other compensation units. + OTHER_COMPENSATION_UNIT = 7; + } + + // Compensation range. + message CompensationRange { + // The maximum amount of compensation. If left empty, the value is set + // to a maximal compensation value and the currency code is set to + // match the [currency code][google.type.Money.currency_code] of + // min_compensation. + google.type.Money max_compensation = 2; + + // The minimum amount of compensation. If left empty, the value is set + // to zero and the currency code is set to match the + // [currency code][google.type.Money.currency_code] of max_compensation. + google.type.Money min_compensation = 1; + } + + // Job compensation information. + // + // At most one entry can be of type + // [CompensationInfo.CompensationType.BASE][google.cloud.talent.v4beta1.CompensationInfo.CompensationType.BASE], which is + // referred as **base compensation entry** for the job. + repeated CompensationEntry entries = 1; + + // Output only. Annualized base compensation range. Computed as base compensation entry's + // [CompensationEntry.amount][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.amount] times + // [CompensationEntry.expected_units_per_year][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.expected_units_per_year]. + // + // See [CompensationEntry][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry] for explanation on compensation annualization. + CompensationRange annualized_base_compensation_range = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Annualized total compensation range. Computed as all compensation entries' + // [CompensationEntry.amount][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.amount] times + // [CompensationEntry.expected_units_per_year][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.expected_units_per_year]. + // + // See [CompensationEntry][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry] for explanation on compensation annualization. + CompensationRange annualized_total_compensation_range = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Metadata used for long running operations returned by CTS batch APIs. +// It's used to replace [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata]. +message BatchOperationMetadata { + enum State { + // Default value. + STATE_UNSPECIFIED = 0; + + // The batch operation is being prepared for processing. + INITIALIZING = 1; + + // The batch operation is actively being processed. + PROCESSING = 2; + + // The batch operation is processed, and at least one item has been + // successfully processed. + SUCCEEDED = 3; + + // The batch operation is done and no item has been successfully processed. + FAILED = 4; + + // The batch operation is in the process of cancelling after + // [google.longrunning.Operations.CancelOperation][google.longrunning.Operations.CancelOperation] is called. + CANCELLING = 5; + + // The batch operation is done after + // [google.longrunning.Operations.CancelOperation][google.longrunning.Operations.CancelOperation] is called. Any items + // processed before cancelling are returned in the response. + CANCELLED = 6; + } + + // The state of a long running operation. + State state = 1; + + // More detailed information about operation state. + string state_description = 2; + + // Count of successful item(s) inside an operation. + int32 success_count = 3; + + // Count of failed item(s) inside an operation. + int32 failure_count = 4; + + // Count of total item(s) inside an operation. + int32 total_count = 5; + + // The time when the batch operation is created. + google.protobuf.Timestamp create_time = 6; + + // The time when the batch operation status is updated. The metadata and the + // [update_time][google.cloud.talent.v4beta1.BatchOperationMetadata.update_time] is refreshed every minute otherwise cached data is + // returned. + google.protobuf.Timestamp update_time = 7; + + // The time when the batch operation is finished and + // [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to `true`. + google.protobuf.Timestamp end_time = 8; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/company.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/company.proto new file mode 100644 index 00000000000..7c1e2ea56df --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/company.proto @@ -0,0 +1,121 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/talent/v4beta1/common.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; +option java_multiple_files = true; +option java_outer_classname = "CompanyResourceProto"; +option java_package = "com.google.cloud.talent.v4beta1"; +option objc_class_prefix = "CTS"; + +// A Company resource represents a company in the service. A company is the +// entity that owns job postings, that is, the hiring entity responsible for +// employing applicants for the job position. +message Company { + option (google.api.resource) = { + type: "jobs.googleapis.com/Company" + pattern: "projects/{project}/tenants/{tenant}/companies/{company}" + pattern: "projects/{project}/companies/{company}" + }; + + // Derived details about the company. + message DerivedInfo { + // A structured headquarters location of the company, resolved from + // [Company.headquarters_address][google.cloud.talent.v4beta1.Company.headquarters_address] if provided. + Location headquarters_location = 1; + } + + // Required during company update. + // + // The resource name for a company. This is generated by the service when a + // company is created. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for + // example, "projects/foo/tenants/bar/companies/baz". + // + // If tenant id is unspecified, the default tenant is used. For + // example, "projects/foo/companies/bar". + string name = 1; + + // Required. The display name of the company, for example, "Google LLC". + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Client side company identifier, used to uniquely identify the + // company. + // + // The maximum number of allowed characters is 255. + string external_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // The employer's company size. + CompanySize size = 4; + + // The street address of the company's main headquarters, which may be + // different from the job location. The service attempts + // to geolocate the provided address, and populates a more specific + // location wherever possible in [DerivedInfo.headquarters_location][google.cloud.talent.v4beta1.Company.DerivedInfo.headquarters_location]. + string headquarters_address = 5; + + // Set to true if it is the hiring agency that post jobs for other + // employers. + // + // Defaults to false if not provided. + bool hiring_agency = 6; + + // Equal Employment Opportunity legal disclaimer text to be + // associated with all jobs, and typically to be displayed in all + // roles. + // + // The maximum number of allowed characters is 500. + string eeo_text = 7; + + // The URI representing the company's primary web site or home page, + // for example, "https://www.google.com". + // + // The maximum number of allowed characters is 255. + string website_uri = 8; + + // The URI to employer's career site or careers page on the employer's web + // site, for example, "https://careers.google.com". + string career_site_uri = 9; + + // A URI that hosts the employer's company logo. + string image_uri = 10; + + // This field is deprecated. Please set the searchability of the custom + // attribute in the [Job.custom_attributes][google.cloud.talent.v4beta1.Job.custom_attributes] going forward. + // + // A list of keys of filterable [Job.custom_attributes][google.cloud.talent.v4beta1.Job.custom_attributes], whose + // corresponding `string_values` are used in keyword searches. Jobs with + // `string_values` under these specified field keys are returned if any + // of the values match the search keyword. Custom field values with + // parenthesis, brackets and special symbols are not searchable as-is, + // and those keyword queries must be surrounded by quotes. + repeated string keyword_searchable_job_custom_attributes = 11 [deprecated = true]; + + // Output only. Derived details about the company. + DerivedInfo derived_info = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates whether a company is flagged to be suspended from + // public availability by the service when job content appears suspicious, + // abusive, or spammy. + bool suspended = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/company_service.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/company_service.proto new file mode 100644 index 00000000000..9fd72023af5 --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/company_service.proto @@ -0,0 +1,214 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/talent/v4beta1/common.proto"; +import "google/cloud/talent/v4beta1/company.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; +option java_multiple_files = true; +option java_outer_classname = "CompanyServiceProto"; +option java_package = "com.google.cloud.talent.v4beta1"; +option objc_class_prefix = "CTS"; + +// A service that handles company management, including CRUD and enumeration. +service CompanyService { + option (google.api.default_host) = "jobs.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/jobs"; + + // Creates a new company entity. + rpc CreateCompany(CreateCompanyRequest) returns (Company) { + option (google.api.http) = { + post: "/v4beta1/{parent=projects/*/tenants/*}/companies" + body: "*" + additional_bindings { + post: "/v4beta1/{parent=projects/*}/companies" + body: "*" + } + }; + option (google.api.method_signature) = "parent,company"; + } + + // Retrieves specified company. + rpc GetCompany(GetCompanyRequest) returns (Company) { + option (google.api.http) = { + get: "/v4beta1/{name=projects/*/tenants/*/companies/*}" + additional_bindings { + get: "/v4beta1/{name=projects/*/companies/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Updates specified company. + rpc UpdateCompany(UpdateCompanyRequest) returns (Company) { + option (google.api.http) = { + patch: "/v4beta1/{company.name=projects/*/tenants/*/companies/*}" + body: "*" + additional_bindings { + patch: "/v4beta1/{company.name=projects/*/companies/*}" + body: "*" + } + }; + option (google.api.method_signature) = "company"; + } + + // Deletes specified company. + // Prerequisite: The company has no jobs associated with it. + rpc DeleteCompany(DeleteCompanyRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v4beta1/{name=projects/*/tenants/*/companies/*}" + additional_bindings { + delete: "/v4beta1/{name=projects/*/companies/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists all companies associated with the project. + rpc ListCompanies(ListCompaniesRequest) returns (ListCompaniesResponse) { + option (google.api.http) = { + get: "/v4beta1/{parent=projects/*/tenants/*}/companies" + additional_bindings { + get: "/v4beta1/{parent=projects/*}/companies" + } + }; + option (google.api.method_signature) = "parent"; + } +} + +// The Request of the CreateCompany method. +message CreateCompanyRequest { + // Required. Resource name of the tenant under which the company is created. + // + // The format is "projects/{project_id}/tenants/{tenant_id}", for example, + // "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + // is created, for example, "projects/foo". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "jobs.googleapis.com/Company" + } + ]; + + // Required. The company to be created. + Company company = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for getting a company by name. +message GetCompanyRequest { + // Required. The resource name of the company to be retrieved. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for + // example, "projects/api-test-project/tenants/foo/companies/bar". + // + // If tenant id is unspecified, the default tenant is used, for + // example, "projects/api-test-project/companies/bar". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "jobs.googleapis.com/Company" + } + ]; +} + +// Request for updating a specified company. +message UpdateCompanyRequest { + // Required. The company resource to replace the current resource in the system. + Company company = 1 [(google.api.field_behavior) = REQUIRED]; + + // Strongly recommended for the best service experience. + // + // If [update_mask][google.cloud.talent.v4beta1.UpdateCompanyRequest.update_mask] is provided, only the specified fields in + // [company][google.cloud.talent.v4beta1.UpdateCompanyRequest.company] are updated. Otherwise all the fields are updated. + // + // A field mask to specify the company fields to be updated. Only + // top level fields of [Company][google.cloud.talent.v4beta1.Company] are supported. + google.protobuf.FieldMask update_mask = 2; +} + +// Request to delete a company. +message DeleteCompanyRequest { + // Required. The resource name of the company to be deleted. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for + // example, "projects/foo/tenants/bar/companies/baz". + // + // If tenant id is unspecified, the default tenant is used, for + // example, "projects/foo/companies/bar". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "jobs.googleapis.com/Company" + } + ]; +} + +// List companies for which the client has ACL visibility. +message ListCompaniesRequest { + // Required. Resource name of the tenant under which the company is created. + // + // The format is "projects/{project_id}/tenants/{tenant_id}", for example, + // "projects/foo/tenant/bar". + // + // If tenant id is unspecified, the default tenant will be used, for + // example, "projects/foo". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "jobs.googleapis.com/Company" + } + ]; + + // The starting indicator from which to return results. + string page_token = 2; + + // The maximum number of companies to be returned, at most 100. + // Default is 100 if a non-positive number is provided. + int32 page_size = 3; + + // Set to true if the companies requested must have open jobs. + // + // Defaults to false. + // + // If true, at most [page_size][google.cloud.talent.v4beta1.ListCompaniesRequest.page_size] of companies are fetched, among which + // only those with open jobs are returned. + bool require_open_jobs = 4; +} + +// The List companies response object. +message ListCompaniesResponse { + // Companies for the current client. + repeated Company companies = 1; + + // A token to retrieve the next page of results. + string next_page_token = 2; + + // Additional information for the API invocation, such as the request + // tracking id. + ResponseMetadata metadata = 3; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/completion_service.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/completion_service.proto new file mode 100644 index 00000000000..88d2977ecd4 --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/completion_service.proto @@ -0,0 +1,163 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/talent/v4beta1/common.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; +option java_multiple_files = true; +option java_outer_classname = "CompletionServiceProto"; +option java_package = "com.google.cloud.talent.v4beta1"; +option objc_class_prefix = "CTS"; + +// A service handles auto completion. +service Completion { + option (google.api.default_host) = "jobs.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/jobs"; + + // Completes the specified prefix with keyword suggestions. + // Intended for use by a job search auto-complete search box. + rpc CompleteQuery(CompleteQueryRequest) returns (CompleteQueryResponse) { + option (google.api.http) = { + get: "/v4beta1/{parent=projects/*/tenants/*}:complete" + additional_bindings { + get: "/v4beta1/{parent=projects/*}:complete" + } + }; + } +} + +// Auto-complete parameters. +message CompleteQueryRequest { + // Enum to specify the scope of completion. + enum CompletionScope { + // Default value. + COMPLETION_SCOPE_UNSPECIFIED = 0; + + // Suggestions are based only on the data provided by the client. + TENANT = 1; + + // Suggestions are based on all jobs data in the system that's visible to + // the client + PUBLIC = 2; + } + + // Enum to specify auto-completion topics. + enum CompletionType { + // Default value. + COMPLETION_TYPE_UNSPECIFIED = 0; + + // Suggest job titles for jobs autocomplete. + // + // For [CompletionType.JOB_TITLE][google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType.JOB_TITLE] type, only open jobs with the same + // [language_codes][google.cloud.talent.v4beta1.CompleteQueryRequest.language_codes] are returned. + JOB_TITLE = 1; + + // Suggest company names for jobs autocomplete. + // + // For [CompletionType.COMPANY_NAME][google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType.COMPANY_NAME] type, + // only companies having open jobs with the same [language_codes][google.cloud.talent.v4beta1.CompleteQueryRequest.language_codes] are + // returned. + COMPANY_NAME = 2; + + // Suggest both job titles and company names for jobs autocomplete. + // + // For [CompletionType.COMBINED][google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType.COMBINED] type, only open jobs with the same + // [language_codes][google.cloud.talent.v4beta1.CompleteQueryRequest.language_codes] or companies having open jobs with the same + // [language_codes][google.cloud.talent.v4beta1.CompleteQueryRequest.language_codes] are returned. + COMBINED = 3; + } + + // Required. Resource name of tenant the completion is performed within. + // + // The format is "projects/{project_id}/tenants/{tenant_id}", for example, + // "projects/foo/tenant/bar". + // + // If tenant id is unspecified, the default tenant is used, for + // example, "projects/foo". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "jobs.googleapis.com/Company" + } + ]; + + // Required. The query used to generate suggestions. + // + // The maximum number of allowed characters is 255. + string query = 2 [(google.api.field_behavior) = REQUIRED]; + + // The list of languages of the query. This is + // the BCP-47 language code, such as "en-US" or "sr-Latn". + // For more information, see + // [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + // + // The maximum number of allowed characters is 255. + repeated string language_codes = 3; + + // Required. Completion result count. + // + // The maximum allowed page size is 10. + int32 page_size = 4 [(google.api.field_behavior) = REQUIRED]; + + // If provided, restricts completion to specified company. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for + // example, "projects/foo/tenants/bar/companies/baz". + // + // If tenant id is unspecified, the default tenant is used, for + // example, "projects/foo". + string company = 5 [(google.api.resource_reference) = { + type: "jobs.googleapis.com/Company" + }]; + + // The scope of the completion. The defaults is [CompletionScope.PUBLIC][google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope.PUBLIC]. + CompletionScope scope = 6; + + // The completion topic. The default is [CompletionType.COMBINED][google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType.COMBINED]. + CompletionType type = 7; +} + +// Response of auto-complete query. +message CompleteQueryResponse { + // Resource that represents completion results. + message CompletionResult { + // The suggestion for the query. + string suggestion = 1; + + // The completion topic. + CompleteQueryRequest.CompletionType type = 2; + + // The URI of the company image for + // [COMPANY_NAME][google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType.COMPANY_NAME]. + string image_uri = 3; + } + + // Results of the matching job/company candidates. + repeated CompletionResult completion_results = 1; + + // Additional information for the API invocation, such as the request + // tracking id. + ResponseMetadata metadata = 2; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/event.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/event.proto new file mode 100644 index 00000000000..24f769ec27e --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/event.proto @@ -0,0 +1,177 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4beta1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; +option java_multiple_files = true; +option java_outer_classname = "EventProto"; +option java_package = "com.google.cloud.talent.v4beta1"; +option objc_class_prefix = "CTS"; + +// An event issued when an end user interacts with the application that +// implements Cloud Talent Solution. Providing this information improves the +// quality of results for the API clients, enabling the +// service to perform optimally. The number of events sent must be consistent +// with other calls, such as job searches, issued to the service by the client. +message ClientEvent { + // Strongly recommended for the best service experience. + // + // A unique ID generated in the API responses. It can be found in + // [ResponseMetadata.request_id][google.cloud.talent.v4beta1.ResponseMetadata.request_id]. + string request_id = 1; + + // Required. A unique identifier, generated by the client application. + string event_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The timestamp of the event. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. + // + // The detail information of a specific event type. + oneof event { + // An event issued when a job seeker interacts with the application that + // implements Cloud Talent Solution. + JobEvent job_event = 5; + } + + // Notes about the event provided by recruiters or other users, for example, + // feedback on why a profile was bookmarked. + string event_notes = 9; +} + +// An event issued when a job seeker interacts with the application that +// implements Cloud Talent Solution. +message JobEvent { + // An enumeration of an event attributed to the behavior of the end user, + // such as a job seeker. + enum JobEventType { + // The event is unspecified by other provided values. + JOB_EVENT_TYPE_UNSPECIFIED = 0; + + // The job seeker or other entity interacting with the service has + // had a job rendered in their view, such as in a list of search results in + // a compressed or clipped format. This event is typically associated with + // the viewing of a jobs list on a single page by a job seeker. + IMPRESSION = 1; + + // The job seeker, or other entity interacting with the service, has + // viewed the details of a job, including the full description. This + // event doesn't apply to the viewing a snippet of a job appearing as a + // part of the job search results. Viewing a snippet is associated with an + // [impression][google.cloud.talent.v4beta1.JobEvent.JobEventType.IMPRESSION]). + VIEW = 2; + + // The job seeker or other entity interacting with the service + // performed an action to view a job and was redirected to a different + // website for job. + VIEW_REDIRECT = 3; + + // The job seeker or other entity interacting with the service + // began the process or demonstrated the intention of applying for a job. + APPLICATION_START = 4; + + // The job seeker or other entity interacting with the service + // submitted an application for a job. + APPLICATION_FINISH = 5; + + // The job seeker or other entity interacting with the service + // submitted an application for a job with a single click without + // entering information. If a job seeker performs this action, send only + // this event to the service. Do not also send + // [JobEventType.APPLICATION_START][google.cloud.talent.v4beta1.JobEvent.JobEventType.APPLICATION_START] or [JobEventType.APPLICATION_FINISH][google.cloud.talent.v4beta1.JobEvent.JobEventType.APPLICATION_FINISH] + // events. + APPLICATION_QUICK_SUBMISSION = 6; + + // The job seeker or other entity interacting with the service + // performed an action to apply to a job and was redirected to a different + // website to complete the application. + APPLICATION_REDIRECT = 7; + + // The job seeker or other entity interacting with the service began the + // process or demonstrated the intention of applying for a job from the + // search results page without viewing the details of the job posting. + // If sending this event, JobEventType.VIEW event shouldn't be sent. + APPLICATION_START_FROM_SEARCH = 8; + + // The job seeker, or other entity interacting with the service, performs an + // action with a single click from the search results page to apply to a job + // (without viewing the details of the job posting), and is redirected + // to a different website to complete the application. If a candidate + // performs this action, send only this event to the service. Do not also + // send [JobEventType.APPLICATION_START][google.cloud.talent.v4beta1.JobEvent.JobEventType.APPLICATION_START], + // [JobEventType.APPLICATION_FINISH][google.cloud.talent.v4beta1.JobEvent.JobEventType.APPLICATION_FINISH] or [JobEventType.VIEW][google.cloud.talent.v4beta1.JobEvent.JobEventType.VIEW] events. + APPLICATION_REDIRECT_FROM_SEARCH = 9; + + // This event should be used when a company submits an application + // on behalf of a job seeker. This event is intended for use by staffing + // agencies attempting to place candidates. + APPLICATION_COMPANY_SUBMIT = 10; + + // The job seeker or other entity interacting with the service demonstrated + // an interest in a job by bookmarking or saving it. + BOOKMARK = 11; + + // The job seeker or other entity interacting with the service was + // sent a notification, such as an email alert or device notification, + // containing one or more jobs listings generated by the service. + NOTIFICATION = 12; + + // The job seeker or other entity interacting with the service was + // employed by the hiring entity (employer). Send this event + // only if the job seeker was hired through an application that was + // initiated by a search conducted through the Cloud Talent Solution + // service. + HIRED = 13; + + // A recruiter or staffing agency submitted an application on behalf of the + // candidate after interacting with the service to identify a suitable job + // posting. + SENT_CV = 14; + + // The entity interacting with the service (for example, the job seeker), + // was granted an initial interview by the hiring entity (employer). This + // event should only be sent if the job seeker was granted an interview as + // part of an application that was initiated by a search conducted through / + // recommendation provided by the Cloud Talent Solution service. + INTERVIEW_GRANTED = 15; + } + + // Required. The type of the event (see [JobEventType][google.cloud.talent.v4beta1.JobEvent.JobEventType]). + JobEventType type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The [job name(s)][google.cloud.talent.v4beta1.Job.name] associated with this event. + // For example, if this is an [impression][google.cloud.talent.v4beta1.JobEvent.JobEventType.IMPRESSION] event, + // this field contains the identifiers of all jobs shown to the job seeker. + // If this was a [view][google.cloud.talent.v4beta1.JobEvent.JobEventType.VIEW] event, this field contains the + // identifier of the viewed job. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}", for + // example, "projects/foo/tenants/bar/jobs/baz". + repeated string jobs = 2 [(google.api.field_behavior) = REQUIRED]; + + // The [profile name][google.cloud.talent.v4beta1.Profile.name] associated with this client event. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}", + // for example, "projects/foo/tenants/bar/profiles/baz". + string profile = 3; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/event_service.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/event_service.proto new file mode 100644 index 00000000000..6dfdfed6120 --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/event_service.proto @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.talent.v4beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/talent/v4beta1/event.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; +option java_multiple_files = true; +option java_outer_classname = "EventServiceProto"; +option java_package = "com.google.cloud.talent.v4beta1"; +option objc_class_prefix = "CTS"; + +// A service handles client event report. +service EventService { + option (google.api.default_host) = "jobs.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/jobs"; + + // Report events issued when end user interacts with customer's application + // that uses Cloud Talent Solution. You may inspect the created events in + // [self service + // tools](https://console.cloud.google.com/talent-solution/overview). + // [Learn + // more](https://cloud.google.com/talent-solution/docs/management-tools) + // about self service tools. + rpc CreateClientEvent(CreateClientEventRequest) returns (ClientEvent) { + option (google.api.http) = { + post: "/v4beta1/{parent=projects/*/tenants/*}/clientEvents" + body: "*" + additional_bindings { + post: "/v4beta1/{parent=projects/*}/clientEvents" + body: "*" + } + }; + option (google.api.method_signature) = "parent,client_event"; + } +} + +// The report event request. +message CreateClientEventRequest { + // Required. Resource name of the tenant under which the event is created. + // + // The format is "projects/{project_id}/tenants/{tenant_id}", for example, + // "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + // is created, for example, "projects/foo". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "jobs.googleapis.com/Company" + } + ]; + + // Required. Events issued when end user interacts with customer's application that + // uses Cloud Talent Solution. + ClientEvent client_event = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/filters.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/filters.proto new file mode 100644 index 00000000000..03050604657 --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/filters.proto @@ -0,0 +1,370 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4beta1; + +import "google/api/field_behavior.proto"; +import "google/cloud/talent/v4beta1/common.proto"; +import "google/protobuf/duration.proto"; +import "google/type/latlng.proto"; +import "google/type/timeofday.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; +option java_multiple_files = true; +option java_outer_classname = "FiltersProto"; +option java_package = "com.google.cloud.talent.v4beta1"; +option objc_class_prefix = "CTS"; + +// The query required to perform a search query. +message JobQuery { + // The query string that matches against the job title, description, and + // location fields. + // + // The maximum number of allowed characters is 255. + string query = 1; + + // The language code of [query][google.cloud.talent.v4beta1.JobQuery.query]. For example, "en-US". This field helps to + // better interpret the query. + // + // If a value isn't specified, the query language code is automatically + // detected, which may not be accurate. + // + // Language code should be in BCP-47 format, such as "en-US" or "sr-Latn". + // For more information, see + // [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + string query_language_code = 14; + + // This filter specifies the company entities to search against. + // + // If a value isn't specified, jobs are searched for against all + // companies. + // + // If multiple values are specified, jobs are searched against the + // companies specified. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}". For + // example, "projects/foo/tenants/bar/companies/baz". + // + // If tenant id is unspecified, the default tenant is used. For + // example, "projects/foo/companies/bar". + // + // At most 20 company filters are allowed. + repeated string companies = 2; + + // The location filter specifies geo-regions containing the jobs to + // search against. See [LocationFilter][google.cloud.talent.v4beta1.LocationFilter] for more information. + // + // If a location value isn't specified, jobs fitting the other search + // criteria are retrieved regardless of where they're located. + // + // If multiple values are specified, jobs are retrieved from any of the + // specified locations. If different values are specified for the + // [LocationFilter.distance_in_miles][google.cloud.talent.v4beta1.LocationFilter.distance_in_miles] parameter, the maximum provided + // distance is used for all locations. + // + // At most 5 location filters are allowed. + repeated LocationFilter location_filters = 3; + + // The category filter specifies the categories of jobs to search against. + // See [JobCategory][google.cloud.talent.v4beta1.JobCategory] for more information. + // + // If a value isn't specified, jobs from any category are searched against. + // + // If multiple values are specified, jobs from any of the specified + // categories are searched against. + repeated JobCategory job_categories = 4; + + // Allows filtering jobs by commute time with different travel methods (for + // example, driving or public transit). + // + // Note: This only works when you specify a [CommuteMethod][google.cloud.talent.v4beta1.CommuteMethod]. In this case, + // [location_filters][google.cloud.talent.v4beta1.JobQuery.location_filters] is ignored. + // + // Currently we don't support sorting by commute time. + CommuteFilter commute_filter = 5; + + // This filter specifies the company [Company.display_name][google.cloud.talent.v4beta1.Company.display_name] + // of the jobs to search against. The company name must match the value + // exactly. + // + // Alternatively, the value being searched for can be wrapped in different + // match operators. + // `SUBSTRING_MATCH([value])` + // The company name must contain a case insensitive substring match of the + // value. Using this function may increase latency. + // + // Sample Value: `SUBSTRING_MATCH(google)` + // + // `MULTI_WORD_TOKEN_MATCH([value])` + // The value will be treated as a multi word token and the company name must + // contain a case insensitive match of the value. Using this function may + // increase latency. + // + // Sample Value: `MULTI_WORD_TOKEN_MATCH(google)` + // + // If a value isn't specified, jobs within the search results are + // associated with any company. + // + // If multiple values are specified, jobs within the search results may be + // associated with any of the specified companies. + // + // At most 20 company display name filters are allowed. + repeated string company_display_names = 6; + + // This search filter is applied only to + // [Job.compensation_info][google.cloud.talent.v4beta1.Job.compensation_info]. For example, if the filter is specified + // as "Hourly job with per-hour compensation > $15", only jobs meeting + // these criteria are searched. If a filter isn't defined, all open jobs + // are searched. + CompensationFilter compensation_filter = 7; + + // This filter specifies a structured syntax to match against the + // [Job.custom_attributes][google.cloud.talent.v4beta1.Job.custom_attributes] marked as `filterable`. + // + // The syntax for this expression is a subset of SQL syntax. + // + // Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the + // left of the operator is a custom field key and the right of the operator + // is a number or a quoted string. You must escape backslash (\\) and + // quote (\") characters. + // + // Supported functions are `LOWER([field_name])` to + // perform a case insensitive match and `EMPTY([field_name])` to filter on the + // existence of a key. + // + // Boolean expressions (AND/OR/NOT) are supported up to 3 levels of + // nesting (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100 + // comparisons or functions are allowed in the expression. The expression + // must be < 10000 bytes in length. + // + // Sample Query: + // `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND + // driving_years > 10` + string custom_attribute_filter = 8; + + // This flag controls the spell-check feature. If false, the + // service attempts to correct a misspelled query, + // for example, "enginee" is corrected to "engineer". + // + // Defaults to false: a spell check is performed. + bool disable_spell_check = 9; + + // The employment type filter specifies the employment type of jobs to + // search against, such as [EmploymentType.FULL_TIME][google.cloud.talent.v4beta1.EmploymentType.FULL_TIME]. + // + // If a value isn't specified, jobs in the search results includes any + // employment type. + // + // If multiple values are specified, jobs in the search results include + // any of the specified employment types. + repeated EmploymentType employment_types = 10; + + // This filter specifies the locale of jobs to search against, + // for example, "en-US". + // + // If a value isn't specified, the search results can contain jobs in any + // locale. + // + // + // Language codes should be in BCP-47 format, such as "en-US" or "sr-Latn". + // For more information, see + // [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + // + // At most 10 language code filters are allowed. + repeated string language_codes = 11; + + // Jobs published within a range specified by this filter are searched + // against. + TimestampRange publish_time_range = 12; + + // This filter specifies a list of job names to be excluded during search. + // + // At most 400 excluded job names are allowed. + repeated string excluded_jobs = 13; +} + +// Geographic region of the search. +message LocationFilter { + // Specify whether to include telecommute jobs. + enum TelecommutePreference { + // Default value if the telecommute preference isn't specified. + TELECOMMUTE_PREFERENCE_UNSPECIFIED = 0; + + // Deprecated: Ignore telecommute status of jobs. Use + // TELECOMMUTE_JOBS_EXCLUDED if want to exclude telecommute jobs. + TELECOMMUTE_EXCLUDED = 1 [deprecated = true]; + + // Allow telecommute jobs. + TELECOMMUTE_ALLOWED = 2; + + // Exclude telecommute jobs. + TELECOMMUTE_JOBS_EXCLUDED = 3; + } + + // The address name, such as "Mountain View" or "Bay Area". + string address = 1; + + // CLDR region code of the country/region. This field may be used in two ways: + // + // 1) If telecommute preference is not set, this field is used address + // ambiguity of the user-input address. For example, "Liverpool" may refer to + // "Liverpool, NY, US" or "Liverpool, UK". This region code biases the + // address resolution toward a specific country or territory. If this field is + // not set, address resolution is biased toward the United States by default. + // + // 2) If telecommute preference is set to TELECOMMUTE_ALLOWED, the + // telecommute location filter will be limited to the region specified in this + // field. If this field is not set, the telecommute job locations will not be + // + // See + // https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/territory_information.html + // for details. Example: "CH" for Switzerland. + string region_code = 2; + + // The latitude and longitude of the geographic center to search from. This + // field is ignored if `address` is provided. + google.type.LatLng lat_lng = 3; + + // The distance_in_miles is applied when the location being searched for is + // identified as a city or smaller. This field is ignored if the location + // being searched for is a state or larger. + double distance_in_miles = 4; + + // Allows the client to return jobs without a + // set location, specifically, telecommuting jobs (telecommuting is considered + // by the service as a special location). + // [Job.posting_region][google.cloud.talent.v4beta1.Job.posting_region] indicates if a job permits telecommuting. + // If this field is set to [TelecommutePreference.TELECOMMUTE_ALLOWED][google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.TELECOMMUTE_ALLOWED], + // telecommuting jobs are searched, and [address][google.cloud.talent.v4beta1.LocationFilter.address] and [lat_lng][google.cloud.talent.v4beta1.LocationFilter.lat_lng] are + // ignored. If not set or set to + // [TelecommutePreference.TELECOMMUTE_EXCLUDED][google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.TELECOMMUTE_EXCLUDED], the telecommute status of + // the jobs is ignored. Jobs that have [PostingRegion.TELECOMMUTE][google.cloud.talent.v4beta1.PostingRegion.TELECOMMUTE] and have + // additional [Job.addresses][google.cloud.talent.v4beta1.Job.addresses] may still be matched based on other location + // filters using [address][google.cloud.talent.v4beta1.LocationFilter.address] or [latlng][]. + // + // This filter can be used by itself to search exclusively for telecommuting + // jobs, or it can be combined with another location + // filter to search for a combination of job locations, + // such as "Mountain View" or "telecommuting" jobs. However, when used in + // combination with other location filters, telecommuting jobs can be + // treated as less relevant than other jobs in the search response. + // + // This field is only used for job search requests. + TelecommutePreference telecommute_preference = 5; + + // Whether to apply negation to the filter so profiles matching the filter + // are excluded. + bool negated = 6; +} + +// Filter on job compensation type and amount. +message CompensationFilter { + // Specify the type of filtering. + enum FilterType { + // Filter type unspecified. Position holder, INVALID, should never be used. + FILTER_TYPE_UNSPECIFIED = 0; + + // Filter by `base compensation entry's` unit. A job is a match if and + // only if the job contains a base CompensationEntry and the base + // CompensationEntry's unit matches provided [units][google.cloud.talent.v4beta1.CompensationFilter.units]. + // Populate one or more [units][google.cloud.talent.v4beta1.CompensationFilter.units]. + // + // See [CompensationInfo.CompensationEntry][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry] for definition of + // base compensation entry. + UNIT_ONLY = 1; + + // Filter by `base compensation entry's` unit and amount / range. A job + // is a match if and only if the job contains a base CompensationEntry, and + // the base entry's unit matches provided + // [CompensationUnit][google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit] and + // amount or range overlaps with provided + // [CompensationRange][google.cloud.talent.v4beta1.CompensationInfo.CompensationRange]. + // + // See [CompensationInfo.CompensationEntry][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry] for definition of + // base compensation entry. + // + // Set exactly one [units][google.cloud.talent.v4beta1.CompensationFilter.units] and populate [range][google.cloud.talent.v4beta1.CompensationFilter.range]. + UNIT_AND_AMOUNT = 2; + + // Filter by annualized base compensation amount and `base compensation + // entry's` unit. Populate [range][google.cloud.talent.v4beta1.CompensationFilter.range] and zero or more [units][google.cloud.talent.v4beta1.CompensationFilter.units]. + ANNUALIZED_BASE_AMOUNT = 3; + + // Filter by annualized total compensation amount and `base compensation + // entry's` unit . Populate [range][google.cloud.talent.v4beta1.CompensationFilter.range] and zero or more [units][google.cloud.talent.v4beta1.CompensationFilter.units]. + ANNUALIZED_TOTAL_AMOUNT = 4; + } + + // Required. Type of filter. + FilterType type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Specify desired `base compensation entry's` + // [CompensationInfo.CompensationUnit][google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit]. + repeated CompensationInfo.CompensationUnit units = 2 [(google.api.field_behavior) = REQUIRED]; + + // Compensation range. + CompensationInfo.CompensationRange range = 3; + + // If set to true, jobs with unspecified compensation range fields are + // included. + bool include_jobs_with_unspecified_compensation_range = 4; +} + +// Parameters needed for commute search. +message CommuteFilter { + // The traffic density to use when calculating commute time. + enum RoadTraffic { + // Road traffic situation isn't specified. + ROAD_TRAFFIC_UNSPECIFIED = 0; + + // Optimal commute time without considering any traffic impact. + TRAFFIC_FREE = 1; + + // Commute time calculation takes in account the peak traffic impact. + BUSY_HOUR = 2; + } + + // Required. The method of transportation to calculate the commute time for. + CommuteMethod commute_method = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The latitude and longitude of the location to calculate the + // commute time from. + google.type.LatLng start_coordinates = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The maximum travel time in seconds. The maximum allowed value is `3600s` + // (one hour). Format is `123s`. + google.protobuf.Duration travel_duration = 3 [(google.api.field_behavior) = REQUIRED]; + + // If `true`, jobs without street level addresses may also be returned. + // For city level addresses, the city center is used. For state and coarser + // level addresses, text matching is used. + // If this field is set to `false` or isn't specified, only jobs that include + // street level addresses will be returned by commute search. + bool allow_imprecise_addresses = 4; + + // Traffic factor to take into account while searching by commute. + oneof traffic_option { + // Specifies the traffic density to use when calculating commute time. + RoadTraffic road_traffic = 5; + + // The departure time used to calculate traffic impact, represented as + // [google.type.TimeOfDay][google.type.TimeOfDay] in local time zone. + // + // Currently traffic model is restricted to hour level resolution. + google.type.TimeOfDay departure_time = 6; + } +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/histogram.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/histogram.proto new file mode 100644 index 00000000000..abe3901a695 --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/histogram.proto @@ -0,0 +1,51 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.talent.v4beta1; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; +option java_multiple_files = true; +option java_outer_classname = "HistogramProto"; +option java_package = "com.google.cloud.talent.v4beta1"; +option objc_class_prefix = "CTS"; + +// The histogram request. +message HistogramQuery { + // An expression specifies a histogram request against matching resources + // (for example, jobs, profiles) for searches. + // + // See [SearchJobsRequest.histogram_queries][google.cloud.talent.v4beta1.SearchJobsRequest.histogram_queries] and + // [SearchProfilesRequest.histogram_queries][google.cloud.talent.v4beta1.SearchProfilesRequest.histogram_queries] for details about syntax. + string histogram_query = 1; +} + +// Histogram result that matches [HistogramQuery][google.cloud.talent.v4beta1.HistogramQuery] specified in searches. +message HistogramQueryResult { + // Requested histogram expression. + string histogram_query = 1; + + // A map from the values of the facet associated with distinct values to the + // number of matching entries with corresponding value. + // + // The key format is: + // + // * (for string histogram) string values stored in the field. + // * (for named numeric bucket) name specified in `bucket()` function, like + // for `bucket(0, MAX, "non-negative")`, the key will be `non-negative`. + // * (for anonymous numeric bucket) range formatted as `-`, for + // example, `0-1000`, `MIN-0`, and `0-MAX`. + map histogram = 2; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/job.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/job.proto new file mode 100644 index 00000000000..d3911e891ba --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/job.proto @@ -0,0 +1,348 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/talent/v4beta1/common.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; +option java_multiple_files = true; +option java_outer_classname = "JobResourceProto"; +option java_package = "com.google.cloud.talent.v4beta1"; +option objc_class_prefix = "CTS"; + +// A Job resource represents a job posting (also referred to as a "job listing" +// or "job requisition"). A job belongs to a [Company][google.cloud.talent.v4beta1.Company], which is the hiring +// entity responsible for the job. +message Job { + option (google.api.resource) = { + type: "jobs.googleapis.com/Job" + pattern: "projects/{project}/tenants/{tenant}/jobs/{job}" + pattern: "projects/{project}/jobs/{job}" + }; + + // Application related details of a job posting. + message ApplicationInfo { + // Use this field to specify email address(es) to which resumes or + // applications can be sent. + // + // The maximum number of allowed characters for each entry is 255. + repeated string emails = 1; + + // Use this field to provide instructions, such as "Mail your application + // to ...", that a candidate can follow to apply for the job. + // + // This field accepts and sanitizes HTML input, and also accepts + // bold, italic, ordered list, and unordered list markup tags. + // + // The maximum number of allowed characters is 3,000. + string instruction = 2; + + // Use this URI field to direct an applicant to a website, for example to + // link to an online application form. + // + // The maximum number of allowed characters for each entry is 2,000. + repeated string uris = 3; + } + + // Derived details about the job posting. + message DerivedInfo { + // Structured locations of the job, resolved from [Job.addresses][google.cloud.talent.v4beta1.Job.addresses]. + // + // [locations][google.cloud.talent.v4beta1.Job.DerivedInfo.locations] are exactly matched to [Job.addresses][google.cloud.talent.v4beta1.Job.addresses] in the same + // order. + repeated Location locations = 1; + + // Job categories derived from [Job.title][google.cloud.talent.v4beta1.Job.title] and [Job.description][google.cloud.talent.v4beta1.Job.description]. + repeated JobCategory job_categories = 3; + } + + // Options for job processing. + message ProcessingOptions { + // If set to `true`, the service does not attempt to resolve a + // more precise address for the job. + bool disable_street_address_resolution = 1; + + // Option for job HTML content sanitization. Applied fields are: + // + // * description + // * applicationInfo.instruction + // * incentives + // * qualifications + // * responsibilities + // + // HTML tags in these fields may be stripped if sanitiazation isn't + // disabled. + // + // Defaults to [HtmlSanitization.SIMPLE_FORMATTING_ONLY][google.cloud.talent.v4beta1.HtmlSanitization.SIMPLE_FORMATTING_ONLY]. + HtmlSanitization html_sanitization = 2; + } + + // Required during job update. + // + // The resource name for the job. This is generated by the service when a + // job is created. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For + // example, "projects/foo/tenants/bar/jobs/baz". + // + // If tenant id is unspecified, the default tenant is used. For + // example, "projects/foo/jobs/bar". + // + // Use of this field in job queries and API calls is preferred over the use of + // [requisition_id][google.cloud.talent.v4beta1.Job.requisition_id] since this value is unique. + string name = 1; + + // Required. The resource name of the company listing the job. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}". For + // example, "projects/foo/tenants/bar/companies/baz". + // + // If tenant id is unspecified, the default tenant is used. For + // example, "projects/foo/companies/bar". + string company = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "jobs.googleapis.com/Company" + } + ]; + + // Required. The requisition ID, also referred to as the posting ID, is assigned by the + // client to identify a job. This field is intended to be used by clients + // for client identification and tracking of postings. A job isn't allowed + // to be created if there is another job with the same [company][google.cloud.talent.v4beta1.Job.name], + // [language_code][google.cloud.talent.v4beta1.Job.language_code] and [requisition_id][google.cloud.talent.v4beta1.Job.requisition_id]. + // + // The maximum number of allowed characters is 255. + string requisition_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The title of the job, such as "Software Engineer" + // + // The maximum number of allowed characters is 500. + string title = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The description of the job, which typically includes a multi-paragraph + // description of the company and related information. Separate fields are + // provided on the job object for [responsibilities][google.cloud.talent.v4beta1.Job.responsibilities], + // [qualifications][google.cloud.talent.v4beta1.Job.qualifications], and other job characteristics. Use of + // these separate job fields is recommended. + // + // This field accepts and sanitizes HTML input, and also accepts + // bold, italic, ordered list, and unordered list markup tags. + // + // The maximum number of allowed characters is 100,000. + string description = 5 [(google.api.field_behavior) = REQUIRED]; + + // Strongly recommended for the best service experience. + // + // Location(s) where the employer is looking to hire for this job posting. + // + // Specifying the full street address(es) of the hiring location enables + // better API results, especially job searches by commute time. + // + // At most 50 locations are allowed for best search performance. If a job has + // more locations, it is suggested to split it into multiple jobs with unique + // [requisition_id][google.cloud.talent.v4beta1.Job.requisition_id]s (e.g. 'ReqA' becomes 'ReqA-1', 'ReqA-2', and so on.) as + // multiple jobs with the same [company][google.cloud.talent.v4beta1.Job.company], [language_code][google.cloud.talent.v4beta1.Job.language_code] and + // [requisition_id][google.cloud.talent.v4beta1.Job.requisition_id] are not allowed. If the original [requisition_id][google.cloud.talent.v4beta1.Job.requisition_id] must + // be preserved, a custom field should be used for storage. It is also + // suggested to group the locations that close to each other in the same job + // for better search experience. + // + // The maximum number of allowed characters is 500. + repeated string addresses = 6; + + // Job application information. + ApplicationInfo application_info = 7; + + // The benefits included with the job. + repeated JobBenefit job_benefits = 8; + + // Job compensation information (a.k.a. "pay rate") i.e., the compensation + // that will paid to the employee. + CompensationInfo compensation_info = 9; + + // A map of fields to hold both filterable and non-filterable custom job + // attributes that are not covered by the provided structured fields. + // + // The keys of the map are strings up to 64 bytes and must match the + // pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, key0LikeThis or + // KEY_1_LIKE_THIS. + // + // At most 100 filterable and at most 100 unfilterable keys are supported. + // For filterable `string_values`, across all keys at most 200 values are + // allowed, with each string no more than 255 characters. For unfilterable + // `string_values`, the maximum total size of `string_values` across all keys + // is 50KB. + map custom_attributes = 10; + + // The desired education degrees for the job, such as Bachelors, Masters. + repeated DegreeType degree_types = 11; + + // The department or functional area within the company with the open + // position. + // + // The maximum number of allowed characters is 255. + string department = 12; + + // The employment type(s) of a job, for example, + // [full time][google.cloud.talent.v4beta1.EmploymentType.FULL_TIME] or + // [part time][google.cloud.talent.v4beta1.EmploymentType.PART_TIME]. + repeated EmploymentType employment_types = 13; + + // A description of bonus, commission, and other compensation + // incentives associated with the job not including salary or pay. + // + // The maximum number of allowed characters is 10,000. + string incentives = 14; + + // The language of the posting. This field is distinct from + // any requirements for fluency that are associated with the job. + // + // Language codes must be in BCP-47 format, such as "en-US" or "sr-Latn". + // For more information, see + // [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47){: + // class="external" target="_blank" }. + // + // If this field is unspecified and [Job.description][google.cloud.talent.v4beta1.Job.description] is present, detected + // language code based on [Job.description][google.cloud.talent.v4beta1.Job.description] is assigned, otherwise + // defaults to 'en_US'. + string language_code = 15; + + // The experience level associated with the job, such as "Entry Level". + JobLevel job_level = 16; + + // A promotion value of the job, as determined by the client. + // The value determines the sort order of the jobs returned when searching for + // jobs using the featured jobs search call, with higher promotional values + // being returned first and ties being resolved by relevance sort. Only the + // jobs with a promotionValue >0 are returned in a FEATURED_JOB_SEARCH. + // + // Default value is 0, and negative values are treated as 0. + int32 promotion_value = 17; + + // A description of the qualifications required to perform the + // job. The use of this field is recommended + // as an alternative to using the more general [description][google.cloud.talent.v4beta1.Job.description] field. + // + // This field accepts and sanitizes HTML input, and also accepts + // bold, italic, ordered list, and unordered list markup tags. + // + // The maximum number of allowed characters is 10,000. + string qualifications = 18; + + // A description of job responsibilities. The use of this field is + // recommended as an alternative to using the more general [description][google.cloud.talent.v4beta1.Job.description] + // field. + // + // This field accepts and sanitizes HTML input, and also accepts + // bold, italic, ordered list, and unordered list markup tags. + // + // The maximum number of allowed characters is 10,000. + string responsibilities = 19; + + // The job [PostingRegion][google.cloud.talent.v4beta1.PostingRegion] (for example, state, country) throughout + // which the job is available. If this field is set, a [LocationFilter][google.cloud.talent.v4beta1.LocationFilter] + // in a search query within the job region finds this job posting if an + // exact location match isn't specified. If this field is set to + // [PostingRegion.NATION][google.cloud.talent.v4beta1.PostingRegion.NATION] or [PostingRegion.ADMINISTRATIVE_AREA][google.cloud.talent.v4beta1.PostingRegion.ADMINISTRATIVE_AREA], + // setting job [Job.addresses][google.cloud.talent.v4beta1.Job.addresses] to the same location level as this field + // is strongly recommended. + PostingRegion posting_region = 20; + + // Deprecated. The job is only visible to the owner. + // + // The visibility of the job. + // + // Defaults to [Visibility.ACCOUNT_ONLY][google.cloud.talent.v4beta1.Visibility.ACCOUNT_ONLY] if not specified. + Visibility visibility = 21 [deprecated = true]; + + // The start timestamp of the job in UTC time zone. Typically this field + // is used for contracting engagements. Invalid timestamps are ignored. + google.protobuf.Timestamp job_start_time = 22; + + // The end timestamp of the job. Typically this field is used for contracting + // engagements. Invalid timestamps are ignored. + google.protobuf.Timestamp job_end_time = 23; + + // The timestamp this job posting was most recently published. The default + // value is the time the request arrives at the server. Invalid timestamps are + // ignored. + google.protobuf.Timestamp posting_publish_time = 24; + + // Strongly recommended for the best service experience. + // + // The expiration timestamp of the job. After this timestamp, the + // job is marked as expired, and it no longer appears in search results. The + // expired job can't be listed by the [ListJobs][google.cloud.talent.v4beta1.JobService.ListJobs] API, + // but it can be retrieved with the [GetJob][google.cloud.talent.v4beta1.JobService.GetJob] API or + // updated with the [UpdateJob][google.cloud.talent.v4beta1.JobService.UpdateJob] API or deleted with + // the [DeleteJob][google.cloud.talent.v4beta1.JobService.DeleteJob] API. An expired job can + // be updated and opened again by using a future expiration timestamp. + // Updating an expired job fails if there is another existing open job with + // same [company][google.cloud.talent.v4beta1.Job.company], [language_code][google.cloud.talent.v4beta1.Job.language_code] and [requisition_id][google.cloud.talent.v4beta1.Job.requisition_id]. + // + // The expired jobs are retained in our system for 90 days. However, the + // overall expired job count cannot exceed 3 times the maximum number of + // open jobs over previous 7 days. If this threshold is exceeded, + // expired jobs are cleaned out in order of earliest expire time. + // Expired jobs are no longer accessible after they are cleaned + // out. + // + // Invalid timestamps are ignored, and treated as expire time not provided. + // + // If the timestamp is before the instant request is made, the job + // is treated as expired immediately on creation. This kind of job can + // not be updated. And when creating a job with past timestamp, the + // [posting_publish_time][google.cloud.talent.v4beta1.Job.posting_publish_time] must be set before + // [posting_expire_time][google.cloud.talent.v4beta1.Job.posting_expire_time]. The purpose of this feature is + // to allow other objects, such as [Application][google.cloud.talent.v4beta1.Application], to refer a job + // that didn't exist in the system prior to becoming expired. If you + // want to modify a job that was expired on creation, + // delete it and create a new one. + // + // If this value isn't provided at the time of job creation or is invalid, + // the job posting expires after 30 days from the job's creation time. For + // example, if the job was created on 2017/01/01 13:00AM UTC with an + // unspecified expiration date, the job expires after 2017/01/31 13:00AM UTC. + // + // If this value isn't provided on job update, it depends on the field masks + // set by [UpdateJobRequest.update_mask][google.cloud.talent.v4beta1.UpdateJobRequest.update_mask]. If the field masks include + // [job_end_time][google.cloud.talent.v4beta1.Job.job_end_time], or the masks are empty meaning that every field is + // updated, the job posting expires after 30 days from the job's last + // update time. Otherwise the expiration date isn't updated. + google.protobuf.Timestamp posting_expire_time = 25; + + // Output only. The timestamp when this job posting was created. + google.protobuf.Timestamp posting_create_time = 26 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when this job posting was last updated. + google.protobuf.Timestamp posting_update_time = 27 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Display name of the company listing the job. + string company_display_name = 28 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Derived details about the job posting. + DerivedInfo derived_info = 29 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Options for job processing. + ProcessingOptions processing_options = 30; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/job_service.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/job_service.proto new file mode 100644 index 00000000000..87dc47d91f5 --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/job_service.proto @@ -0,0 +1,957 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/talent/v4beta1/common.proto"; +import "google/cloud/talent/v4beta1/filters.proto"; +import "google/cloud/talent/v4beta1/histogram.proto"; +import "google/cloud/talent/v4beta1/job.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/rpc/status.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; +option java_multiple_files = true; +option java_outer_classname = "JobServiceProto"; +option java_package = "com.google.cloud.talent.v4beta1"; +option objc_class_prefix = "CTS"; + +// A service handles job management, including job CRUD, enumeration and search. +service JobService { + option (google.api.default_host) = "jobs.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/jobs"; + + // Creates a new job. + // + // Typically, the job becomes searchable within 10 seconds, but it may take + // up to 5 minutes. + rpc CreateJob(CreateJobRequest) returns (Job) { + option (google.api.http) = { + post: "/v4beta1/{parent=projects/*/tenants/*}/jobs" + body: "*" + additional_bindings { + post: "/v4beta1/{parent=projects/*}/jobs" + body: "*" + } + }; + option (google.api.method_signature) = "parent,job"; + } + + // Begins executing a batch create jobs operation. + rpc BatchCreateJobs(BatchCreateJobsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v4beta1/{parent=projects/*/tenants/*}/jobs:batchCreate" + body: "*" + additional_bindings { + post: "/v4beta1/{parent=projects/*}/jobs:batchCreate" + body: "*" + } + }; + option (google.api.method_signature) = "parent,jobs"; + option (google.longrunning.operation_info) = { + response_type: "JobOperationResult" + metadata_type: "BatchOperationMetadata" + }; + } + + // Retrieves the specified job, whose status is OPEN or recently EXPIRED + // within the last 90 days. + rpc GetJob(GetJobRequest) returns (Job) { + option (google.api.http) = { + get: "/v4beta1/{name=projects/*/tenants/*/jobs/*}" + additional_bindings { + get: "/v4beta1/{name=projects/*/jobs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Updates specified job. + // + // Typically, updated contents become visible in search results within 10 + // seconds, but it may take up to 5 minutes. + rpc UpdateJob(UpdateJobRequest) returns (Job) { + option (google.api.http) = { + patch: "/v4beta1/{job.name=projects/*/tenants/*/jobs/*}" + body: "*" + additional_bindings { + patch: "/v4beta1/{job.name=projects/*/jobs/*}" + body: "*" + } + }; + option (google.api.method_signature) = "job"; + } + + // Begins executing a batch update jobs operation. + rpc BatchUpdateJobs(BatchUpdateJobsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v4beta1/{parent=projects/*/tenants/*}/jobs:batchUpdate" + body: "*" + additional_bindings { + post: "/v4beta1/{parent=projects/*}/jobs:batchUpdate" + body: "*" + } + }; + option (google.api.method_signature) = "parent,jobs"; + option (google.longrunning.operation_info) = { + response_type: "JobOperationResult" + metadata_type: "BatchOperationMetadata" + }; + } + + // Deletes the specified job. + // + // Typically, the job becomes unsearchable within 10 seconds, but it may take + // up to 5 minutes. + rpc DeleteJob(DeleteJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v4beta1/{name=projects/*/tenants/*/jobs/*}" + additional_bindings { + delete: "/v4beta1/{name=projects/*/jobs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s by filter. + rpc BatchDeleteJobs(BatchDeleteJobsRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v4beta1/{parent=projects/*/tenants/*}/jobs:batchDelete" + body: "*" + additional_bindings { + post: "/v4beta1/{parent=projects/*}/jobs:batchDelete" + } + }; + option (google.api.method_signature) = "parent,filter"; + } + + // Lists jobs by filter. + rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { + option (google.api.http) = { + get: "/v4beta1/{parent=projects/*/tenants/*}/jobs" + additional_bindings { + get: "/v4beta1/{parent=projects/*}/jobs" + } + }; + option (google.api.method_signature) = "parent,filter"; + } + + // Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest]. + // + // This call constrains the [visibility][google.cloud.talent.v4beta1.Job.visibility] of jobs + // present in the database, and only returns jobs that the caller has + // permission to search against. + rpc SearchJobs(SearchJobsRequest) returns (SearchJobsResponse) { + option (google.api.http) = { + post: "/v4beta1/{parent=projects/*/tenants/*}/jobs:search" + body: "*" + additional_bindings { + post: "/v4beta1/{parent=projects/*}/jobs:search" + body: "*" + } + }; + } + + // Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest]. + // + // This API call is intended for the use case of targeting passive job + // seekers (for example, job seekers who have signed up to receive email + // alerts about potential job opportunities), and has different algorithmic + // adjustments that are targeted to passive job seekers. + // + // This call constrains the [visibility][google.cloud.talent.v4beta1.Job.visibility] of jobs + // present in the database, and only returns jobs the caller has + // permission to search against. + rpc SearchJobsForAlert(SearchJobsRequest) returns (SearchJobsResponse) { + option (google.api.http) = { + post: "/v4beta1/{parent=projects/*/tenants/*}/jobs:searchForAlert" + body: "*" + additional_bindings { + post: "/v4beta1/{parent=projects/*}/jobs:searchForAlert" + body: "*" + } + }; + } +} + +// Create job request. +message CreateJobRequest { + // Required. The resource name of the tenant under which the job is created. + // + // The format is "projects/{project_id}/tenants/{tenant_id}". For example, + // "projects/foo/tenant/bar". If tenant id is unspecified a default tenant + // is created. For example, "projects/foo". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "jobs.googleapis.com/Job" + } + ]; + + // Required. The Job to be created. + Job job = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Get job request. +message GetJobRequest { + // Required. The resource name of the job to retrieve. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For + // example, "projects/foo/tenants/bar/jobs/baz". + // + // If tenant id is unspecified, the default tenant is used. For + // example, "projects/foo/jobs/bar". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "jobs.googleapis.com/Job" + } + ]; +} + +// Update job request. +message UpdateJobRequest { + // Required. The Job to be updated. + Job job = 1 [(google.api.field_behavior) = REQUIRED]; + + // Strongly recommended for the best service experience. + // + // If [update_mask][google.cloud.talent.v4beta1.UpdateJobRequest.update_mask] is provided, only the specified fields in + // [job][google.cloud.talent.v4beta1.UpdateJobRequest.job] are updated. Otherwise all the fields are updated. + // + // A field mask to restrict the fields that are updated. Only + // top level fields of [Job][google.cloud.talent.v4beta1.Job] are supported. + google.protobuf.FieldMask update_mask = 2; +} + +// Delete job request. +message DeleteJobRequest { + // Required. The resource name of the job to be deleted. + // + // The format is + // "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For + // example, "projects/foo/tenants/bar/jobs/baz". + // + // If tenant id is unspecified, the default tenant is used. For + // example, "projects/foo/jobs/bar". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "jobs.googleapis.com/Job" + } + ]; +} + +// Batch delete jobs request. +message BatchDeleteJobsRequest { + // Required. The resource name of the tenant under which the job is created. + // + // The format is "projects/{project_id}/tenants/{tenant_id}". For example, + // "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + // is created. For example, "projects/foo". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "jobs.googleapis.com/Job" + } + ]; + + // Required. The filter string specifies the jobs to be deleted. + // + // Supported operator: =, AND + // + // The fields eligible for filtering are: + // + // * `companyName` (Required) + // * `requisitionId` (Required) + // + // Sample Query: companyName = "projects/foo/companies/bar" AND + // requisitionId = "req-1" + string filter = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// An enum that specifies the job attributes that are returned in the +// [MatchingJob.job][google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob.job] or +// [ListJobsResponse.jobs][google.cloud.talent.v4beta1.ListJobsResponse.jobs] fields. +enum JobView { + // Default value. + JOB_VIEW_UNSPECIFIED = 0; + + // A ID only view of job, with following attributes: + // [Job.name][google.cloud.talent.v4beta1.Job.name], [Job.requisition_id][google.cloud.talent.v4beta1.Job.requisition_id], [Job.language_code][google.cloud.talent.v4beta1.Job.language_code]. + JOB_VIEW_ID_ONLY = 1; + + // A minimal view of the job, with the following attributes: + // [Job.name][google.cloud.talent.v4beta1.Job.name], [Job.requisition_id][google.cloud.talent.v4beta1.Job.requisition_id], [Job.title][google.cloud.talent.v4beta1.Job.title], + // [Job.company][google.cloud.talent.v4beta1.Job.company], [Job.DerivedInfo.locations][google.cloud.talent.v4beta1.Job.DerivedInfo.locations], [Job.language_code][google.cloud.talent.v4beta1.Job.language_code]. + JOB_VIEW_MINIMAL = 2; + + // A small view of the job, with the following attributes in the search + // results: [Job.name][google.cloud.talent.v4beta1.Job.name], [Job.requisition_id][google.cloud.talent.v4beta1.Job.requisition_id], [Job.title][google.cloud.talent.v4beta1.Job.title], + // [Job.company][google.cloud.talent.v4beta1.Job.company], [Job.DerivedInfo.locations][google.cloud.talent.v4beta1.Job.DerivedInfo.locations], [Job.visibility][google.cloud.talent.v4beta1.Job.visibility], + // [Job.language_code][google.cloud.talent.v4beta1.Job.language_code], [Job.description][google.cloud.talent.v4beta1.Job.description]. + JOB_VIEW_SMALL = 3; + + // All available attributes are included in the search results. + JOB_VIEW_FULL = 4; +} + +// List jobs request. +message ListJobsRequest { + // Required. The resource name of the tenant under which the job is created. + // + // The format is "projects/{project_id}/tenants/{tenant_id}". For example, + // "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + // is created. For example, "projects/foo". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "jobs.googleapis.com/Job" + } + ]; + + // Required. The filter string specifies the jobs to be enumerated. + // + // Supported operator: =, AND + // + // The fields eligible for filtering are: + // + // * `companyName` + // * `requisitionId` + // * `status` Available values: OPEN, EXPIRED, ALL. Defaults to + // OPEN if no value is specified. + // + // At least one of `companyName` and `requisitionId` must present or an + // INVALID_ARGUMENT error is thrown. + // + // Sample Query: + // + // * companyName = "projects/foo/tenants/bar/companies/baz" + // * companyName = "projects/foo/tenants/bar/companies/baz" AND + // requisitionId = "req-1" + // * companyName = "projects/foo/tenants/bar/companies/baz" AND + // status = "EXPIRED" + // * requisitionId = "req-1" + // * requisitionId = "req-1" AND status = "EXPIRED" + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // The starting point of a query result. + string page_token = 3; + + // The maximum number of jobs to be returned per page of results. + // + // If [job_view][google.cloud.talent.v4beta1.ListJobsRequest.job_view] is set to [JobView.JOB_VIEW_ID_ONLY][google.cloud.talent.v4beta1.JobView.JOB_VIEW_ID_ONLY], the maximum allowed + // page size is 1000. Otherwise, the maximum allowed page size is 100. + // + // Default is 100 if empty or a number < 1 is specified. + int32 page_size = 4; + + // The desired job attributes returned for jobs in the + // search response. Defaults to [JobView.JOB_VIEW_FULL][google.cloud.talent.v4beta1.JobView.JOB_VIEW_FULL] if no value is + // specified. + JobView job_view = 5; +} + +// List jobs response. +message ListJobsResponse { + // The Jobs for a given company. + // + // The maximum number of items returned is based on the limit field + // provided in the request. + repeated Job jobs = 1; + + // A token to retrieve the next page of results. + string next_page_token = 2; + + // Additional information for the API invocation, such as the request + // tracking id. + ResponseMetadata metadata = 3; +} + +// The Request body of the `SearchJobs` call. +message SearchJobsRequest { + // A string-represented enumeration of the job search mode. The service + // operate differently for different modes of service. + enum SearchMode { + // The mode of the search method isn't specified. The default search + // behavior is identical to JOB_SEARCH search behavior. + SEARCH_MODE_UNSPECIFIED = 0; + + // The job search matches against all jobs, and featured jobs + // (jobs with promotionValue > 0) are not specially handled. + JOB_SEARCH = 1; + + // The job search matches only against featured jobs (jobs with a + // promotionValue > 0). This method doesn't return any jobs having a + // promotionValue <= 0. The search results order is determined by the + // promotionValue (jobs with a higher promotionValue are returned higher up + // in the search results), with relevance being used as a tiebreaker. + FEATURED_JOB_SEARCH = 2; + } + + // Controls whether highly similar jobs are returned next to each other in + // the search results. Jobs are identified as highly similar based on + // their titles, job categories, and locations. Highly similar results are + // clustered so that only one representative job of the cluster is + // displayed to the job seeker higher up in the results, with the other jobs + // being displayed lower down in the results. + enum DiversificationLevel { + // The diversification level isn't specified. + DIVERSIFICATION_LEVEL_UNSPECIFIED = 0; + + // Disables diversification. Jobs that would normally be pushed to the last + // page would not have their positions altered. This may result in highly + // similar jobs appearing in sequence in the search results. + DISABLED = 1; + + // Default diversifying behavior. The result list is ordered so that + // highly similar results are pushed to the end of the last page of search + // results. If you are using pageToken to page through the result set, + // latency might be lower but we can't guarantee that all results are + // returned. If you are using page offset, latency might be higher but all + // results are returned. + SIMPLE = 2; + } + + // Controls what keyword matching behavior the search has. When keyword + // matching is enabled, a keyword match returns jobs that may not match given + // category filters when there are matching keywords. For example, for the + // query "program manager" with KeywordMatchMode set to KEYWORD_MATCH_ALL, a + // job posting with the title "software developer," which doesn't fall into + // "program manager" ontology, and "program manager" appearing in its + // description will be surfaced. + // + // For queries like "cloud" that don't contain title or + // location specific ontology, jobs with "cloud" keyword matches are returned + // regardless of this enum's value. + // + // Use [Company.keyword_searchable_job_custom_attributes][google.cloud.talent.v4beta1.Company.keyword_searchable_job_custom_attributes] if + // company-specific globally matched custom field/attribute string values are + // needed. Enabling keyword match improves recall of subsequent search + // requests. + enum KeywordMatchMode { + // The keyword match option isn't specified. Defaults to + // [KeywordMatchMode.KEYWORD_MATCH_ALL][google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL] behavior. + KEYWORD_MATCH_MODE_UNSPECIFIED = 0; + + // Disables keyword matching. + KEYWORD_MATCH_DISABLED = 1; + + // Enable keyword matching over [Job.title][google.cloud.talent.v4beta1.Job.title], + // [Job.description][google.cloud.talent.v4beta1.Job.description], [Job.company_display_name][google.cloud.talent.v4beta1.Job.company_display_name], [Job.addresses][google.cloud.talent.v4beta1.Job.addresses], + // [Job.qualifications][google.cloud.talent.v4beta1.Job.qualifications], and keyword searchable [Job.custom_attributes][google.cloud.talent.v4beta1.Job.custom_attributes] + // fields. + KEYWORD_MATCH_ALL = 2; + + // Only enable keyword matching over [Job.title][google.cloud.talent.v4beta1.Job.title]. + KEYWORD_MATCH_TITLE_ONLY = 3; + } + + // Custom ranking information for [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest]. + message CustomRankingInfo { + // The importance level for [CustomRankingInfo.ranking_expression][google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ranking_expression]. + enum ImportanceLevel { + // Default value if the importance level isn't specified. + IMPORTANCE_LEVEL_UNSPECIFIED = 0; + + // The given ranking expression is of None importance, existing relevance + // score (determined by API algorithm) dominates job's final ranking + // position. + NONE = 1; + + // The given ranking expression is of Low importance in terms of job's + // final ranking position compared to existing relevance + // score (determined by API algorithm). + LOW = 2; + + // The given ranking expression is of Mild importance in terms of job's + // final ranking position compared to existing relevance + // score (determined by API algorithm). + MILD = 3; + + // The given ranking expression is of Medium importance in terms of job's + // final ranking position compared to existing relevance + // score (determined by API algorithm). + MEDIUM = 4; + + // The given ranking expression is of High importance in terms of job's + // final ranking position compared to existing relevance + // score (determined by API algorithm). + HIGH = 5; + + // The given ranking expression is of Extreme importance, and dominates + // job's final ranking position with existing relevance + // score (determined by API algorithm) ignored. + EXTREME = 6; + } + + // Required. Controls over how important the score of + // [CustomRankingInfo.ranking_expression][google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ranking_expression] gets applied to job's final + // ranking position. + // + // An error is thrown if not specified. + ImportanceLevel importance_level = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Controls over how job documents get ranked on top of existing relevance + // score (determined by API algorithm). A combination of the ranking + // expression and relevance score is used to determine job's final ranking + // position. + // + // The syntax for this expression is a subset of Google SQL syntax. + // + // Supported operators are: +, -, *, /, where the left and right side of + // the operator is either a numeric [Job.custom_attributes][google.cloud.talent.v4beta1.Job.custom_attributes] key, + // integer/double value or an expression that can be evaluated to a number. + // + // Parenthesis are supported to adjust calculation precedence. The + // expression must be < 200 characters in length. + // + // The expression is considered invalid for a job if the expression + // references custom attributes that are not populated on the job or if the + // expression results in a divide by zero. If an expression is invalid for a + // job, that job is demoted to the end of the results. + // + // Sample ranking expression + // (year + 25) * 0.25 - (freshness / 0.5) + string ranking_expression = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. The resource name of the tenant to search within. + // + // The format is "projects/{project_id}/tenants/{tenant_id}". For example, + // "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + // is created. For example, "projects/foo". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "jobs.googleapis.com/Job" + } + ]; + + // Mode of a search. + // + // Defaults to [SearchMode.JOB_SEARCH][google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode.JOB_SEARCH]. + SearchMode search_mode = 2; + + // Required. The meta information collected about the job searcher, used to improve the + // search quality of the service. The identifiers (such as `user_id`) are + // provided by users, and must be unique and consistent. + RequestMetadata request_metadata = 3 [(google.api.field_behavior) = REQUIRED]; + + // Query used to search against jobs, such as keyword, location filters, etc. + JobQuery job_query = 4; + + // Controls whether to broaden the search when it produces sparse results. + // Broadened queries append results to the end of the matching results + // list. + // + // Defaults to false. + bool enable_broadening = 5; + + // This field is deprecated. + bool require_precise_result_size = 6 [deprecated = true]; + + // An expression specifies a histogram request against matching jobs. + // + // Expression syntax is an aggregation function call with histogram facets and + // other options. + // + // Available aggregation function calls are: + // * `count(string_histogram_facet)`: Count the number of matching entities, + // for each distinct attribute value. + // * `count(numeric_histogram_facet, list of buckets)`: Count the number of + // matching entities within each bucket. + // + // A maximum of 200 histogram buckets are supported. + // + // Data types: + // + // * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + // * String: string like "any string with backslash escape for quote(\")." + // * Number: whole number and floating point number like 10, -1 and -0.01. + // * List: list of elements with comma(,) separator surrounded by square + // brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + // + // Built-in constants: + // + // * MIN (minimum number similar to java Double.MIN_VALUE) + // * MAX (maximum number similar to java Double.MAX_VALUE) + // + // Built-in functions: + // + // * bucket(start, end[, label]): bucket built-in function creates a bucket + // with range of [start, end). Note that the end is exclusive, for example, + // bucket(1, MAX, "positive number") or bucket(1, 10). + // + // Job histogram facets: + // + // * company_display_name: histogram by [Job.company_display_name][google.cloud.talent.v4beta1.Job.company_display_name]. + // * employment_type: histogram by [Job.employment_types][google.cloud.talent.v4beta1.Job.employment_types], for example, + // "FULL_TIME", "PART_TIME". + // * company_size (DEPRECATED): histogram by [CompanySize][google.cloud.talent.v4beta1.CompanySize], for example, + // "SMALL", "MEDIUM", "BIG". + // * publish_time_in_day: histogram by the [Job.posting_publish_time][google.cloud.talent.v4beta1.Job.posting_publish_time] + // in days. + // Must specify list of numeric buckets in spec. + // * publish_time_in_month: histogram by the [Job.posting_publish_time][google.cloud.talent.v4beta1.Job.posting_publish_time] + // in months. + // Must specify list of numeric buckets in spec. + // * publish_time_in_year: histogram by the [Job.posting_publish_time][google.cloud.talent.v4beta1.Job.posting_publish_time] + // in years. + // Must specify list of numeric buckets in spec. + // * degree_types: histogram by the [Job.degree_types][google.cloud.talent.v4beta1.Job.degree_types], for example, + // "Bachelors", "Masters". + // * job_level: histogram by the [Job.job_level][google.cloud.talent.v4beta1.Job.job_level], for example, "Entry + // Level". + // * country: histogram by the country code of jobs, for example, "US", "FR". + // * admin1: histogram by the admin1 code of jobs, which is a global + // placeholder referring to the state, province, or the particular term a + // country uses to define the geographic structure below the country level, + // for example, "CA", "IL". + // * city: histogram by a combination of the "city name, admin1 code". For + // example, "Mountain View, CA", "New York, NY". + // * admin1_country: histogram by a combination of the "admin1 code, country", + // for example, "CA, US", "IL, US". + // * city_coordinate: histogram by the city center's GPS coordinates (latitude + // and longitude), for example, 37.4038522,-122.0987765. Since the + // coordinates of a city center can change, customers may need to refresh + // them periodically. + // * locale: histogram by the [Job.language_code][google.cloud.talent.v4beta1.Job.language_code], for example, "en-US", + // "fr-FR". + // * language: histogram by the language subtag of the [Job.language_code][google.cloud.talent.v4beta1.Job.language_code], + // for example, "en", "fr". + // * category: histogram by the [JobCategory][google.cloud.talent.v4beta1.JobCategory], for example, + // "COMPUTER_AND_IT", "HEALTHCARE". + // * base_compensation_unit: histogram by the + // [CompensationInfo.CompensationUnit][google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit] of base + // salary, for example, "WEEKLY", "MONTHLY". + // * base_compensation: histogram by the base salary. Must specify list of + // numeric buckets to group results by. + // * annualized_base_compensation: histogram by the base annualized salary. + // Must specify list of numeric buckets to group results by. + // * annualized_total_compensation: histogram by the total annualized salary. + // Must specify list of numeric buckets to group results by. + // * string_custom_attribute: histogram by string [Job.custom_attributes][google.cloud.talent.v4beta1.Job.custom_attributes]. + // Values can be accessed via square bracket notations like + // string_custom_attribute["key1"]. + // * numeric_custom_attribute: histogram by numeric [Job.custom_attributes][google.cloud.talent.v4beta1.Job.custom_attributes]. + // Values can be accessed via square bracket notations like + // numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + // group results by. + // + // Example expressions: + // + // * `count(admin1)` + // * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + // bucket(100000, MAX)])` + // * `count(string_custom_attribute["some-string-custom-attribute"])` + // * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + // [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + repeated HistogramQuery histogram_queries = 7; + + // The desired job attributes returned for jobs in the search response. + // Defaults to [JobView.JOB_VIEW_SMALL][google.cloud.talent.v4beta1.JobView.JOB_VIEW_SMALL] if no value is specified. + JobView job_view = 8; + + // An integer that specifies the current offset (that is, starting result + // location, amongst the jobs deemed by the API as relevant) in search + // results. This field is only considered if [page_token][google.cloud.talent.v4beta1.SearchJobsRequest.page_token] is unset. + // + // The maximum allowed value is 5000. Otherwise an error is thrown. + // + // For example, 0 means to return results starting from the first matching + // job, and 10 means to return from the 11th job. This can be used for + // pagination, (for example, pageSize = 10 and offset = 10 means to return + // from the second page). + int32 offset = 9; + + // A limit on the number of jobs returned in the search results. + // Increasing this value above the default value of 10 can increase search + // response time. The value can be between 1 and 100. + int32 page_size = 10; + + // The token specifying the current offset within + // search results. See [SearchJobsResponse.next_page_token][google.cloud.talent.v4beta1.SearchJobsResponse.next_page_token] for + // an explanation of how to obtain the next set of query results. + string page_token = 11; + + // The criteria determining how search results are sorted. Default is + // `"relevance desc"`. + // + // Supported options are: + // + // * `"relevance desc"`: By relevance descending, as determined by the API + // algorithms. Relevance thresholding of query results is only available + // with this ordering. + // * `"posting_publish_time desc"`: By [Job.posting_publish_time][google.cloud.talent.v4beta1.Job.posting_publish_time] + // descending. + // * `"posting_update_time desc"`: By [Job.posting_update_time][google.cloud.talent.v4beta1.Job.posting_update_time] + // descending. + // * `"title"`: By [Job.title][google.cloud.talent.v4beta1.Job.title] ascending. + // * `"title desc"`: By [Job.title][google.cloud.talent.v4beta1.Job.title] descending. + // * `"annualized_base_compensation"`: By job's + // [CompensationInfo.annualized_base_compensation_range][google.cloud.talent.v4beta1.CompensationInfo.annualized_base_compensation_range] ascending. Jobs + // whose annualized base compensation is unspecified are put at the end of + // search results. + // * `"annualized_base_compensation desc"`: By job's + // [CompensationInfo.annualized_base_compensation_range][google.cloud.talent.v4beta1.CompensationInfo.annualized_base_compensation_range] descending. Jobs + // whose annualized base compensation is unspecified are put at the end of + // search results. + // * `"annualized_total_compensation"`: By job's + // [CompensationInfo.annualized_total_compensation_range][google.cloud.talent.v4beta1.CompensationInfo.annualized_total_compensation_range] ascending. Jobs + // whose annualized base compensation is unspecified are put at the end of + // search results. + // * `"annualized_total_compensation desc"`: By job's + // [CompensationInfo.annualized_total_compensation_range][google.cloud.talent.v4beta1.CompensationInfo.annualized_total_compensation_range] descending. Jobs + // whose annualized base compensation is unspecified are put at the end of + // search results. + // * `"custom_ranking desc"`: By the relevance score adjusted to the + // [SearchJobsRequest.CustomRankingInfo.ranking_expression][google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ranking_expression] with weight + // factor assigned by + // [SearchJobsRequest.CustomRankingInfo.importance_level][google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.importance_level] in descending + // order. + // * Location sorting: Use the special syntax to order jobs by distance:
+ // `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ // `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ // `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + // multiple locations. See details below.
+ // `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + // multiple locations. See details below.
+ // The string can have a maximum of 256 characters. When multiple distance + // centers are provided, a job that is close to any of the distance centers + // would have a high rank. When a job has multiple locations, the job + // location closest to one of the distance centers will be used. Jobs that + // don't have locations will be ranked at the bottom. Distance is calculated + // with a precision of 11.3 meters (37.4 feet). Diversification strategy is + // still applied unless explicitly disabled in + // [diversification_level][google.cloud.talent.v4beta1.SearchJobsRequest.diversification_level]. + string order_by = 12; + + // Controls whether highly similar jobs are returned next to each other in + // the search results. Jobs are identified as highly similar based on + // their titles, job categories, and locations. Highly similar results are + // clustered so that only one representative job of the cluster is + // displayed to the job seeker higher up in the results, with the other jobs + // being displayed lower down in the results. + // + // Defaults to [DiversificationLevel.SIMPLE][google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel.SIMPLE] if no value + // is specified. + DiversificationLevel diversification_level = 13; + + // Controls over how job documents get ranked on top of existing relevance + // score (determined by API algorithm). + CustomRankingInfo custom_ranking_info = 14; + + // This field is deprecated. Please use + // [SearchJobsRequest.keyword_match_mode][google.cloud.talent.v4beta1.SearchJobsRequest.keyword_match_mode] going forward. + // + // To migrate, disable_keyword_match set to false maps to + // [KeywordMatchMode.KEYWORD_MATCH_ALL][google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL], and disable_keyword_match set to + // true maps to [KeywordMatchMode.KEYWORD_MATCH_DISABLED][google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_DISABLED]. If + // [SearchJobsRequest.keyword_match_mode][google.cloud.talent.v4beta1.SearchJobsRequest.keyword_match_mode] is set, this field is ignored. + // + // Controls whether to disable exact keyword match on [Job.title][google.cloud.talent.v4beta1.Job.title], + // [Job.description][google.cloud.talent.v4beta1.Job.description], [Job.company_display_name][google.cloud.talent.v4beta1.Job.company_display_name], [Job.addresses][google.cloud.talent.v4beta1.Job.addresses], + // [Job.qualifications][google.cloud.talent.v4beta1.Job.qualifications]. When disable keyword match is turned off, a + // keyword match returns jobs that do not match given category filters when + // there are matching keywords. For example, for the query "program manager," + // a result is returned even if the job posting has the title "software + // developer," which doesn't fall into "program manager" ontology, but does + // have "program manager" appearing in its description. + // + // For queries like "cloud" that don't contain title or + // location specific ontology, jobs with "cloud" keyword matches are returned + // regardless of this flag's value. + // + // Use [Company.keyword_searchable_job_custom_attributes][google.cloud.talent.v4beta1.Company.keyword_searchable_job_custom_attributes] if + // company-specific globally matched custom field/attribute string values are + // needed. Enabling keyword match improves recall of subsequent search + // requests. + // + // Defaults to false. + bool disable_keyword_match = 16; + + // Controls what keyword match options to use. + // + // Defaults to [KeywordMatchMode.KEYWORD_MATCH_ALL][google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL] if no value + // is specified. + KeywordMatchMode keyword_match_mode = 18; +} + +// Response for SearchJob method. +message SearchJobsResponse { + // Job entry with metadata inside [SearchJobsResponse][google.cloud.talent.v4beta1.SearchJobsResponse]. + message MatchingJob { + // Job resource that matches the specified [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest]. + Job job = 1; + + // A summary of the job with core information that's displayed on the search + // results listing page. + string job_summary = 2; + + // Contains snippets of text from the [Job.title][google.cloud.talent.v4beta1.Job.title] field most + // closely matching a search query's keywords, if available. The matching + // query keywords are enclosed in HTML bold tags. + string job_title_snippet = 3; + + // Contains snippets of text from the [Job.description][google.cloud.talent.v4beta1.Job.description] and similar + // fields that most closely match a search query's keywords, if available. + // All HTML tags in the original fields are stripped when returned in this + // field, and matching query keywords are enclosed in HTML bold tags. + string search_text_snippet = 4; + + // Commute information which is generated based on specified + // [CommuteFilter][google.cloud.talent.v4beta1.CommuteFilter]. + CommuteInfo commute_info = 5; + } + + // Commute details related to this job. + message CommuteInfo { + // Location used as the destination in the commute calculation. + Location job_location = 1; + + // The number of seconds required to travel to the job location from the + // query location. A duration of 0 seconds indicates that the job isn't + // reachable within the requested duration, but was returned as part of an + // expanded query. + google.protobuf.Duration travel_duration = 2; + } + + // The Job entities that match the specified [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest]. + repeated MatchingJob matching_jobs = 1; + + // The histogram results that match with specified + // [SearchJobsRequest.histogram_queries][google.cloud.talent.v4beta1.SearchJobsRequest.histogram_queries]. + repeated HistogramQueryResult histogram_query_results = 2; + + // The token that specifies the starting position of the next page of results. + // This field is empty if there are no more results. + string next_page_token = 3; + + // The location filters that the service applied to the specified query. If + // any filters are lat-lng based, the [Location.location_type][google.cloud.talent.v4beta1.Location.location_type] is + // [Location.LocationType.LOCATION_TYPE_UNSPECIFIED][google.cloud.talent.v4beta1.Location.LocationType.LOCATION_TYPE_UNSPECIFIED]. + repeated Location location_filters = 4; + + // An estimation of the number of jobs that match the specified query. + // + // This number isn't guaranteed to be accurate. For accurate results, + // see [SearchJobsResponse.total_size][google.cloud.talent.v4beta1.SearchJobsResponse.total_size]. + int32 estimated_total_size = 5; + + // The precise result count with limit 100,000. + int32 total_size = 6; + + // Additional information for the API invocation, such as the request + // tracking id. + ResponseMetadata metadata = 7; + + // If query broadening is enabled, we may append additional results from the + // broadened query. This number indicates how many of the jobs returned in the + // jobs field are from the broadened query. These results are always at the + // end of the jobs list. In particular, a value of 0, or if the field isn't + // set, all the jobs in the jobs list are from the original + // (without broadening) query. If this field is non-zero, subsequent requests + // with offset after this result set should contain all broadened results. + int32 broadened_query_jobs_count = 8; + + // The spell checking result, and correction. + SpellingCorrection spell_correction = 9; +} + +// Request to create a batch of jobs. +message BatchCreateJobsRequest { + // Required. The resource name of the tenant under which the job is created. + // + // The format is "projects/{project_id}/tenants/{tenant_id}". For example, + // "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + // is created. For example, "projects/foo". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "jobs.googleapis.com/Job" + } + ]; + + // Required. The jobs to be created. + repeated Job jobs = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request to update a batch of jobs. +message BatchUpdateJobsRequest { + // Required. The resource name of the tenant under which the job is created. + // + // The format is "projects/{project_id}/tenants/{tenant_id}". For example, + // "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + // is created. For example, "projects/foo". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "jobs.googleapis.com/Job" + } + ]; + + // Required. The jobs to be updated. + repeated Job jobs = 2 [(google.api.field_behavior) = REQUIRED]; + + // Strongly recommended for the best service experience. Be aware that it will + // also increase latency when checking the status of a batch operation. + // + // If [update_mask][google.cloud.talent.v4beta1.BatchUpdateJobsRequest.update_mask] is provided, only the specified fields in + // [Job][google.cloud.talent.v4beta1.Job] are updated. Otherwise all the fields are updated. + // + // A field mask to restrict the fields that are updated. Only + // top level fields of [Job][google.cloud.talent.v4beta1.Job] are supported. + // + // If [update_mask][google.cloud.talent.v4beta1.BatchUpdateJobsRequest.update_mask] is provided, The [Job][google.cloud.talent.v4beta1.Job] inside + // [JobResult][google.cloud.talent.v4beta1.JobOperationResult.JobResult] + // will only contains fields that is updated, plus the Id of the Job. + // Otherwise, [Job][google.cloud.talent.v4beta1.Job] will include all fields, which can yield a very + // large response. + google.protobuf.FieldMask update_mask = 3; +} + +// The result of [JobService.BatchCreateJobs][google.cloud.talent.v4beta1.JobService.BatchCreateJobs] or +// [JobService.BatchUpdateJobs][google.cloud.talent.v4beta1.JobService.BatchUpdateJobs] APIs. It's used to +// replace [google.longrunning.Operation.response][google.longrunning.Operation.response] in case of success. +message JobOperationResult { + // Mutation result of a job. + message JobResult { + // Here [Job][google.cloud.talent.v4beta1.Job] only contains basic information including [name][google.cloud.talent.v4beta1.Job.name], + // [company][google.cloud.talent.v4beta1.Job.company], [language_code][google.cloud.talent.v4beta1.Job.language_code] + // and [requisition_id][google.cloud.talent.v4beta1.Job.requisition_id], use getJob method to retrieve + // detailed information of the created/updated job. + Job job = 1; + + // The status of the job processed. This field is populated if the + // processing of the [job][google.cloud.talent.v4beta1.JobOperationResult.JobResult.job] fails. + google.rpc.Status status = 2; + } + + // List of job mutation results from a batch mutate operation. It can change + // until operation status is FINISHED, FAILED or CANCELLED. + repeated JobResult job_results = 1; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/tenant.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/tenant.proto new file mode 100644 index 00000000000..cf376a4b748 --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/tenant.proto @@ -0,0 +1,79 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.talent.v4beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; +option java_multiple_files = true; +option java_outer_classname = "TenantResourceProto"; +option java_package = "com.google.cloud.talent.v4beta1"; +option objc_class_prefix = "CTS"; + +// A Tenant resource represents a tenant in the service. A tenant is a group or +// entity that shares common access with specific privileges for resources like +// profiles. Customer may create multiple tenants to provide data isolation for +// different groups. +message Tenant { + option (google.api.resource) = { + type: "jobs.googleapis.com/Tenant" + pattern: "projects/{project}/tenants/{tenant}" + }; + + // Enum that represents how user data owned by the tenant is used. + enum DataUsageType { + // Default value. + DATA_USAGE_TYPE_UNSPECIFIED = 0; + + // Data owned by this tenant is used to improve search/recommendation + // quality across tenants. + AGGREGATED = 1; + + // Data owned by this tenant is used to improve search/recommendation + // quality for this tenant only. + ISOLATED = 2; + } + + // Required during tenant update. + // + // The resource name for a tenant. This is generated by the service when a + // tenant is created. + // + // The format is "projects/{project_id}/tenants/{tenant_id}", for example, + // "projects/foo/tenants/bar". + string name = 1; + + // Required. Client side tenant identifier, used to uniquely identify the tenant. + // + // The maximum number of allowed characters is 255. + string external_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Indicates whether data owned by this tenant may be used to provide product + // improvements across other tenants. + // + // Defaults behavior is [DataUsageType.ISOLATED][google.cloud.talent.v4beta1.Tenant.DataUsageType.ISOLATED] if it's unset. + DataUsageType usage_type = 3; + + // A list of keys of filterable [Profile.custom_attributes][google.cloud.talent.v4beta1.Profile.custom_attributes], whose + // corresponding `string_values` are used in keyword searches. Profiles with + // `string_values` under these specified field keys are returned if any + // of the values match the search keyword. Custom field values with + // parenthesis, brackets and special symbols are not searchable as-is, + // and must be surrounded by quotes. + repeated string keyword_searchable_profile_custom_attributes = 4; +} diff --git a/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/tenant_service.proto b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/tenant_service.proto new file mode 100644 index 00000000000..3e40df91405 --- /dev/null +++ b/packages/google-cloud-talent/protos/google/cloud/talent/v4beta1/tenant_service.proto @@ -0,0 +1,176 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.talent.v4beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/talent/v4beta1/common.proto"; +import "google/cloud/talent/v4beta1/tenant.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; +option java_multiple_files = true; +option java_outer_classname = "TenantServiceProto"; +option java_package = "com.google.cloud.talent.v4beta1"; +option objc_class_prefix = "CTS"; + +// A service that handles tenant management, including CRUD and enumeration. +service TenantService { + option (google.api.default_host) = "jobs.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/jobs"; + + // Creates a new tenant entity. + rpc CreateTenant(CreateTenantRequest) returns (Tenant) { + option (google.api.http) = { + post: "/v4beta1/{parent=projects/*}/tenants" + body: "*" + }; + option (google.api.method_signature) = "parent,tenant"; + } + + // Retrieves specified tenant. + rpc GetTenant(GetTenantRequest) returns (Tenant) { + option (google.api.http) = { + get: "/v4beta1/{name=projects/*/tenants/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates specified tenant. + rpc UpdateTenant(UpdateTenantRequest) returns (Tenant) { + option (google.api.http) = { + patch: "/v4beta1/{tenant.name=projects/*/tenants/*}" + body: "*" + }; + option (google.api.method_signature) = "tenant"; + } + + // Deletes specified tenant. + rpc DeleteTenant(DeleteTenantRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v4beta1/{name=projects/*/tenants/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all tenants associated with the project. + rpc ListTenants(ListTenantsRequest) returns (ListTenantsResponse) { + option (google.api.http) = { + get: "/v4beta1/{parent=projects/*}/tenants" + }; + option (google.api.method_signature) = "parent"; + } +} + +// The Request of the CreateTenant method. +message CreateTenantRequest { + // Required. Resource name of the project under which the tenant is created. + // + // The format is "projects/{project_id}", for example, + // "projects/foo". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The tenant to be created. + Tenant tenant = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for getting a tenant by name. +message GetTenantRequest { + // Required. The resource name of the tenant to be retrieved. + // + // The format is "projects/{project_id}/tenants/{tenant_id}", for example, + // "projects/foo/tenants/bar". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "jobs.googleapis.com/Tenant" + } + ]; +} + +// Request for updating a specified tenant. +message UpdateTenantRequest { + // Required. The tenant resource to replace the current resource in the system. + Tenant tenant = 1 [(google.api.field_behavior) = REQUIRED]; + + // Strongly recommended for the best service experience. + // + // If [update_mask][google.cloud.talent.v4beta1.UpdateTenantRequest.update_mask] is provided, only the specified fields in + // [tenant][google.cloud.talent.v4beta1.UpdateTenantRequest.tenant] are updated. Otherwise all the fields are updated. + // + // A field mask to specify the tenant fields to be updated. Only + // top level fields of [Tenant][google.cloud.talent.v4beta1.Tenant] are supported. + google.protobuf.FieldMask update_mask = 2; +} + +// Request to delete a tenant. +message DeleteTenantRequest { + // Required. The resource name of the tenant to be deleted. + // + // The format is "projects/{project_id}/tenants/{tenant_id}", for example, + // "projects/foo/tenants/bar". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "jobs.googleapis.com/Tenant" + } + ]; +} + +// List tenants for which the client has ACL visibility. +message ListTenantsRequest { + // Required. Resource name of the project under which the tenant is created. + // + // The format is "projects/{project_id}", for example, + // "projects/foo". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // The starting indicator from which to return results. + string page_token = 2; + + // The maximum number of tenants to be returned, at most 100. + // Default is 100 if a non-positive number is provided. + int32 page_size = 3; +} + +// The List tenants response object. +message ListTenantsResponse { + // Tenants for the current client. + repeated Tenant tenants = 1; + + // A token to retrieve the next page of results. + string next_page_token = 2; + + // Additional information for the API invocation, such as the request + // tracking id. + ResponseMetadata metadata = 3; +} diff --git a/packages/google-cloud-talent/protos/protos.d.ts b/packages/google-cloud-talent/protos/protos.d.ts new file mode 100644 index 00000000000..7c02193dc97 --- /dev/null +++ b/packages/google-cloud-talent/protos/protos.d.ts @@ -0,0 +1,22347 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace talent. */ + namespace talent { + + /** Namespace v4. */ + namespace v4 { + + /** Properties of a TimestampRange. */ + interface ITimestampRange { + + /** TimestampRange startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimestampRange endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TimestampRange. */ + class TimestampRange implements ITimestampRange { + + /** + * Constructs a new TimestampRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.ITimestampRange); + + /** TimestampRange startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TimestampRange endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TimestampRange instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampRange instance + */ + public static create(properties?: google.cloud.talent.v4.ITimestampRange): google.cloud.talent.v4.TimestampRange; + + /** + * Encodes the specified TimestampRange message. Does not implicitly {@link google.cloud.talent.v4.TimestampRange.verify|verify} messages. + * @param message TimestampRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.ITimestampRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimestampRange message, length delimited. Does not implicitly {@link google.cloud.talent.v4.TimestampRange.verify|verify} messages. + * @param message TimestampRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.ITimestampRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimestampRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.TimestampRange; + + /** + * Decodes a TimestampRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimestampRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.TimestampRange; + + /** + * Verifies a TimestampRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimestampRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimestampRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.TimestampRange; + + /** + * Creates a plain object from a TimestampRange message. Also converts values to other types if specified. + * @param message TimestampRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.TimestampRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimestampRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimestampRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** CompanySize enum. */ + enum CompanySize { + COMPANY_SIZE_UNSPECIFIED = 0, + MINI = 1, + SMALL = 2, + SMEDIUM = 3, + MEDIUM = 4, + BIG = 5, + BIGGER = 6, + GIANT = 7 + } + + /** JobBenefit enum. */ + enum JobBenefit { + JOB_BENEFIT_UNSPECIFIED = 0, + CHILD_CARE = 1, + DENTAL = 2, + DOMESTIC_PARTNER = 3, + FLEXIBLE_HOURS = 4, + MEDICAL = 5, + LIFE_INSURANCE = 6, + PARENTAL_LEAVE = 7, + RETIREMENT_PLAN = 8, + SICK_DAYS = 9, + VACATION = 10, + VISION = 11 + } + + /** DegreeType enum. */ + enum DegreeType { + DEGREE_TYPE_UNSPECIFIED = 0, + PRIMARY_EDUCATION = 1, + LOWER_SECONDARY_EDUCATION = 2, + UPPER_SECONDARY_EDUCATION = 3, + ADULT_REMEDIAL_EDUCATION = 4, + ASSOCIATES_OR_EQUIVALENT = 5, + BACHELORS_OR_EQUIVALENT = 6, + MASTERS_OR_EQUIVALENT = 7, + DOCTORAL_OR_EQUIVALENT = 8 + } + + /** EmploymentType enum. */ + enum EmploymentType { + EMPLOYMENT_TYPE_UNSPECIFIED = 0, + FULL_TIME = 1, + PART_TIME = 2, + CONTRACTOR = 3, + CONTRACT_TO_HIRE = 4, + TEMPORARY = 5, + INTERN = 6, + VOLUNTEER = 7, + PER_DIEM = 8, + FLY_IN_FLY_OUT = 9, + OTHER_EMPLOYMENT_TYPE = 10 + } + + /** JobLevel enum. */ + enum JobLevel { + JOB_LEVEL_UNSPECIFIED = 0, + ENTRY_LEVEL = 1, + EXPERIENCED = 2, + MANAGER = 3, + DIRECTOR = 4, + EXECUTIVE = 5 + } + + /** JobCategory enum. */ + enum JobCategory { + JOB_CATEGORY_UNSPECIFIED = 0, + ACCOUNTING_AND_FINANCE = 1, + ADMINISTRATIVE_AND_OFFICE = 2, + ADVERTISING_AND_MARKETING = 3, + ANIMAL_CARE = 4, + ART_FASHION_AND_DESIGN = 5, + BUSINESS_OPERATIONS = 6, + CLEANING_AND_FACILITIES = 7, + COMPUTER_AND_IT = 8, + CONSTRUCTION = 9, + CUSTOMER_SERVICE = 10, + EDUCATION = 11, + ENTERTAINMENT_AND_TRAVEL = 12, + FARMING_AND_OUTDOORS = 13, + HEALTHCARE = 14, + HUMAN_RESOURCES = 15, + INSTALLATION_MAINTENANCE_AND_REPAIR = 16, + LEGAL = 17, + MANAGEMENT = 18, + MANUFACTURING_AND_WAREHOUSE = 19, + MEDIA_COMMUNICATIONS_AND_WRITING = 20, + OIL_GAS_AND_MINING = 21, + PERSONAL_CARE_AND_SERVICES = 22, + PROTECTIVE_SERVICES = 23, + REAL_ESTATE = 24, + RESTAURANT_AND_HOSPITALITY = 25, + SALES_AND_RETAIL = 26, + SCIENCE_AND_ENGINEERING = 27, + SOCIAL_SERVICES_AND_NON_PROFIT = 28, + SPORTS_FITNESS_AND_RECREATION = 29, + TRANSPORTATION_AND_LOGISTICS = 30 + } + + /** PostingRegion enum. */ + enum PostingRegion { + POSTING_REGION_UNSPECIFIED = 0, + ADMINISTRATIVE_AREA = 1, + NATION = 2, + TELECOMMUTE = 3 + } + + /** Visibility enum. */ + enum Visibility { + VISIBILITY_UNSPECIFIED = 0, + ACCOUNT_ONLY = 1, + SHARED_WITH_GOOGLE = 2, + SHARED_WITH_PUBLIC = 3 + } + + /** HtmlSanitization enum. */ + enum HtmlSanitization { + HTML_SANITIZATION_UNSPECIFIED = 0, + HTML_SANITIZATION_DISABLED = 1, + SIMPLE_FORMATTING_ONLY = 2 + } + + /** CommuteMethod enum. */ + enum CommuteMethod { + COMMUTE_METHOD_UNSPECIFIED = 0, + DRIVING = 1, + TRANSIT = 2, + WALKING = 3, + CYCLING = 4, + TRANSIT_ACCESSIBLE = 5 + } + + /** Properties of a Location. */ + interface ILocation { + + /** Location locationType */ + locationType?: (google.cloud.talent.v4.Location.LocationType|keyof typeof google.cloud.talent.v4.Location.LocationType|null); + + /** Location postalAddress */ + postalAddress?: (google.type.IPostalAddress|null); + + /** Location latLng */ + latLng?: (google.type.ILatLng|null); + + /** Location radiusMiles */ + radiusMiles?: (number|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.ILocation); + + /** Location locationType. */ + public locationType: (google.cloud.talent.v4.Location.LocationType|keyof typeof google.cloud.talent.v4.Location.LocationType); + + /** Location postalAddress. */ + public postalAddress?: (google.type.IPostalAddress|null); + + /** Location latLng. */ + public latLng?: (google.type.ILatLng|null); + + /** Location radiusMiles. */ + public radiusMiles: number; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.cloud.talent.v4.ILocation): google.cloud.talent.v4.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.cloud.talent.v4.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.cloud.talent.v4.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.cloud.talent.v4.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.cloud.talent.v4.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.cloud.talent.v4.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.cloud.talent.v4.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.cloud.talent.v4.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.cloud.talent.v4.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; + } + + namespace Location { + + /** LocationType enum. */ + enum LocationType { + LOCATION_TYPE_UNSPECIFIED = 0, + COUNTRY = 1, + ADMINISTRATIVE_AREA = 2, + SUB_ADMINISTRATIVE_AREA = 3, + LOCALITY = 4, + POSTAL_CODE = 5, + SUB_LOCALITY = 6, + SUB_LOCALITY_1 = 7, + SUB_LOCALITY_2 = 8, + NEIGHBORHOOD = 9, + STREET_ADDRESS = 10 + } + } + + /** Properties of a RequestMetadata. */ + interface IRequestMetadata { + + /** RequestMetadata domain */ + domain?: (string|null); + + /** RequestMetadata sessionId */ + sessionId?: (string|null); + + /** RequestMetadata userId */ + userId?: (string|null); + + /** RequestMetadata allowMissingIds */ + allowMissingIds?: (boolean|null); + + /** RequestMetadata deviceInfo */ + deviceInfo?: (google.cloud.talent.v4.IDeviceInfo|null); + } + + /** Represents a RequestMetadata. */ + class RequestMetadata implements IRequestMetadata { + + /** + * Constructs a new RequestMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IRequestMetadata); + + /** RequestMetadata domain. */ + public domain: string; + + /** RequestMetadata sessionId. */ + public sessionId: string; + + /** RequestMetadata userId. */ + public userId: string; + + /** RequestMetadata allowMissingIds. */ + public allowMissingIds: boolean; + + /** RequestMetadata deviceInfo. */ + public deviceInfo?: (google.cloud.talent.v4.IDeviceInfo|null); + + /** + * Creates a new RequestMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestMetadata instance + */ + public static create(properties?: google.cloud.talent.v4.IRequestMetadata): google.cloud.talent.v4.RequestMetadata; + + /** + * Encodes the specified RequestMetadata message. Does not implicitly {@link google.cloud.talent.v4.RequestMetadata.verify|verify} messages. + * @param message RequestMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IRequestMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestMetadata message, length delimited. Does not implicitly {@link google.cloud.talent.v4.RequestMetadata.verify|verify} messages. + * @param message RequestMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IRequestMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.RequestMetadata; + + /** + * Decodes a RequestMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.RequestMetadata; + + /** + * Verifies a RequestMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RequestMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.RequestMetadata; + + /** + * Creates a plain object from a RequestMetadata message. Also converts values to other types if specified. + * @param message RequestMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.RequestMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RequestMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResponseMetadata. */ + interface IResponseMetadata { + + /** ResponseMetadata requestId */ + requestId?: (string|null); + } + + /** Represents a ResponseMetadata. */ + class ResponseMetadata implements IResponseMetadata { + + /** + * Constructs a new ResponseMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IResponseMetadata); + + /** ResponseMetadata requestId. */ + public requestId: string; + + /** + * Creates a new ResponseMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ResponseMetadata instance + */ + public static create(properties?: google.cloud.talent.v4.IResponseMetadata): google.cloud.talent.v4.ResponseMetadata; + + /** + * Encodes the specified ResponseMetadata message. Does not implicitly {@link google.cloud.talent.v4.ResponseMetadata.verify|verify} messages. + * @param message ResponseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IResponseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResponseMetadata message, length delimited. Does not implicitly {@link google.cloud.talent.v4.ResponseMetadata.verify|verify} messages. + * @param message ResponseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IResponseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResponseMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.ResponseMetadata; + + /** + * Decodes a ResponseMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.ResponseMetadata; + + /** + * Verifies a ResponseMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResponseMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResponseMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.ResponseMetadata; + + /** + * Creates a plain object from a ResponseMetadata message. Also converts values to other types if specified. + * @param message ResponseMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.ResponseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResponseMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResponseMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeviceInfo. */ + interface IDeviceInfo { + + /** DeviceInfo deviceType */ + deviceType?: (google.cloud.talent.v4.DeviceInfo.DeviceType|keyof typeof google.cloud.talent.v4.DeviceInfo.DeviceType|null); + + /** DeviceInfo id */ + id?: (string|null); + } + + /** Represents a DeviceInfo. */ + class DeviceInfo implements IDeviceInfo { + + /** + * Constructs a new DeviceInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IDeviceInfo); + + /** DeviceInfo deviceType. */ + public deviceType: (google.cloud.talent.v4.DeviceInfo.DeviceType|keyof typeof google.cloud.talent.v4.DeviceInfo.DeviceType); + + /** DeviceInfo id. */ + public id: string; + + /** + * Creates a new DeviceInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DeviceInfo instance + */ + public static create(properties?: google.cloud.talent.v4.IDeviceInfo): google.cloud.talent.v4.DeviceInfo; + + /** + * Encodes the specified DeviceInfo message. Does not implicitly {@link google.cloud.talent.v4.DeviceInfo.verify|verify} messages. + * @param message DeviceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IDeviceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeviceInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4.DeviceInfo.verify|verify} messages. + * @param message DeviceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IDeviceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeviceInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeviceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.DeviceInfo; + + /** + * Decodes a DeviceInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeviceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.DeviceInfo; + + /** + * Verifies a DeviceInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeviceInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeviceInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.DeviceInfo; + + /** + * Creates a plain object from a DeviceInfo message. Also converts values to other types if specified. + * @param message DeviceInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.DeviceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeviceInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeviceInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DeviceInfo { + + /** DeviceType enum. */ + enum DeviceType { + DEVICE_TYPE_UNSPECIFIED = 0, + WEB = 1, + MOBILE_WEB = 2, + ANDROID = 3, + IOS = 4, + BOT = 5, + OTHER = 6 + } + } + + /** Properties of a CustomAttribute. */ + interface ICustomAttribute { + + /** CustomAttribute stringValues */ + stringValues?: (string[]|null); + + /** CustomAttribute longValues */ + longValues?: ((number|Long|string)[]|null); + + /** CustomAttribute filterable */ + filterable?: (boolean|null); + + /** CustomAttribute keywordSearchable */ + keywordSearchable?: (boolean|null); + } + + /** Represents a CustomAttribute. */ + class CustomAttribute implements ICustomAttribute { + + /** + * Constructs a new CustomAttribute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.ICustomAttribute); + + /** CustomAttribute stringValues. */ + public stringValues: string[]; + + /** CustomAttribute longValues. */ + public longValues: (number|Long|string)[]; + + /** CustomAttribute filterable. */ + public filterable: boolean; + + /** CustomAttribute keywordSearchable. */ + public keywordSearchable: boolean; + + /** + * Creates a new CustomAttribute instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomAttribute instance + */ + public static create(properties?: google.cloud.talent.v4.ICustomAttribute): google.cloud.talent.v4.CustomAttribute; + + /** + * Encodes the specified CustomAttribute message. Does not implicitly {@link google.cloud.talent.v4.CustomAttribute.verify|verify} messages. + * @param message CustomAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomAttribute message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CustomAttribute.verify|verify} messages. + * @param message CustomAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomAttribute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.CustomAttribute; + + /** + * Decodes a CustomAttribute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.CustomAttribute; + + /** + * Verifies a CustomAttribute message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomAttribute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomAttribute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.CustomAttribute; + + /** + * Creates a plain object from a CustomAttribute message. Also converts values to other types if specified. + * @param message CustomAttribute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.CustomAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomAttribute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomAttribute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpellingCorrection. */ + interface ISpellingCorrection { + + /** SpellingCorrection corrected */ + corrected?: (boolean|null); + + /** SpellingCorrection correctedText */ + correctedText?: (string|null); + + /** SpellingCorrection correctedHtml */ + correctedHtml?: (string|null); + } + + /** Represents a SpellingCorrection. */ + class SpellingCorrection implements ISpellingCorrection { + + /** + * Constructs a new SpellingCorrection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.ISpellingCorrection); + + /** SpellingCorrection corrected. */ + public corrected: boolean; + + /** SpellingCorrection correctedText. */ + public correctedText: string; + + /** SpellingCorrection correctedHtml. */ + public correctedHtml: string; + + /** + * Creates a new SpellingCorrection instance using the specified properties. + * @param [properties] Properties to set + * @returns SpellingCorrection instance + */ + public static create(properties?: google.cloud.talent.v4.ISpellingCorrection): google.cloud.talent.v4.SpellingCorrection; + + /** + * Encodes the specified SpellingCorrection message. Does not implicitly {@link google.cloud.talent.v4.SpellingCorrection.verify|verify} messages. + * @param message SpellingCorrection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.ISpellingCorrection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpellingCorrection message, length delimited. Does not implicitly {@link google.cloud.talent.v4.SpellingCorrection.verify|verify} messages. + * @param message SpellingCorrection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.ISpellingCorrection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpellingCorrection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpellingCorrection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.SpellingCorrection; + + /** + * Decodes a SpellingCorrection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpellingCorrection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.SpellingCorrection; + + /** + * Verifies a SpellingCorrection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpellingCorrection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpellingCorrection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.SpellingCorrection; + + /** + * Creates a plain object from a SpellingCorrection message. Also converts values to other types if specified. + * @param message SpellingCorrection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.SpellingCorrection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpellingCorrection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpellingCorrection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CompensationInfo. */ + interface ICompensationInfo { + + /** CompensationInfo entries */ + entries?: (google.cloud.talent.v4.CompensationInfo.ICompensationEntry[]|null); + + /** CompensationInfo annualizedBaseCompensationRange */ + annualizedBaseCompensationRange?: (google.cloud.talent.v4.CompensationInfo.ICompensationRange|null); + + /** CompensationInfo annualizedTotalCompensationRange */ + annualizedTotalCompensationRange?: (google.cloud.talent.v4.CompensationInfo.ICompensationRange|null); + } + + /** Represents a CompensationInfo. */ + class CompensationInfo implements ICompensationInfo { + + /** + * Constructs a new CompensationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.ICompensationInfo); + + /** CompensationInfo entries. */ + public entries: google.cloud.talent.v4.CompensationInfo.ICompensationEntry[]; + + /** CompensationInfo annualizedBaseCompensationRange. */ + public annualizedBaseCompensationRange?: (google.cloud.talent.v4.CompensationInfo.ICompensationRange|null); + + /** CompensationInfo annualizedTotalCompensationRange. */ + public annualizedTotalCompensationRange?: (google.cloud.talent.v4.CompensationInfo.ICompensationRange|null); + + /** + * Creates a new CompensationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns CompensationInfo instance + */ + public static create(properties?: google.cloud.talent.v4.ICompensationInfo): google.cloud.talent.v4.CompensationInfo; + + /** + * Encodes the specified CompensationInfo message. Does not implicitly {@link google.cloud.talent.v4.CompensationInfo.verify|verify} messages. + * @param message CompensationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.ICompensationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompensationInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CompensationInfo.verify|verify} messages. + * @param message CompensationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.ICompensationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompensationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompensationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.CompensationInfo; + + /** + * Decodes a CompensationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompensationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.CompensationInfo; + + /** + * Verifies a CompensationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompensationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompensationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.CompensationInfo; + + /** + * Creates a plain object from a CompensationInfo message. Also converts values to other types if specified. + * @param message CompensationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.CompensationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompensationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompensationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CompensationInfo { + + /** Properties of a CompensationEntry. */ + interface ICompensationEntry { + + /** CompensationEntry type */ + type?: (google.cloud.talent.v4.CompensationInfo.CompensationType|keyof typeof google.cloud.talent.v4.CompensationInfo.CompensationType|null); + + /** CompensationEntry unit */ + unit?: (google.cloud.talent.v4.CompensationInfo.CompensationUnit|keyof typeof google.cloud.talent.v4.CompensationInfo.CompensationUnit|null); + + /** CompensationEntry amount */ + amount?: (google.type.IMoney|null); + + /** CompensationEntry range */ + range?: (google.cloud.talent.v4.CompensationInfo.ICompensationRange|null); + + /** CompensationEntry description */ + description?: (string|null); + + /** CompensationEntry expectedUnitsPerYear */ + expectedUnitsPerYear?: (google.protobuf.IDoubleValue|null); + } + + /** Represents a CompensationEntry. */ + class CompensationEntry implements ICompensationEntry { + + /** + * Constructs a new CompensationEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.CompensationInfo.ICompensationEntry); + + /** CompensationEntry type. */ + public type: (google.cloud.talent.v4.CompensationInfo.CompensationType|keyof typeof google.cloud.talent.v4.CompensationInfo.CompensationType); + + /** CompensationEntry unit. */ + public unit: (google.cloud.talent.v4.CompensationInfo.CompensationUnit|keyof typeof google.cloud.talent.v4.CompensationInfo.CompensationUnit); + + /** CompensationEntry amount. */ + public amount?: (google.type.IMoney|null); + + /** CompensationEntry range. */ + public range?: (google.cloud.talent.v4.CompensationInfo.ICompensationRange|null); + + /** CompensationEntry description. */ + public description: string; + + /** CompensationEntry expectedUnitsPerYear. */ + public expectedUnitsPerYear?: (google.protobuf.IDoubleValue|null); + + /** CompensationEntry compensationAmount. */ + public compensationAmount?: ("amount"|"range"); + + /** + * Creates a new CompensationEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns CompensationEntry instance + */ + public static create(properties?: google.cloud.talent.v4.CompensationInfo.ICompensationEntry): google.cloud.talent.v4.CompensationInfo.CompensationEntry; + + /** + * Encodes the specified CompensationEntry message. Does not implicitly {@link google.cloud.talent.v4.CompensationInfo.CompensationEntry.verify|verify} messages. + * @param message CompensationEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.CompensationInfo.ICompensationEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompensationEntry message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CompensationInfo.CompensationEntry.verify|verify} messages. + * @param message CompensationEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.CompensationInfo.ICompensationEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompensationEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompensationEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.CompensationInfo.CompensationEntry; + + /** + * Decodes a CompensationEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompensationEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.CompensationInfo.CompensationEntry; + + /** + * Verifies a CompensationEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompensationEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompensationEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.CompensationInfo.CompensationEntry; + + /** + * Creates a plain object from a CompensationEntry message. Also converts values to other types if specified. + * @param message CompensationEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.CompensationInfo.CompensationEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompensationEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompensationEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** CompensationType enum. */ + enum CompensationType { + COMPENSATION_TYPE_UNSPECIFIED = 0, + BASE = 1, + BONUS = 2, + SIGNING_BONUS = 3, + EQUITY = 4, + PROFIT_SHARING = 5, + COMMISSIONS = 6, + TIPS = 7, + OTHER_COMPENSATION_TYPE = 8 + } + + /** CompensationUnit enum. */ + enum CompensationUnit { + COMPENSATION_UNIT_UNSPECIFIED = 0, + HOURLY = 1, + DAILY = 2, + WEEKLY = 3, + MONTHLY = 4, + YEARLY = 5, + ONE_TIME = 6, + OTHER_COMPENSATION_UNIT = 7 + } + + /** Properties of a CompensationRange. */ + interface ICompensationRange { + + /** CompensationRange maxCompensation */ + maxCompensation?: (google.type.IMoney|null); + + /** CompensationRange minCompensation */ + minCompensation?: (google.type.IMoney|null); + } + + /** Represents a CompensationRange. */ + class CompensationRange implements ICompensationRange { + + /** + * Constructs a new CompensationRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.CompensationInfo.ICompensationRange); + + /** CompensationRange maxCompensation. */ + public maxCompensation?: (google.type.IMoney|null); + + /** CompensationRange minCompensation. */ + public minCompensation?: (google.type.IMoney|null); + + /** + * Creates a new CompensationRange instance using the specified properties. + * @param [properties] Properties to set + * @returns CompensationRange instance + */ + public static create(properties?: google.cloud.talent.v4.CompensationInfo.ICompensationRange): google.cloud.talent.v4.CompensationInfo.CompensationRange; + + /** + * Encodes the specified CompensationRange message. Does not implicitly {@link google.cloud.talent.v4.CompensationInfo.CompensationRange.verify|verify} messages. + * @param message CompensationRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.CompensationInfo.ICompensationRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompensationRange message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CompensationInfo.CompensationRange.verify|verify} messages. + * @param message CompensationRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.CompensationInfo.ICompensationRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompensationRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompensationRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.CompensationInfo.CompensationRange; + + /** + * Decodes a CompensationRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompensationRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.CompensationInfo.CompensationRange; + + /** + * Verifies a CompensationRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompensationRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompensationRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.CompensationInfo.CompensationRange; + + /** + * Creates a plain object from a CompensationRange message. Also converts values to other types if specified. + * @param message CompensationRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.CompensationInfo.CompensationRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompensationRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompensationRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a BatchOperationMetadata. */ + interface IBatchOperationMetadata { + + /** BatchOperationMetadata state */ + state?: (google.cloud.talent.v4.BatchOperationMetadata.State|keyof typeof google.cloud.talent.v4.BatchOperationMetadata.State|null); + + /** BatchOperationMetadata stateDescription */ + stateDescription?: (string|null); + + /** BatchOperationMetadata successCount */ + successCount?: (number|null); + + /** BatchOperationMetadata failureCount */ + failureCount?: (number|null); + + /** BatchOperationMetadata totalCount */ + totalCount?: (number|null); + + /** BatchOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BatchOperationMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** BatchOperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BatchOperationMetadata. */ + class BatchOperationMetadata implements IBatchOperationMetadata { + + /** + * Constructs a new BatchOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IBatchOperationMetadata); + + /** BatchOperationMetadata state. */ + public state: (google.cloud.talent.v4.BatchOperationMetadata.State|keyof typeof google.cloud.talent.v4.BatchOperationMetadata.State); + + /** BatchOperationMetadata stateDescription. */ + public stateDescription: string; + + /** BatchOperationMetadata successCount. */ + public successCount: number; + + /** BatchOperationMetadata failureCount. */ + public failureCount: number; + + /** BatchOperationMetadata totalCount. */ + public totalCount: number; + + /** BatchOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BatchOperationMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BatchOperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BatchOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchOperationMetadata instance + */ + public static create(properties?: google.cloud.talent.v4.IBatchOperationMetadata): google.cloud.talent.v4.BatchOperationMetadata; + + /** + * Encodes the specified BatchOperationMetadata message. Does not implicitly {@link google.cloud.talent.v4.BatchOperationMetadata.verify|verify} messages. + * @param message BatchOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IBatchOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.talent.v4.BatchOperationMetadata.verify|verify} messages. + * @param message BatchOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IBatchOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.BatchOperationMetadata; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.BatchOperationMetadata; + + /** + * Verifies a BatchOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.BatchOperationMetadata; + + /** + * Creates a plain object from a BatchOperationMetadata message. Also converts values to other types if specified. + * @param message BatchOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.BatchOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchOperationMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + INITIALIZING = 1, + PROCESSING = 2, + SUCCEEDED = 3, + FAILED = 4, + CANCELLING = 5, + CANCELLED = 6 + } + } + + /** Properties of a Company. */ + interface ICompany { + + /** Company name */ + name?: (string|null); + + /** Company displayName */ + displayName?: (string|null); + + /** Company externalId */ + externalId?: (string|null); + + /** Company size */ + size?: (google.cloud.talent.v4.CompanySize|keyof typeof google.cloud.talent.v4.CompanySize|null); + + /** Company headquartersAddress */ + headquartersAddress?: (string|null); + + /** Company hiringAgency */ + hiringAgency?: (boolean|null); + + /** Company eeoText */ + eeoText?: (string|null); + + /** Company websiteUri */ + websiteUri?: (string|null); + + /** Company careerSiteUri */ + careerSiteUri?: (string|null); + + /** Company imageUri */ + imageUri?: (string|null); + + /** Company keywordSearchableJobCustomAttributes */ + keywordSearchableJobCustomAttributes?: (string[]|null); + + /** Company derivedInfo */ + derivedInfo?: (google.cloud.talent.v4.Company.IDerivedInfo|null); + + /** Company suspended */ + suspended?: (boolean|null); + } + + /** Represents a Company. */ + class Company implements ICompany { + + /** + * Constructs a new Company. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.ICompany); + + /** Company name. */ + public name: string; + + /** Company displayName. */ + public displayName: string; + + /** Company externalId. */ + public externalId: string; + + /** Company size. */ + public size: (google.cloud.talent.v4.CompanySize|keyof typeof google.cloud.talent.v4.CompanySize); + + /** Company headquartersAddress. */ + public headquartersAddress: string; + + /** Company hiringAgency. */ + public hiringAgency: boolean; + + /** Company eeoText. */ + public eeoText: string; + + /** Company websiteUri. */ + public websiteUri: string; + + /** Company careerSiteUri. */ + public careerSiteUri: string; + + /** Company imageUri. */ + public imageUri: string; + + /** Company keywordSearchableJobCustomAttributes. */ + public keywordSearchableJobCustomAttributes: string[]; + + /** Company derivedInfo. */ + public derivedInfo?: (google.cloud.talent.v4.Company.IDerivedInfo|null); + + /** Company suspended. */ + public suspended: boolean; + + /** + * Creates a new Company instance using the specified properties. + * @param [properties] Properties to set + * @returns Company instance + */ + public static create(properties?: google.cloud.talent.v4.ICompany): google.cloud.talent.v4.Company; + + /** + * Encodes the specified Company message. Does not implicitly {@link google.cloud.talent.v4.Company.verify|verify} messages. + * @param message Company message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.ICompany, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Company message, length delimited. Does not implicitly {@link google.cloud.talent.v4.Company.verify|verify} messages. + * @param message Company message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.ICompany, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Company message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Company + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.Company; + + /** + * Decodes a Company message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Company + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.Company; + + /** + * Verifies a Company message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Company message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Company + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.Company; + + /** + * Creates a plain object from a Company message. Also converts values to other types if specified. + * @param message Company + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.Company, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Company to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Company + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Company { + + /** Properties of a DerivedInfo. */ + interface IDerivedInfo { + + /** DerivedInfo headquartersLocation */ + headquartersLocation?: (google.cloud.talent.v4.ILocation|null); + } + + /** Represents a DerivedInfo. */ + class DerivedInfo implements IDerivedInfo { + + /** + * Constructs a new DerivedInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.Company.IDerivedInfo); + + /** DerivedInfo headquartersLocation. */ + public headquartersLocation?: (google.cloud.talent.v4.ILocation|null); + + /** + * Creates a new DerivedInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DerivedInfo instance + */ + public static create(properties?: google.cloud.talent.v4.Company.IDerivedInfo): google.cloud.talent.v4.Company.DerivedInfo; + + /** + * Encodes the specified DerivedInfo message. Does not implicitly {@link google.cloud.talent.v4.Company.DerivedInfo.verify|verify} messages. + * @param message DerivedInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.Company.IDerivedInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DerivedInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4.Company.DerivedInfo.verify|verify} messages. + * @param message DerivedInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.Company.IDerivedInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DerivedInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DerivedInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.Company.DerivedInfo; + + /** + * Decodes a DerivedInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DerivedInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.Company.DerivedInfo; + + /** + * Verifies a DerivedInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DerivedInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DerivedInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.Company.DerivedInfo; + + /** + * Creates a plain object from a DerivedInfo message. Also converts values to other types if specified. + * @param message DerivedInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.Company.DerivedInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DerivedInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DerivedInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a CompanyService */ + class CompanyService extends $protobuf.rpc.Service { + + /** + * Constructs a new CompanyService 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 CompanyService 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): CompanyService; + + /** + * Calls CreateCompany. + * @param request CreateCompanyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Company + */ + public createCompany(request: google.cloud.talent.v4.ICreateCompanyRequest, callback: google.cloud.talent.v4.CompanyService.CreateCompanyCallback): void; + + /** + * Calls CreateCompany. + * @param request CreateCompanyRequest message or plain object + * @returns Promise + */ + public createCompany(request: google.cloud.talent.v4.ICreateCompanyRequest): Promise; + + /** + * Calls GetCompany. + * @param request GetCompanyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Company + */ + public getCompany(request: google.cloud.talent.v4.IGetCompanyRequest, callback: google.cloud.talent.v4.CompanyService.GetCompanyCallback): void; + + /** + * Calls GetCompany. + * @param request GetCompanyRequest message or plain object + * @returns Promise + */ + public getCompany(request: google.cloud.talent.v4.IGetCompanyRequest): Promise; + + /** + * Calls UpdateCompany. + * @param request UpdateCompanyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Company + */ + public updateCompany(request: google.cloud.talent.v4.IUpdateCompanyRequest, callback: google.cloud.talent.v4.CompanyService.UpdateCompanyCallback): void; + + /** + * Calls UpdateCompany. + * @param request UpdateCompanyRequest message or plain object + * @returns Promise + */ + public updateCompany(request: google.cloud.talent.v4.IUpdateCompanyRequest): Promise; + + /** + * Calls DeleteCompany. + * @param request DeleteCompanyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteCompany(request: google.cloud.talent.v4.IDeleteCompanyRequest, callback: google.cloud.talent.v4.CompanyService.DeleteCompanyCallback): void; + + /** + * Calls DeleteCompany. + * @param request DeleteCompanyRequest message or plain object + * @returns Promise + */ + public deleteCompany(request: google.cloud.talent.v4.IDeleteCompanyRequest): Promise; + + /** + * Calls ListCompanies. + * @param request ListCompaniesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCompaniesResponse + */ + public listCompanies(request: google.cloud.talent.v4.IListCompaniesRequest, callback: google.cloud.talent.v4.CompanyService.ListCompaniesCallback): void; + + /** + * Calls ListCompanies. + * @param request ListCompaniesRequest message or plain object + * @returns Promise + */ + public listCompanies(request: google.cloud.talent.v4.IListCompaniesRequest): Promise; + } + + namespace CompanyService { + + /** + * Callback as used by {@link google.cloud.talent.v4.CompanyService|createCompany}. + * @param error Error, if any + * @param [response] Company + */ + type CreateCompanyCallback = (error: (Error|null), response?: google.cloud.talent.v4.Company) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4.CompanyService|getCompany}. + * @param error Error, if any + * @param [response] Company + */ + type GetCompanyCallback = (error: (Error|null), response?: google.cloud.talent.v4.Company) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4.CompanyService|updateCompany}. + * @param error Error, if any + * @param [response] Company + */ + type UpdateCompanyCallback = (error: (Error|null), response?: google.cloud.talent.v4.Company) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4.CompanyService|deleteCompany}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteCompanyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4.CompanyService|listCompanies}. + * @param error Error, if any + * @param [response] ListCompaniesResponse + */ + type ListCompaniesCallback = (error: (Error|null), response?: google.cloud.talent.v4.ListCompaniesResponse) => void; + } + + /** Properties of a CreateCompanyRequest. */ + interface ICreateCompanyRequest { + + /** CreateCompanyRequest parent */ + parent?: (string|null); + + /** CreateCompanyRequest company */ + company?: (google.cloud.talent.v4.ICompany|null); + } + + /** Represents a CreateCompanyRequest. */ + class CreateCompanyRequest implements ICreateCompanyRequest { + + /** + * Constructs a new CreateCompanyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.ICreateCompanyRequest); + + /** CreateCompanyRequest parent. */ + public parent: string; + + /** CreateCompanyRequest company. */ + public company?: (google.cloud.talent.v4.ICompany|null); + + /** + * Creates a new CreateCompanyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCompanyRequest instance + */ + public static create(properties?: google.cloud.talent.v4.ICreateCompanyRequest): google.cloud.talent.v4.CreateCompanyRequest; + + /** + * Encodes the specified CreateCompanyRequest message. Does not implicitly {@link google.cloud.talent.v4.CreateCompanyRequest.verify|verify} messages. + * @param message CreateCompanyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.ICreateCompanyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCompanyRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CreateCompanyRequest.verify|verify} messages. + * @param message CreateCompanyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.ICreateCompanyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCompanyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.CreateCompanyRequest; + + /** + * Decodes a CreateCompanyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.CreateCompanyRequest; + + /** + * Verifies a CreateCompanyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCompanyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCompanyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.CreateCompanyRequest; + + /** + * Creates a plain object from a CreateCompanyRequest message. Also converts values to other types if specified. + * @param message CreateCompanyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.CreateCompanyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCompanyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCompanyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCompanyRequest. */ + interface IGetCompanyRequest { + + /** GetCompanyRequest name */ + name?: (string|null); + } + + /** Represents a GetCompanyRequest. */ + class GetCompanyRequest implements IGetCompanyRequest { + + /** + * Constructs a new GetCompanyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IGetCompanyRequest); + + /** GetCompanyRequest name. */ + public name: string; + + /** + * Creates a new GetCompanyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCompanyRequest instance + */ + public static create(properties?: google.cloud.talent.v4.IGetCompanyRequest): google.cloud.talent.v4.GetCompanyRequest; + + /** + * Encodes the specified GetCompanyRequest message. Does not implicitly {@link google.cloud.talent.v4.GetCompanyRequest.verify|verify} messages. + * @param message GetCompanyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IGetCompanyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCompanyRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.GetCompanyRequest.verify|verify} messages. + * @param message GetCompanyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IGetCompanyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCompanyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.GetCompanyRequest; + + /** + * Decodes a GetCompanyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.GetCompanyRequest; + + /** + * Verifies a GetCompanyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCompanyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCompanyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.GetCompanyRequest; + + /** + * Creates a plain object from a GetCompanyRequest message. Also converts values to other types if specified. + * @param message GetCompanyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.GetCompanyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCompanyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCompanyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCompanyRequest. */ + interface IUpdateCompanyRequest { + + /** UpdateCompanyRequest company */ + company?: (google.cloud.talent.v4.ICompany|null); + + /** UpdateCompanyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateCompanyRequest. */ + class UpdateCompanyRequest implements IUpdateCompanyRequest { + + /** + * Constructs a new UpdateCompanyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IUpdateCompanyRequest); + + /** UpdateCompanyRequest company. */ + public company?: (google.cloud.talent.v4.ICompany|null); + + /** UpdateCompanyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateCompanyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCompanyRequest instance + */ + public static create(properties?: google.cloud.talent.v4.IUpdateCompanyRequest): google.cloud.talent.v4.UpdateCompanyRequest; + + /** + * Encodes the specified UpdateCompanyRequest message. Does not implicitly {@link google.cloud.talent.v4.UpdateCompanyRequest.verify|verify} messages. + * @param message UpdateCompanyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IUpdateCompanyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCompanyRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.UpdateCompanyRequest.verify|verify} messages. + * @param message UpdateCompanyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IUpdateCompanyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCompanyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.UpdateCompanyRequest; + + /** + * Decodes an UpdateCompanyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.UpdateCompanyRequest; + + /** + * Verifies an UpdateCompanyRequest message. + * @param message Plain 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 UpdateCompanyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCompanyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.UpdateCompanyRequest; + + /** + * Creates a plain object from an UpdateCompanyRequest message. Also converts values to other types if specified. + * @param message UpdateCompanyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.UpdateCompanyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCompanyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCompanyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCompanyRequest. */ + interface IDeleteCompanyRequest { + + /** DeleteCompanyRequest name */ + name?: (string|null); + } + + /** Represents a DeleteCompanyRequest. */ + class DeleteCompanyRequest implements IDeleteCompanyRequest { + + /** + * Constructs a new DeleteCompanyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IDeleteCompanyRequest); + + /** DeleteCompanyRequest name. */ + public name: string; + + /** + * Creates a new DeleteCompanyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCompanyRequest instance + */ + public static create(properties?: google.cloud.talent.v4.IDeleteCompanyRequest): google.cloud.talent.v4.DeleteCompanyRequest; + + /** + * Encodes the specified DeleteCompanyRequest message. Does not implicitly {@link google.cloud.talent.v4.DeleteCompanyRequest.verify|verify} messages. + * @param message DeleteCompanyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IDeleteCompanyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCompanyRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.DeleteCompanyRequest.verify|verify} messages. + * @param message DeleteCompanyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IDeleteCompanyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCompanyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.DeleteCompanyRequest; + + /** + * Decodes a DeleteCompanyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.DeleteCompanyRequest; + + /** + * Verifies a DeleteCompanyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCompanyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCompanyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.DeleteCompanyRequest; + + /** + * Creates a plain object from a DeleteCompanyRequest message. Also converts values to other types if specified. + * @param message DeleteCompanyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.DeleteCompanyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCompanyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCompanyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCompaniesRequest. */ + interface IListCompaniesRequest { + + /** ListCompaniesRequest parent */ + parent?: (string|null); + + /** ListCompaniesRequest pageToken */ + pageToken?: (string|null); + + /** ListCompaniesRequest pageSize */ + pageSize?: (number|null); + + /** ListCompaniesRequest requireOpenJobs */ + requireOpenJobs?: (boolean|null); + } + + /** Represents a ListCompaniesRequest. */ + class ListCompaniesRequest implements IListCompaniesRequest { + + /** + * Constructs a new ListCompaniesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IListCompaniesRequest); + + /** ListCompaniesRequest parent. */ + public parent: string; + + /** ListCompaniesRequest pageToken. */ + public pageToken: string; + + /** ListCompaniesRequest pageSize. */ + public pageSize: number; + + /** ListCompaniesRequest requireOpenJobs. */ + public requireOpenJobs: boolean; + + /** + * Creates a new ListCompaniesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCompaniesRequest instance + */ + public static create(properties?: google.cloud.talent.v4.IListCompaniesRequest): google.cloud.talent.v4.ListCompaniesRequest; + + /** + * Encodes the specified ListCompaniesRequest message. Does not implicitly {@link google.cloud.talent.v4.ListCompaniesRequest.verify|verify} messages. + * @param message ListCompaniesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IListCompaniesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCompaniesRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.ListCompaniesRequest.verify|verify} messages. + * @param message ListCompaniesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IListCompaniesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCompaniesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCompaniesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.ListCompaniesRequest; + + /** + * Decodes a ListCompaniesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCompaniesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.ListCompaniesRequest; + + /** + * Verifies a ListCompaniesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCompaniesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCompaniesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.ListCompaniesRequest; + + /** + * Creates a plain object from a ListCompaniesRequest message. Also converts values to other types if specified. + * @param message ListCompaniesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.ListCompaniesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCompaniesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCompaniesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCompaniesResponse. */ + interface IListCompaniesResponse { + + /** ListCompaniesResponse companies */ + companies?: (google.cloud.talent.v4.ICompany[]|null); + + /** ListCompaniesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListCompaniesResponse metadata */ + metadata?: (google.cloud.talent.v4.IResponseMetadata|null); + } + + /** Represents a ListCompaniesResponse. */ + class ListCompaniesResponse implements IListCompaniesResponse { + + /** + * Constructs a new ListCompaniesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IListCompaniesResponse); + + /** ListCompaniesResponse companies. */ + public companies: google.cloud.talent.v4.ICompany[]; + + /** ListCompaniesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListCompaniesResponse metadata. */ + public metadata?: (google.cloud.talent.v4.IResponseMetadata|null); + + /** + * Creates a new ListCompaniesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCompaniesResponse instance + */ + public static create(properties?: google.cloud.talent.v4.IListCompaniesResponse): google.cloud.talent.v4.ListCompaniesResponse; + + /** + * Encodes the specified ListCompaniesResponse message. Does not implicitly {@link google.cloud.talent.v4.ListCompaniesResponse.verify|verify} messages. + * @param message ListCompaniesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IListCompaniesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCompaniesResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4.ListCompaniesResponse.verify|verify} messages. + * @param message ListCompaniesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IListCompaniesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCompaniesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCompaniesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.ListCompaniesResponse; + + /** + * Decodes a ListCompaniesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCompaniesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.ListCompaniesResponse; + + /** + * Verifies a ListCompaniesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCompaniesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCompaniesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.ListCompaniesResponse; + + /** + * Creates a plain object from a ListCompaniesResponse message. Also converts values to other types if specified. + * @param message ListCompaniesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.ListCompaniesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCompaniesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCompaniesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Completion */ + class Completion extends $protobuf.rpc.Service { + + /** + * Constructs a new Completion 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 Completion 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): Completion; + + /** + * Calls CompleteQuery. + * @param request CompleteQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CompleteQueryResponse + */ + public completeQuery(request: google.cloud.talent.v4.ICompleteQueryRequest, callback: google.cloud.talent.v4.Completion.CompleteQueryCallback): void; + + /** + * Calls CompleteQuery. + * @param request CompleteQueryRequest message or plain object + * @returns Promise + */ + public completeQuery(request: google.cloud.talent.v4.ICompleteQueryRequest): Promise; + } + + namespace Completion { + + /** + * Callback as used by {@link google.cloud.talent.v4.Completion|completeQuery}. + * @param error Error, if any + * @param [response] CompleteQueryResponse + */ + type CompleteQueryCallback = (error: (Error|null), response?: google.cloud.talent.v4.CompleteQueryResponse) => void; + } + + /** Properties of a CompleteQueryRequest. */ + interface ICompleteQueryRequest { + + /** CompleteQueryRequest tenant */ + tenant?: (string|null); + + /** CompleteQueryRequest query */ + query?: (string|null); + + /** CompleteQueryRequest languageCodes */ + languageCodes?: (string[]|null); + + /** CompleteQueryRequest pageSize */ + pageSize?: (number|null); + + /** CompleteQueryRequest company */ + company?: (string|null); + + /** CompleteQueryRequest scope */ + scope?: (google.cloud.talent.v4.CompleteQueryRequest.CompletionScope|keyof typeof google.cloud.talent.v4.CompleteQueryRequest.CompletionScope|null); + + /** CompleteQueryRequest type */ + type?: (google.cloud.talent.v4.CompleteQueryRequest.CompletionType|keyof typeof google.cloud.talent.v4.CompleteQueryRequest.CompletionType|null); + } + + /** Represents a CompleteQueryRequest. */ + class CompleteQueryRequest implements ICompleteQueryRequest { + + /** + * Constructs a new CompleteQueryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.ICompleteQueryRequest); + + /** CompleteQueryRequest tenant. */ + public tenant: string; + + /** CompleteQueryRequest query. */ + public query: string; + + /** CompleteQueryRequest languageCodes. */ + public languageCodes: string[]; + + /** CompleteQueryRequest pageSize. */ + public pageSize: number; + + /** CompleteQueryRequest company. */ + public company: string; + + /** CompleteQueryRequest scope. */ + public scope: (google.cloud.talent.v4.CompleteQueryRequest.CompletionScope|keyof typeof google.cloud.talent.v4.CompleteQueryRequest.CompletionScope); + + /** CompleteQueryRequest type. */ + public type: (google.cloud.talent.v4.CompleteQueryRequest.CompletionType|keyof typeof google.cloud.talent.v4.CompleteQueryRequest.CompletionType); + + /** + * Creates a new CompleteQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CompleteQueryRequest instance + */ + public static create(properties?: google.cloud.talent.v4.ICompleteQueryRequest): google.cloud.talent.v4.CompleteQueryRequest; + + /** + * Encodes the specified CompleteQueryRequest message. Does not implicitly {@link google.cloud.talent.v4.CompleteQueryRequest.verify|verify} messages. + * @param message CompleteQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.ICompleteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompleteQueryRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CompleteQueryRequest.verify|verify} messages. + * @param message CompleteQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.ICompleteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompleteQueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompleteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.CompleteQueryRequest; + + /** + * Decodes a CompleteQueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompleteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.CompleteQueryRequest; + + /** + * Verifies a CompleteQueryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompleteQueryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompleteQueryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.CompleteQueryRequest; + + /** + * Creates a plain object from a CompleteQueryRequest message. Also converts values to other types if specified. + * @param message CompleteQueryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.CompleteQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompleteQueryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompleteQueryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CompleteQueryRequest { + + /** CompletionScope enum. */ + enum CompletionScope { + COMPLETION_SCOPE_UNSPECIFIED = 0, + TENANT = 1, + PUBLIC = 2 + } + + /** CompletionType enum. */ + enum CompletionType { + COMPLETION_TYPE_UNSPECIFIED = 0, + JOB_TITLE = 1, + COMPANY_NAME = 2, + COMBINED = 3 + } + } + + /** Properties of a CompleteQueryResponse. */ + interface ICompleteQueryResponse { + + /** CompleteQueryResponse completionResults */ + completionResults?: (google.cloud.talent.v4.CompleteQueryResponse.ICompletionResult[]|null); + + /** CompleteQueryResponse metadata */ + metadata?: (google.cloud.talent.v4.IResponseMetadata|null); + } + + /** Represents a CompleteQueryResponse. */ + class CompleteQueryResponse implements ICompleteQueryResponse { + + /** + * Constructs a new CompleteQueryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.ICompleteQueryResponse); + + /** CompleteQueryResponse completionResults. */ + public completionResults: google.cloud.talent.v4.CompleteQueryResponse.ICompletionResult[]; + + /** CompleteQueryResponse metadata. */ + public metadata?: (google.cloud.talent.v4.IResponseMetadata|null); + + /** + * Creates a new CompleteQueryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CompleteQueryResponse instance + */ + public static create(properties?: google.cloud.talent.v4.ICompleteQueryResponse): google.cloud.talent.v4.CompleteQueryResponse; + + /** + * Encodes the specified CompleteQueryResponse message. Does not implicitly {@link google.cloud.talent.v4.CompleteQueryResponse.verify|verify} messages. + * @param message CompleteQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.ICompleteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompleteQueryResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CompleteQueryResponse.verify|verify} messages. + * @param message CompleteQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.ICompleteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompleteQueryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompleteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.CompleteQueryResponse; + + /** + * Decodes a CompleteQueryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompleteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.CompleteQueryResponse; + + /** + * Verifies a CompleteQueryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompleteQueryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompleteQueryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.CompleteQueryResponse; + + /** + * Creates a plain object from a CompleteQueryResponse message. Also converts values to other types if specified. + * @param message CompleteQueryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.CompleteQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompleteQueryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompleteQueryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CompleteQueryResponse { + + /** Properties of a CompletionResult. */ + interface ICompletionResult { + + /** CompletionResult suggestion */ + suggestion?: (string|null); + + /** CompletionResult type */ + type?: (google.cloud.talent.v4.CompleteQueryRequest.CompletionType|keyof typeof google.cloud.talent.v4.CompleteQueryRequest.CompletionType|null); + + /** CompletionResult imageUri */ + imageUri?: (string|null); + } + + /** Represents a CompletionResult. */ + class CompletionResult implements ICompletionResult { + + /** + * Constructs a new CompletionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.CompleteQueryResponse.ICompletionResult); + + /** CompletionResult suggestion. */ + public suggestion: string; + + /** CompletionResult type. */ + public type: (google.cloud.talent.v4.CompleteQueryRequest.CompletionType|keyof typeof google.cloud.talent.v4.CompleteQueryRequest.CompletionType); + + /** CompletionResult imageUri. */ + public imageUri: string; + + /** + * Creates a new CompletionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns CompletionResult instance + */ + public static create(properties?: google.cloud.talent.v4.CompleteQueryResponse.ICompletionResult): google.cloud.talent.v4.CompleteQueryResponse.CompletionResult; + + /** + * Encodes the specified CompletionResult message. Does not implicitly {@link google.cloud.talent.v4.CompleteQueryResponse.CompletionResult.verify|verify} messages. + * @param message CompletionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.CompleteQueryResponse.ICompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompletionResult message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CompleteQueryResponse.CompletionResult.verify|verify} messages. + * @param message CompletionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.CompleteQueryResponse.ICompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompletionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.CompleteQueryResponse.CompletionResult; + + /** + * Decodes a CompletionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.CompleteQueryResponse.CompletionResult; + + /** + * Verifies a CompletionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompletionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompletionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.CompleteQueryResponse.CompletionResult; + + /** + * Creates a plain object from a CompletionResult message. Also converts values to other types if specified. + * @param message CompletionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.CompleteQueryResponse.CompletionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompletionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompletionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ClientEvent. */ + interface IClientEvent { + + /** ClientEvent requestId */ + requestId?: (string|null); + + /** ClientEvent eventId */ + eventId?: (string|null); + + /** ClientEvent createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ClientEvent jobEvent */ + jobEvent?: (google.cloud.talent.v4.IJobEvent|null); + + /** ClientEvent eventNotes */ + eventNotes?: (string|null); + } + + /** Represents a ClientEvent. */ + class ClientEvent implements IClientEvent { + + /** + * Constructs a new ClientEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IClientEvent); + + /** ClientEvent requestId. */ + public requestId: string; + + /** ClientEvent eventId. */ + public eventId: string; + + /** ClientEvent createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ClientEvent jobEvent. */ + public jobEvent?: (google.cloud.talent.v4.IJobEvent|null); + + /** ClientEvent eventNotes. */ + public eventNotes: string; + + /** ClientEvent event. */ + public event?: "jobEvent"; + + /** + * Creates a new ClientEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientEvent instance + */ + public static create(properties?: google.cloud.talent.v4.IClientEvent): google.cloud.talent.v4.ClientEvent; + + /** + * Encodes the specified ClientEvent message. Does not implicitly {@link google.cloud.talent.v4.ClientEvent.verify|verify} messages. + * @param message ClientEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IClientEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientEvent message, length delimited. Does not implicitly {@link google.cloud.talent.v4.ClientEvent.verify|verify} messages. + * @param message ClientEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IClientEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.ClientEvent; + + /** + * Decodes a ClientEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.ClientEvent; + + /** + * Verifies a ClientEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.ClientEvent; + + /** + * Creates a plain object from a ClientEvent message. Also converts values to other types if specified. + * @param message ClientEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.ClientEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobEvent. */ + interface IJobEvent { + + /** JobEvent type */ + type?: (google.cloud.talent.v4.JobEvent.JobEventType|keyof typeof google.cloud.talent.v4.JobEvent.JobEventType|null); + + /** JobEvent jobs */ + jobs?: (string[]|null); + } + + /** Represents a JobEvent. */ + class JobEvent implements IJobEvent { + + /** + * Constructs a new JobEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IJobEvent); + + /** JobEvent type. */ + public type: (google.cloud.talent.v4.JobEvent.JobEventType|keyof typeof google.cloud.talent.v4.JobEvent.JobEventType); + + /** JobEvent jobs. */ + public jobs: string[]; + + /** + * Creates a new JobEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns JobEvent instance + */ + public static create(properties?: google.cloud.talent.v4.IJobEvent): google.cloud.talent.v4.JobEvent; + + /** + * Encodes the specified JobEvent message. Does not implicitly {@link google.cloud.talent.v4.JobEvent.verify|verify} messages. + * @param message JobEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IJobEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobEvent message, length delimited. Does not implicitly {@link google.cloud.talent.v4.JobEvent.verify|verify} messages. + * @param message JobEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IJobEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.JobEvent; + + /** + * Decodes a JobEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.JobEvent; + + /** + * Verifies a JobEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.JobEvent; + + /** + * Creates a plain object from a JobEvent message. Also converts values to other types if specified. + * @param message JobEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.JobEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobEvent { + + /** JobEventType enum. */ + enum JobEventType { + JOB_EVENT_TYPE_UNSPECIFIED = 0, + IMPRESSION = 1, + VIEW = 2, + VIEW_REDIRECT = 3, + APPLICATION_START = 4, + APPLICATION_FINISH = 5, + APPLICATION_QUICK_SUBMISSION = 6, + APPLICATION_REDIRECT = 7, + APPLICATION_START_FROM_SEARCH = 8, + APPLICATION_REDIRECT_FROM_SEARCH = 9, + APPLICATION_COMPANY_SUBMIT = 10, + BOOKMARK = 11, + NOTIFICATION = 12, + HIRED = 13, + SENT_CV = 14, + INTERVIEW_GRANTED = 15 + } + } + + /** Represents an EventService */ + class EventService extends $protobuf.rpc.Service { + + /** + * Constructs a new EventService 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 EventService 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): EventService; + + /** + * Calls CreateClientEvent. + * @param request CreateClientEventRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ClientEvent + */ + public createClientEvent(request: google.cloud.talent.v4.ICreateClientEventRequest, callback: google.cloud.talent.v4.EventService.CreateClientEventCallback): void; + + /** + * Calls CreateClientEvent. + * @param request CreateClientEventRequest message or plain object + * @returns Promise + */ + public createClientEvent(request: google.cloud.talent.v4.ICreateClientEventRequest): Promise; + } + + namespace EventService { + + /** + * Callback as used by {@link google.cloud.talent.v4.EventService|createClientEvent}. + * @param error Error, if any + * @param [response] ClientEvent + */ + type CreateClientEventCallback = (error: (Error|null), response?: google.cloud.talent.v4.ClientEvent) => void; + } + + /** Properties of a CreateClientEventRequest. */ + interface ICreateClientEventRequest { + + /** CreateClientEventRequest parent */ + parent?: (string|null); + + /** CreateClientEventRequest clientEvent */ + clientEvent?: (google.cloud.talent.v4.IClientEvent|null); + } + + /** Represents a CreateClientEventRequest. */ + class CreateClientEventRequest implements ICreateClientEventRequest { + + /** + * Constructs a new CreateClientEventRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.ICreateClientEventRequest); + + /** CreateClientEventRequest parent. */ + public parent: string; + + /** CreateClientEventRequest clientEvent. */ + public clientEvent?: (google.cloud.talent.v4.IClientEvent|null); + + /** + * Creates a new CreateClientEventRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateClientEventRequest instance + */ + public static create(properties?: google.cloud.talent.v4.ICreateClientEventRequest): google.cloud.talent.v4.CreateClientEventRequest; + + /** + * Encodes the specified CreateClientEventRequest message. Does not implicitly {@link google.cloud.talent.v4.CreateClientEventRequest.verify|verify} messages. + * @param message CreateClientEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.ICreateClientEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateClientEventRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CreateClientEventRequest.verify|verify} messages. + * @param message CreateClientEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.ICreateClientEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateClientEventRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateClientEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.CreateClientEventRequest; + + /** + * Decodes a CreateClientEventRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateClientEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.CreateClientEventRequest; + + /** + * Verifies a CreateClientEventRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateClientEventRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateClientEventRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.CreateClientEventRequest; + + /** + * Creates a plain object from a CreateClientEventRequest message. Also converts values to other types if specified. + * @param message CreateClientEventRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.CreateClientEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateClientEventRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateClientEventRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobQuery. */ + interface IJobQuery { + + /** JobQuery query */ + query?: (string|null); + + /** JobQuery queryLanguageCode */ + queryLanguageCode?: (string|null); + + /** JobQuery companies */ + companies?: (string[]|null); + + /** JobQuery locationFilters */ + locationFilters?: (google.cloud.talent.v4.ILocationFilter[]|null); + + /** JobQuery jobCategories */ + jobCategories?: (google.cloud.talent.v4.JobCategory[]|null); + + /** JobQuery commuteFilter */ + commuteFilter?: (google.cloud.talent.v4.ICommuteFilter|null); + + /** JobQuery companyDisplayNames */ + companyDisplayNames?: (string[]|null); + + /** JobQuery compensationFilter */ + compensationFilter?: (google.cloud.talent.v4.ICompensationFilter|null); + + /** JobQuery customAttributeFilter */ + customAttributeFilter?: (string|null); + + /** JobQuery disableSpellCheck */ + disableSpellCheck?: (boolean|null); + + /** JobQuery employmentTypes */ + employmentTypes?: (google.cloud.talent.v4.EmploymentType[]|null); + + /** JobQuery languageCodes */ + languageCodes?: (string[]|null); + + /** JobQuery publishTimeRange */ + publishTimeRange?: (google.cloud.talent.v4.ITimestampRange|null); + + /** JobQuery excludedJobs */ + excludedJobs?: (string[]|null); + } + + /** Represents a JobQuery. */ + class JobQuery implements IJobQuery { + + /** + * Constructs a new JobQuery. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IJobQuery); + + /** JobQuery query. */ + public query: string; + + /** JobQuery queryLanguageCode. */ + public queryLanguageCode: string; + + /** JobQuery companies. */ + public companies: string[]; + + /** JobQuery locationFilters. */ + public locationFilters: google.cloud.talent.v4.ILocationFilter[]; + + /** JobQuery jobCategories. */ + public jobCategories: google.cloud.talent.v4.JobCategory[]; + + /** JobQuery commuteFilter. */ + public commuteFilter?: (google.cloud.talent.v4.ICommuteFilter|null); + + /** JobQuery companyDisplayNames. */ + public companyDisplayNames: string[]; + + /** JobQuery compensationFilter. */ + public compensationFilter?: (google.cloud.talent.v4.ICompensationFilter|null); + + /** JobQuery customAttributeFilter. */ + public customAttributeFilter: string; + + /** JobQuery disableSpellCheck. */ + public disableSpellCheck: boolean; + + /** JobQuery employmentTypes. */ + public employmentTypes: google.cloud.talent.v4.EmploymentType[]; + + /** JobQuery languageCodes. */ + public languageCodes: string[]; + + /** JobQuery publishTimeRange. */ + public publishTimeRange?: (google.cloud.talent.v4.ITimestampRange|null); + + /** JobQuery excludedJobs. */ + public excludedJobs: string[]; + + /** + * Creates a new JobQuery instance using the specified properties. + * @param [properties] Properties to set + * @returns JobQuery instance + */ + public static create(properties?: google.cloud.talent.v4.IJobQuery): google.cloud.talent.v4.JobQuery; + + /** + * Encodes the specified JobQuery message. Does not implicitly {@link google.cloud.talent.v4.JobQuery.verify|verify} messages. + * @param message JobQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IJobQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobQuery message, length delimited. Does not implicitly {@link google.cloud.talent.v4.JobQuery.verify|verify} messages. + * @param message JobQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IJobQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobQuery message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.JobQuery; + + /** + * Decodes a JobQuery message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.JobQuery; + + /** + * Verifies a JobQuery message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobQuery message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobQuery + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.JobQuery; + + /** + * Creates a plain object from a JobQuery message. Also converts values to other types if specified. + * @param message JobQuery + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.JobQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobQuery to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobQuery + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LocationFilter. */ + interface ILocationFilter { + + /** LocationFilter address */ + address?: (string|null); + + /** LocationFilter regionCode */ + regionCode?: (string|null); + + /** LocationFilter latLng */ + latLng?: (google.type.ILatLng|null); + + /** LocationFilter distanceInMiles */ + distanceInMiles?: (number|null); + + /** LocationFilter telecommutePreference */ + telecommutePreference?: (google.cloud.talent.v4.LocationFilter.TelecommutePreference|keyof typeof google.cloud.talent.v4.LocationFilter.TelecommutePreference|null); + } + + /** Represents a LocationFilter. */ + class LocationFilter implements ILocationFilter { + + /** + * Constructs a new LocationFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.ILocationFilter); + + /** LocationFilter address. */ + public address: string; + + /** LocationFilter regionCode. */ + public regionCode: string; + + /** LocationFilter latLng. */ + public latLng?: (google.type.ILatLng|null); + + /** LocationFilter distanceInMiles. */ + public distanceInMiles: number; + + /** LocationFilter telecommutePreference. */ + public telecommutePreference: (google.cloud.talent.v4.LocationFilter.TelecommutePreference|keyof typeof google.cloud.talent.v4.LocationFilter.TelecommutePreference); + + /** + * Creates a new LocationFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationFilter instance + */ + public static create(properties?: google.cloud.talent.v4.ILocationFilter): google.cloud.talent.v4.LocationFilter; + + /** + * Encodes the specified LocationFilter message. Does not implicitly {@link google.cloud.talent.v4.LocationFilter.verify|verify} messages. + * @param message LocationFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.ILocationFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationFilter message, length delimited. Does not implicitly {@link google.cloud.talent.v4.LocationFilter.verify|verify} messages. + * @param message LocationFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.ILocationFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.LocationFilter; + + /** + * Decodes a LocationFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.LocationFilter; + + /** + * Verifies a LocationFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.LocationFilter; + + /** + * Creates a plain object from a LocationFilter message. Also converts values to other types if specified. + * @param message LocationFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.LocationFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LocationFilter { + + /** TelecommutePreference enum. */ + enum TelecommutePreference { + TELECOMMUTE_PREFERENCE_UNSPECIFIED = 0, + TELECOMMUTE_EXCLUDED = 1, + TELECOMMUTE_ALLOWED = 2, + TELECOMMUTE_JOBS_EXCLUDED = 3 + } + } + + /** Properties of a CompensationFilter. */ + interface ICompensationFilter { + + /** CompensationFilter type */ + type?: (google.cloud.talent.v4.CompensationFilter.FilterType|keyof typeof google.cloud.talent.v4.CompensationFilter.FilterType|null); + + /** CompensationFilter units */ + units?: (google.cloud.talent.v4.CompensationInfo.CompensationUnit[]|null); + + /** CompensationFilter range */ + range?: (google.cloud.talent.v4.CompensationInfo.ICompensationRange|null); + + /** CompensationFilter includeJobsWithUnspecifiedCompensationRange */ + includeJobsWithUnspecifiedCompensationRange?: (boolean|null); + } + + /** Represents a CompensationFilter. */ + class CompensationFilter implements ICompensationFilter { + + /** + * Constructs a new CompensationFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.ICompensationFilter); + + /** CompensationFilter type. */ + public type: (google.cloud.talent.v4.CompensationFilter.FilterType|keyof typeof google.cloud.talent.v4.CompensationFilter.FilterType); + + /** CompensationFilter units. */ + public units: google.cloud.talent.v4.CompensationInfo.CompensationUnit[]; + + /** CompensationFilter range. */ + public range?: (google.cloud.talent.v4.CompensationInfo.ICompensationRange|null); + + /** CompensationFilter includeJobsWithUnspecifiedCompensationRange. */ + public includeJobsWithUnspecifiedCompensationRange: boolean; + + /** + * Creates a new CompensationFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns CompensationFilter instance + */ + public static create(properties?: google.cloud.talent.v4.ICompensationFilter): google.cloud.talent.v4.CompensationFilter; + + /** + * Encodes the specified CompensationFilter message. Does not implicitly {@link google.cloud.talent.v4.CompensationFilter.verify|verify} messages. + * @param message CompensationFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.ICompensationFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompensationFilter message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CompensationFilter.verify|verify} messages. + * @param message CompensationFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.ICompensationFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompensationFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompensationFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.CompensationFilter; + + /** + * Decodes a CompensationFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompensationFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.CompensationFilter; + + /** + * Verifies a CompensationFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompensationFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompensationFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.CompensationFilter; + + /** + * Creates a plain object from a CompensationFilter message. Also converts values to other types if specified. + * @param message CompensationFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.CompensationFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompensationFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompensationFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CompensationFilter { + + /** FilterType enum. */ + enum FilterType { + FILTER_TYPE_UNSPECIFIED = 0, + UNIT_ONLY = 1, + UNIT_AND_AMOUNT = 2, + ANNUALIZED_BASE_AMOUNT = 3, + ANNUALIZED_TOTAL_AMOUNT = 4 + } + } + + /** Properties of a CommuteFilter. */ + interface ICommuteFilter { + + /** CommuteFilter commuteMethod */ + commuteMethod?: (google.cloud.talent.v4.CommuteMethod|keyof typeof google.cloud.talent.v4.CommuteMethod|null); + + /** CommuteFilter startCoordinates */ + startCoordinates?: (google.type.ILatLng|null); + + /** CommuteFilter travelDuration */ + travelDuration?: (google.protobuf.IDuration|null); + + /** CommuteFilter allowImpreciseAddresses */ + allowImpreciseAddresses?: (boolean|null); + + /** CommuteFilter roadTraffic */ + roadTraffic?: (google.cloud.talent.v4.CommuteFilter.RoadTraffic|keyof typeof google.cloud.talent.v4.CommuteFilter.RoadTraffic|null); + + /** CommuteFilter departureTime */ + departureTime?: (google.type.ITimeOfDay|null); + } + + /** Represents a CommuteFilter. */ + class CommuteFilter implements ICommuteFilter { + + /** + * Constructs a new CommuteFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.ICommuteFilter); + + /** CommuteFilter commuteMethod. */ + public commuteMethod: (google.cloud.talent.v4.CommuteMethod|keyof typeof google.cloud.talent.v4.CommuteMethod); + + /** CommuteFilter startCoordinates. */ + public startCoordinates?: (google.type.ILatLng|null); + + /** CommuteFilter travelDuration. */ + public travelDuration?: (google.protobuf.IDuration|null); + + /** CommuteFilter allowImpreciseAddresses. */ + public allowImpreciseAddresses: boolean; + + /** CommuteFilter roadTraffic. */ + public roadTraffic?: (google.cloud.talent.v4.CommuteFilter.RoadTraffic|keyof typeof google.cloud.talent.v4.CommuteFilter.RoadTraffic|null); + + /** CommuteFilter departureTime. */ + public departureTime?: (google.type.ITimeOfDay|null); + + /** CommuteFilter trafficOption. */ + public trafficOption?: ("roadTraffic"|"departureTime"); + + /** + * Creates a new CommuteFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns CommuteFilter instance + */ + public static create(properties?: google.cloud.talent.v4.ICommuteFilter): google.cloud.talent.v4.CommuteFilter; + + /** + * Encodes the specified CommuteFilter message. Does not implicitly {@link google.cloud.talent.v4.CommuteFilter.verify|verify} messages. + * @param message CommuteFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.ICommuteFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommuteFilter message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CommuteFilter.verify|verify} messages. + * @param message CommuteFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.ICommuteFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommuteFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommuteFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.CommuteFilter; + + /** + * Decodes a CommuteFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommuteFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.CommuteFilter; + + /** + * Verifies a CommuteFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommuteFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommuteFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.CommuteFilter; + + /** + * Creates a plain object from a CommuteFilter message. Also converts values to other types if specified. + * @param message CommuteFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.CommuteFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommuteFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommuteFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CommuteFilter { + + /** RoadTraffic enum. */ + enum RoadTraffic { + ROAD_TRAFFIC_UNSPECIFIED = 0, + TRAFFIC_FREE = 1, + BUSY_HOUR = 2 + } + } + + /** Properties of a HistogramQuery. */ + interface IHistogramQuery { + + /** HistogramQuery histogramQuery */ + histogramQuery?: (string|null); + } + + /** Represents a HistogramQuery. */ + class HistogramQuery implements IHistogramQuery { + + /** + * Constructs a new HistogramQuery. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IHistogramQuery); + + /** HistogramQuery histogramQuery. */ + public histogramQuery: string; + + /** + * Creates a new HistogramQuery instance using the specified properties. + * @param [properties] Properties to set + * @returns HistogramQuery instance + */ + public static create(properties?: google.cloud.talent.v4.IHistogramQuery): google.cloud.talent.v4.HistogramQuery; + + /** + * Encodes the specified HistogramQuery message. Does not implicitly {@link google.cloud.talent.v4.HistogramQuery.verify|verify} messages. + * @param message HistogramQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IHistogramQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HistogramQuery message, length delimited. Does not implicitly {@link google.cloud.talent.v4.HistogramQuery.verify|verify} messages. + * @param message HistogramQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IHistogramQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HistogramQuery message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HistogramQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.HistogramQuery; + + /** + * Decodes a HistogramQuery message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HistogramQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.HistogramQuery; + + /** + * Verifies a HistogramQuery message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HistogramQuery message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HistogramQuery + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.HistogramQuery; + + /** + * Creates a plain object from a HistogramQuery message. Also converts values to other types if specified. + * @param message HistogramQuery + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.HistogramQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HistogramQuery to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HistogramQuery + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HistogramQueryResult. */ + interface IHistogramQueryResult { + + /** HistogramQueryResult histogramQuery */ + histogramQuery?: (string|null); + + /** HistogramQueryResult histogram */ + histogram?: ({ [k: string]: (number|Long|string) }|null); + } + + /** Represents a HistogramQueryResult. */ + class HistogramQueryResult implements IHistogramQueryResult { + + /** + * Constructs a new HistogramQueryResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IHistogramQueryResult); + + /** HistogramQueryResult histogramQuery. */ + public histogramQuery: string; + + /** HistogramQueryResult histogram. */ + public histogram: { [k: string]: (number|Long|string) }; + + /** + * Creates a new HistogramQueryResult instance using the specified properties. + * @param [properties] Properties to set + * @returns HistogramQueryResult instance + */ + public static create(properties?: google.cloud.talent.v4.IHistogramQueryResult): google.cloud.talent.v4.HistogramQueryResult; + + /** + * Encodes the specified HistogramQueryResult message. Does not implicitly {@link google.cloud.talent.v4.HistogramQueryResult.verify|verify} messages. + * @param message HistogramQueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IHistogramQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HistogramQueryResult message, length delimited. Does not implicitly {@link google.cloud.talent.v4.HistogramQueryResult.verify|verify} messages. + * @param message HistogramQueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IHistogramQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HistogramQueryResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HistogramQueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.HistogramQueryResult; + + /** + * Decodes a HistogramQueryResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HistogramQueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.HistogramQueryResult; + + /** + * Verifies a HistogramQueryResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HistogramQueryResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HistogramQueryResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.HistogramQueryResult; + + /** + * Creates a plain object from a HistogramQueryResult message. Also converts values to other types if specified. + * @param message HistogramQueryResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.HistogramQueryResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HistogramQueryResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HistogramQueryResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Job. */ + interface IJob { + + /** Job name */ + name?: (string|null); + + /** Job company */ + company?: (string|null); + + /** Job requisitionId */ + requisitionId?: (string|null); + + /** Job title */ + title?: (string|null); + + /** Job description */ + description?: (string|null); + + /** Job addresses */ + addresses?: (string[]|null); + + /** Job applicationInfo */ + applicationInfo?: (google.cloud.talent.v4.Job.IApplicationInfo|null); + + /** Job jobBenefits */ + jobBenefits?: (google.cloud.talent.v4.JobBenefit[]|null); + + /** Job compensationInfo */ + compensationInfo?: (google.cloud.talent.v4.ICompensationInfo|null); + + /** Job customAttributes */ + customAttributes?: ({ [k: string]: google.cloud.talent.v4.ICustomAttribute }|null); + + /** Job degreeTypes */ + degreeTypes?: (google.cloud.talent.v4.DegreeType[]|null); + + /** Job department */ + department?: (string|null); + + /** Job employmentTypes */ + employmentTypes?: (google.cloud.talent.v4.EmploymentType[]|null); + + /** Job incentives */ + incentives?: (string|null); + + /** Job languageCode */ + languageCode?: (string|null); + + /** Job jobLevel */ + jobLevel?: (google.cloud.talent.v4.JobLevel|keyof typeof google.cloud.talent.v4.JobLevel|null); + + /** Job promotionValue */ + promotionValue?: (number|null); + + /** Job qualifications */ + qualifications?: (string|null); + + /** Job responsibilities */ + responsibilities?: (string|null); + + /** Job postingRegion */ + postingRegion?: (google.cloud.talent.v4.PostingRegion|keyof typeof google.cloud.talent.v4.PostingRegion|null); + + /** Job visibility */ + visibility?: (google.cloud.talent.v4.Visibility|keyof typeof google.cloud.talent.v4.Visibility|null); + + /** Job jobStartTime */ + jobStartTime?: (google.protobuf.ITimestamp|null); + + /** Job jobEndTime */ + jobEndTime?: (google.protobuf.ITimestamp|null); + + /** Job postingPublishTime */ + postingPublishTime?: (google.protobuf.ITimestamp|null); + + /** Job postingExpireTime */ + postingExpireTime?: (google.protobuf.ITimestamp|null); + + /** Job postingCreateTime */ + postingCreateTime?: (google.protobuf.ITimestamp|null); + + /** Job postingUpdateTime */ + postingUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Job companyDisplayName */ + companyDisplayName?: (string|null); + + /** Job derivedInfo */ + derivedInfo?: (google.cloud.talent.v4.Job.IDerivedInfo|null); + + /** Job processingOptions */ + processingOptions?: (google.cloud.talent.v4.Job.IProcessingOptions|null); + } + + /** Represents a Job. */ + class Job implements IJob { + + /** + * Constructs a new Job. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IJob); + + /** Job name. */ + public name: string; + + /** Job company. */ + public company: string; + + /** Job requisitionId. */ + public requisitionId: string; + + /** Job title. */ + public title: string; + + /** Job description. */ + public description: string; + + /** Job addresses. */ + public addresses: string[]; + + /** Job applicationInfo. */ + public applicationInfo?: (google.cloud.talent.v4.Job.IApplicationInfo|null); + + /** Job jobBenefits. */ + public jobBenefits: google.cloud.talent.v4.JobBenefit[]; + + /** Job compensationInfo. */ + public compensationInfo?: (google.cloud.talent.v4.ICompensationInfo|null); + + /** Job customAttributes. */ + public customAttributes: { [k: string]: google.cloud.talent.v4.ICustomAttribute }; + + /** Job degreeTypes. */ + public degreeTypes: google.cloud.talent.v4.DegreeType[]; + + /** Job department. */ + public department: string; + + /** Job employmentTypes. */ + public employmentTypes: google.cloud.talent.v4.EmploymentType[]; + + /** Job incentives. */ + public incentives: string; + + /** Job languageCode. */ + public languageCode: string; + + /** Job jobLevel. */ + public jobLevel: (google.cloud.talent.v4.JobLevel|keyof typeof google.cloud.talent.v4.JobLevel); + + /** Job promotionValue. */ + public promotionValue: number; + + /** Job qualifications. */ + public qualifications: string; + + /** Job responsibilities. */ + public responsibilities: string; + + /** Job postingRegion. */ + public postingRegion: (google.cloud.talent.v4.PostingRegion|keyof typeof google.cloud.talent.v4.PostingRegion); + + /** Job visibility. */ + public visibility: (google.cloud.talent.v4.Visibility|keyof typeof google.cloud.talent.v4.Visibility); + + /** Job jobStartTime. */ + public jobStartTime?: (google.protobuf.ITimestamp|null); + + /** Job jobEndTime. */ + public jobEndTime?: (google.protobuf.ITimestamp|null); + + /** Job postingPublishTime. */ + public postingPublishTime?: (google.protobuf.ITimestamp|null); + + /** Job postingExpireTime. */ + public postingExpireTime?: (google.protobuf.ITimestamp|null); + + /** Job postingCreateTime. */ + public postingCreateTime?: (google.protobuf.ITimestamp|null); + + /** Job postingUpdateTime. */ + public postingUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Job companyDisplayName. */ + public companyDisplayName: string; + + /** Job derivedInfo. */ + public derivedInfo?: (google.cloud.talent.v4.Job.IDerivedInfo|null); + + /** Job processingOptions. */ + public processingOptions?: (google.cloud.talent.v4.Job.IProcessingOptions|null); + + /** + * Creates a new Job instance using the specified properties. + * @param [properties] Properties to set + * @returns Job instance + */ + public static create(properties?: google.cloud.talent.v4.IJob): google.cloud.talent.v4.Job; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.talent.v4.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.talent.v4.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Job message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.Job; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.Job; + + /** + * Verifies a Job message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Job + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.Job; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @param message Job + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.Job, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Job to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Job + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Job { + + /** Properties of an ApplicationInfo. */ + interface IApplicationInfo { + + /** ApplicationInfo emails */ + emails?: (string[]|null); + + /** ApplicationInfo instruction */ + instruction?: (string|null); + + /** ApplicationInfo uris */ + uris?: (string[]|null); + } + + /** Represents an ApplicationInfo. */ + class ApplicationInfo implements IApplicationInfo { + + /** + * Constructs a new ApplicationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.Job.IApplicationInfo); + + /** ApplicationInfo emails. */ + public emails: string[]; + + /** ApplicationInfo instruction. */ + public instruction: string; + + /** ApplicationInfo uris. */ + public uris: string[]; + + /** + * Creates a new ApplicationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ApplicationInfo instance + */ + public static create(properties?: google.cloud.talent.v4.Job.IApplicationInfo): google.cloud.talent.v4.Job.ApplicationInfo; + + /** + * Encodes the specified ApplicationInfo message. Does not implicitly {@link google.cloud.talent.v4.Job.ApplicationInfo.verify|verify} messages. + * @param message ApplicationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.Job.IApplicationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApplicationInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4.Job.ApplicationInfo.verify|verify} messages. + * @param message ApplicationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.Job.IApplicationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApplicationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApplicationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.Job.ApplicationInfo; + + /** + * Decodes an ApplicationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApplicationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.Job.ApplicationInfo; + + /** + * Verifies an ApplicationInfo message. + * @param message Plain 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 ApplicationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApplicationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.Job.ApplicationInfo; + + /** + * Creates a plain object from an ApplicationInfo message. Also converts values to other types if specified. + * @param message ApplicationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.Job.ApplicationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApplicationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApplicationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DerivedInfo. */ + interface IDerivedInfo { + + /** DerivedInfo locations */ + locations?: (google.cloud.talent.v4.ILocation[]|null); + + /** DerivedInfo jobCategories */ + jobCategories?: (google.cloud.talent.v4.JobCategory[]|null); + } + + /** Represents a DerivedInfo. */ + class DerivedInfo implements IDerivedInfo { + + /** + * Constructs a new DerivedInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.Job.IDerivedInfo); + + /** DerivedInfo locations. */ + public locations: google.cloud.talent.v4.ILocation[]; + + /** DerivedInfo jobCategories. */ + public jobCategories: google.cloud.talent.v4.JobCategory[]; + + /** + * Creates a new DerivedInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DerivedInfo instance + */ + public static create(properties?: google.cloud.talent.v4.Job.IDerivedInfo): google.cloud.talent.v4.Job.DerivedInfo; + + /** + * Encodes the specified DerivedInfo message. Does not implicitly {@link google.cloud.talent.v4.Job.DerivedInfo.verify|verify} messages. + * @param message DerivedInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.Job.IDerivedInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DerivedInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4.Job.DerivedInfo.verify|verify} messages. + * @param message DerivedInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.Job.IDerivedInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DerivedInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DerivedInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.Job.DerivedInfo; + + /** + * Decodes a DerivedInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DerivedInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.Job.DerivedInfo; + + /** + * Verifies a DerivedInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DerivedInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DerivedInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.Job.DerivedInfo; + + /** + * Creates a plain object from a DerivedInfo message. Also converts values to other types if specified. + * @param message DerivedInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.Job.DerivedInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DerivedInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DerivedInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ProcessingOptions. */ + interface IProcessingOptions { + + /** ProcessingOptions disableStreetAddressResolution */ + disableStreetAddressResolution?: (boolean|null); + + /** ProcessingOptions htmlSanitization */ + htmlSanitization?: (google.cloud.talent.v4.HtmlSanitization|keyof typeof google.cloud.talent.v4.HtmlSanitization|null); + } + + /** Represents a ProcessingOptions. */ + class ProcessingOptions implements IProcessingOptions { + + /** + * Constructs a new ProcessingOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.Job.IProcessingOptions); + + /** ProcessingOptions disableStreetAddressResolution. */ + public disableStreetAddressResolution: boolean; + + /** ProcessingOptions htmlSanitization. */ + public htmlSanitization: (google.cloud.talent.v4.HtmlSanitization|keyof typeof google.cloud.talent.v4.HtmlSanitization); + + /** + * Creates a new ProcessingOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessingOptions instance + */ + public static create(properties?: google.cloud.talent.v4.Job.IProcessingOptions): google.cloud.talent.v4.Job.ProcessingOptions; + + /** + * Encodes the specified ProcessingOptions message. Does not implicitly {@link google.cloud.talent.v4.Job.ProcessingOptions.verify|verify} messages. + * @param message ProcessingOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.Job.IProcessingOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessingOptions message, length delimited. Does not implicitly {@link google.cloud.talent.v4.Job.ProcessingOptions.verify|verify} messages. + * @param message ProcessingOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.Job.IProcessingOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessingOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.Job.ProcessingOptions; + + /** + * Decodes a ProcessingOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.Job.ProcessingOptions; + + /** + * Verifies a ProcessingOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProcessingOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessingOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.Job.ProcessingOptions; + + /** + * Creates a plain object from a ProcessingOptions message. Also converts values to other types if specified. + * @param message ProcessingOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.Job.ProcessingOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessingOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessingOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a JobService */ + class JobService extends $protobuf.rpc.Service { + + /** + * Constructs a new JobService 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 JobService 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): JobService; + + /** + * Calls CreateJob. + * @param request CreateJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public createJob(request: google.cloud.talent.v4.ICreateJobRequest, callback: google.cloud.talent.v4.JobService.CreateJobCallback): void; + + /** + * Calls CreateJob. + * @param request CreateJobRequest message or plain object + * @returns Promise + */ + public createJob(request: google.cloud.talent.v4.ICreateJobRequest): Promise; + + /** + * Calls BatchCreateJobs. + * @param request BatchCreateJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchCreateJobs(request: google.cloud.talent.v4.IBatchCreateJobsRequest, callback: google.cloud.talent.v4.JobService.BatchCreateJobsCallback): void; + + /** + * Calls BatchCreateJobs. + * @param request BatchCreateJobsRequest message or plain object + * @returns Promise + */ + public batchCreateJobs(request: google.cloud.talent.v4.IBatchCreateJobsRequest): Promise; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public getJob(request: google.cloud.talent.v4.IGetJobRequest, callback: google.cloud.talent.v4.JobService.GetJobCallback): void; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @returns Promise + */ + public getJob(request: google.cloud.talent.v4.IGetJobRequest): Promise; + + /** + * Calls UpdateJob. + * @param request UpdateJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public updateJob(request: google.cloud.talent.v4.IUpdateJobRequest, callback: google.cloud.talent.v4.JobService.UpdateJobCallback): void; + + /** + * Calls UpdateJob. + * @param request UpdateJobRequest message or plain object + * @returns Promise + */ + public updateJob(request: google.cloud.talent.v4.IUpdateJobRequest): Promise; + + /** + * Calls BatchUpdateJobs. + * @param request BatchUpdateJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchUpdateJobs(request: google.cloud.talent.v4.IBatchUpdateJobsRequest, callback: google.cloud.talent.v4.JobService.BatchUpdateJobsCallback): void; + + /** + * Calls BatchUpdateJobs. + * @param request BatchUpdateJobsRequest message or plain object + * @returns Promise + */ + public batchUpdateJobs(request: google.cloud.talent.v4.IBatchUpdateJobsRequest): Promise; + + /** + * Calls DeleteJob. + * @param request DeleteJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteJob(request: google.cloud.talent.v4.IDeleteJobRequest, callback: google.cloud.talent.v4.JobService.DeleteJobCallback): void; + + /** + * Calls DeleteJob. + * @param request DeleteJobRequest message or plain object + * @returns Promise + */ + public deleteJob(request: google.cloud.talent.v4.IDeleteJobRequest): Promise; + + /** + * Calls BatchDeleteJobs. + * @param request BatchDeleteJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchDeleteJobs(request: google.cloud.talent.v4.IBatchDeleteJobsRequest, callback: google.cloud.talent.v4.JobService.BatchDeleteJobsCallback): void; + + /** + * Calls BatchDeleteJobs. + * @param request BatchDeleteJobsRequest message or plain object + * @returns Promise + */ + public batchDeleteJobs(request: google.cloud.talent.v4.IBatchDeleteJobsRequest): Promise; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListJobsResponse + */ + public listJobs(request: google.cloud.talent.v4.IListJobsRequest, callback: google.cloud.talent.v4.JobService.ListJobsCallback): void; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @returns Promise + */ + public listJobs(request: google.cloud.talent.v4.IListJobsRequest): Promise; + + /** + * Calls SearchJobs. + * @param request SearchJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchJobsResponse + */ + public searchJobs(request: google.cloud.talent.v4.ISearchJobsRequest, callback: google.cloud.talent.v4.JobService.SearchJobsCallback): void; + + /** + * Calls SearchJobs. + * @param request SearchJobsRequest message or plain object + * @returns Promise + */ + public searchJobs(request: google.cloud.talent.v4.ISearchJobsRequest): Promise; + + /** + * Calls SearchJobsForAlert. + * @param request SearchJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchJobsResponse + */ + public searchJobsForAlert(request: google.cloud.talent.v4.ISearchJobsRequest, callback: google.cloud.talent.v4.JobService.SearchJobsForAlertCallback): void; + + /** + * Calls SearchJobsForAlert. + * @param request SearchJobsRequest message or plain object + * @returns Promise + */ + public searchJobsForAlert(request: google.cloud.talent.v4.ISearchJobsRequest): Promise; + } + + namespace JobService { + + /** + * Callback as used by {@link google.cloud.talent.v4.JobService|createJob}. + * @param error Error, if any + * @param [response] Job + */ + type CreateJobCallback = (error: (Error|null), response?: google.cloud.talent.v4.Job) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4.JobService|batchCreateJobs}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchCreateJobsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4.JobService|getJob}. + * @param error Error, if any + * @param [response] Job + */ + type GetJobCallback = (error: (Error|null), response?: google.cloud.talent.v4.Job) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4.JobService|updateJob}. + * @param error Error, if any + * @param [response] Job + */ + type UpdateJobCallback = (error: (Error|null), response?: google.cloud.talent.v4.Job) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4.JobService|batchUpdateJobs}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchUpdateJobsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4.JobService|deleteJob}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteJobCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4.JobService|batchDeleteJobs}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchDeleteJobsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4.JobService|listJobs}. + * @param error Error, if any + * @param [response] ListJobsResponse + */ + type ListJobsCallback = (error: (Error|null), response?: google.cloud.talent.v4.ListJobsResponse) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4.JobService|searchJobs}. + * @param error Error, if any + * @param [response] SearchJobsResponse + */ + type SearchJobsCallback = (error: (Error|null), response?: google.cloud.talent.v4.SearchJobsResponse) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4.JobService|searchJobsForAlert}. + * @param error Error, if any + * @param [response] SearchJobsResponse + */ + type SearchJobsForAlertCallback = (error: (Error|null), response?: google.cloud.talent.v4.SearchJobsResponse) => void; + } + + /** Properties of a CreateJobRequest. */ + interface ICreateJobRequest { + + /** CreateJobRequest parent */ + parent?: (string|null); + + /** CreateJobRequest job */ + job?: (google.cloud.talent.v4.IJob|null); + } + + /** Represents a CreateJobRequest. */ + class CreateJobRequest implements ICreateJobRequest { + + /** + * Constructs a new CreateJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.ICreateJobRequest); + + /** CreateJobRequest parent. */ + public parent: string; + + /** CreateJobRequest job. */ + public job?: (google.cloud.talent.v4.IJob|null); + + /** + * Creates a new CreateJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateJobRequest instance + */ + public static create(properties?: google.cloud.talent.v4.ICreateJobRequest): google.cloud.talent.v4.CreateJobRequest; + + /** + * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.talent.v4.CreateJobRequest.verify|verify} messages. + * @param message CreateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CreateJobRequest.verify|verify} messages. + * @param message CreateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.CreateJobRequest; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.CreateJobRequest; + + /** + * Verifies a CreateJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.CreateJobRequest; + + /** + * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. + * @param message CreateJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.CreateJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetJobRequest. */ + interface IGetJobRequest { + + /** GetJobRequest name */ + name?: (string|null); + } + + /** Represents a GetJobRequest. */ + class GetJobRequest implements IGetJobRequest { + + /** + * Constructs a new GetJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IGetJobRequest); + + /** GetJobRequest name. */ + public name: string; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetJobRequest instance + */ + public static create(properties?: google.cloud.talent.v4.IGetJobRequest): google.cloud.talent.v4.GetJobRequest; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.talent.v4.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.GetJobRequest; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.GetJobRequest; + + /** + * Verifies a GetJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.GetJobRequest; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @param message GetJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.GetJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateJobRequest. */ + interface IUpdateJobRequest { + + /** UpdateJobRequest job */ + job?: (google.cloud.talent.v4.IJob|null); + + /** UpdateJobRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateJobRequest. */ + class UpdateJobRequest implements IUpdateJobRequest { + + /** + * Constructs a new UpdateJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IUpdateJobRequest); + + /** UpdateJobRequest job. */ + public job?: (google.cloud.talent.v4.IJob|null); + + /** UpdateJobRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateJobRequest instance + */ + public static create(properties?: google.cloud.talent.v4.IUpdateJobRequest): google.cloud.talent.v4.UpdateJobRequest; + + /** + * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.talent.v4.UpdateJobRequest.verify|verify} messages. + * @param message UpdateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IUpdateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.UpdateJobRequest.verify|verify} messages. + * @param message UpdateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IUpdateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.UpdateJobRequest; + + /** + * Decodes an UpdateJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.UpdateJobRequest; + + /** + * Verifies an UpdateJobRequest message. + * @param message Plain 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 UpdateJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.UpdateJobRequest; + + /** + * Creates a plain object from an UpdateJobRequest message. Also converts values to other types if specified. + * @param message UpdateJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.UpdateJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteJobRequest. */ + interface IDeleteJobRequest { + + /** DeleteJobRequest name */ + name?: (string|null); + } + + /** Represents a DeleteJobRequest. */ + class DeleteJobRequest implements IDeleteJobRequest { + + /** + * Constructs a new DeleteJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IDeleteJobRequest); + + /** DeleteJobRequest name. */ + public name: string; + + /** + * Creates a new DeleteJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteJobRequest instance + */ + public static create(properties?: google.cloud.talent.v4.IDeleteJobRequest): google.cloud.talent.v4.DeleteJobRequest; + + /** + * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.talent.v4.DeleteJobRequest.verify|verify} messages. + * @param message DeleteJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.DeleteJobRequest.verify|verify} messages. + * @param message DeleteJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.DeleteJobRequest; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.DeleteJobRequest; + + /** + * Verifies a DeleteJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.DeleteJobRequest; + + /** + * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. + * @param message DeleteJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.DeleteJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** JobView enum. */ + enum JobView { + JOB_VIEW_UNSPECIFIED = 0, + JOB_VIEW_ID_ONLY = 1, + JOB_VIEW_MINIMAL = 2, + JOB_VIEW_SMALL = 3, + JOB_VIEW_FULL = 4 + } + + /** Properties of a ListJobsRequest. */ + interface IListJobsRequest { + + /** ListJobsRequest parent */ + parent?: (string|null); + + /** ListJobsRequest filter */ + filter?: (string|null); + + /** ListJobsRequest pageToken */ + pageToken?: (string|null); + + /** ListJobsRequest pageSize */ + pageSize?: (number|null); + + /** ListJobsRequest jobView */ + jobView?: (google.cloud.talent.v4.JobView|keyof typeof google.cloud.talent.v4.JobView|null); + } + + /** Represents a ListJobsRequest. */ + class ListJobsRequest implements IListJobsRequest { + + /** + * Constructs a new ListJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IListJobsRequest); + + /** ListJobsRequest parent. */ + public parent: string; + + /** ListJobsRequest filter. */ + public filter: string; + + /** ListJobsRequest pageToken. */ + public pageToken: string; + + /** ListJobsRequest pageSize. */ + public pageSize: number; + + /** ListJobsRequest jobView. */ + public jobView: (google.cloud.talent.v4.JobView|keyof typeof google.cloud.talent.v4.JobView); + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsRequest instance + */ + public static create(properties?: google.cloud.talent.v4.IListJobsRequest): google.cloud.talent.v4.ListJobsRequest; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.talent.v4.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.ListJobsRequest; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.ListJobsRequest; + + /** + * Verifies a ListJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.ListJobsRequest; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @param message ListJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.ListJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobsResponse. */ + interface IListJobsResponse { + + /** ListJobsResponse jobs */ + jobs?: (google.cloud.talent.v4.IJob[]|null); + + /** ListJobsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListJobsResponse metadata */ + metadata?: (google.cloud.talent.v4.IResponseMetadata|null); + } + + /** Represents a ListJobsResponse. */ + class ListJobsResponse implements IListJobsResponse { + + /** + * Constructs a new ListJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IListJobsResponse); + + /** ListJobsResponse jobs. */ + public jobs: google.cloud.talent.v4.IJob[]; + + /** ListJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListJobsResponse metadata. */ + public metadata?: (google.cloud.talent.v4.IResponseMetadata|null); + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsResponse instance + */ + public static create(properties?: google.cloud.talent.v4.IListJobsResponse): google.cloud.talent.v4.ListJobsResponse; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.talent.v4.ListJobsResponse.verify|verify} messages. + * @param message ListJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4.ListJobsResponse.verify|verify} messages. + * @param message ListJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.ListJobsResponse; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.ListJobsResponse; + + /** + * Verifies a ListJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.ListJobsResponse; + + /** + * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. + * @param message ListJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.ListJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchJobsRequest. */ + interface ISearchJobsRequest { + + /** SearchJobsRequest parent */ + parent?: (string|null); + + /** SearchJobsRequest searchMode */ + searchMode?: (google.cloud.talent.v4.SearchJobsRequest.SearchMode|keyof typeof google.cloud.talent.v4.SearchJobsRequest.SearchMode|null); + + /** SearchJobsRequest requestMetadata */ + requestMetadata?: (google.cloud.talent.v4.IRequestMetadata|null); + + /** SearchJobsRequest jobQuery */ + jobQuery?: (google.cloud.talent.v4.IJobQuery|null); + + /** SearchJobsRequest enableBroadening */ + enableBroadening?: (boolean|null); + + /** SearchJobsRequest histogramQueries */ + histogramQueries?: (google.cloud.talent.v4.IHistogramQuery[]|null); + + /** SearchJobsRequest jobView */ + jobView?: (google.cloud.talent.v4.JobView|keyof typeof google.cloud.talent.v4.JobView|null); + + /** SearchJobsRequest offset */ + offset?: (number|null); + + /** SearchJobsRequest maxPageSize */ + maxPageSize?: (number|null); + + /** SearchJobsRequest pageToken */ + pageToken?: (string|null); + + /** SearchJobsRequest orderBy */ + orderBy?: (string|null); + + /** SearchJobsRequest diversificationLevel */ + diversificationLevel?: (google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel|keyof typeof google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel|null); + + /** SearchJobsRequest customRankingInfo */ + customRankingInfo?: (google.cloud.talent.v4.SearchJobsRequest.ICustomRankingInfo|null); + + /** SearchJobsRequest disableKeywordMatch */ + disableKeywordMatch?: (boolean|null); + + /** SearchJobsRequest keywordMatchMode */ + keywordMatchMode?: (google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode|keyof typeof google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode|null); + } + + /** Represents a SearchJobsRequest. */ + class SearchJobsRequest implements ISearchJobsRequest { + + /** + * Constructs a new SearchJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.ISearchJobsRequest); + + /** SearchJobsRequest parent. */ + public parent: string; + + /** SearchJobsRequest searchMode. */ + public searchMode: (google.cloud.talent.v4.SearchJobsRequest.SearchMode|keyof typeof google.cloud.talent.v4.SearchJobsRequest.SearchMode); + + /** SearchJobsRequest requestMetadata. */ + public requestMetadata?: (google.cloud.talent.v4.IRequestMetadata|null); + + /** SearchJobsRequest jobQuery. */ + public jobQuery?: (google.cloud.talent.v4.IJobQuery|null); + + /** SearchJobsRequest enableBroadening. */ + public enableBroadening: boolean; + + /** SearchJobsRequest histogramQueries. */ + public histogramQueries: google.cloud.talent.v4.IHistogramQuery[]; + + /** SearchJobsRequest jobView. */ + public jobView: (google.cloud.talent.v4.JobView|keyof typeof google.cloud.talent.v4.JobView); + + /** SearchJobsRequest offset. */ + public offset: number; + + /** SearchJobsRequest maxPageSize. */ + public maxPageSize: number; + + /** SearchJobsRequest pageToken. */ + public pageToken: string; + + /** SearchJobsRequest orderBy. */ + public orderBy: string; + + /** SearchJobsRequest diversificationLevel. */ + public diversificationLevel: (google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel|keyof typeof google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel); + + /** SearchJobsRequest customRankingInfo. */ + public customRankingInfo?: (google.cloud.talent.v4.SearchJobsRequest.ICustomRankingInfo|null); + + /** SearchJobsRequest disableKeywordMatch. */ + public disableKeywordMatch: boolean; + + /** SearchJobsRequest keywordMatchMode. */ + public keywordMatchMode: (google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode|keyof typeof google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode); + + /** + * Creates a new SearchJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchJobsRequest instance + */ + public static create(properties?: google.cloud.talent.v4.ISearchJobsRequest): google.cloud.talent.v4.SearchJobsRequest; + + /** + * Encodes the specified SearchJobsRequest message. Does not implicitly {@link google.cloud.talent.v4.SearchJobsRequest.verify|verify} messages. + * @param message SearchJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.ISearchJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchJobsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.SearchJobsRequest.verify|verify} messages. + * @param message SearchJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.ISearchJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.SearchJobsRequest; + + /** + * Decodes a SearchJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.SearchJobsRequest; + + /** + * Verifies a SearchJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.SearchJobsRequest; + + /** + * Creates a plain object from a SearchJobsRequest message. Also converts values to other types if specified. + * @param message SearchJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.SearchJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SearchJobsRequest { + + /** SearchMode enum. */ + enum SearchMode { + SEARCH_MODE_UNSPECIFIED = 0, + JOB_SEARCH = 1, + FEATURED_JOB_SEARCH = 2 + } + + /** DiversificationLevel enum. */ + enum DiversificationLevel { + DIVERSIFICATION_LEVEL_UNSPECIFIED = 0, + DISABLED = 1, + SIMPLE = 2, + ONE_PER_COMPANY = 3, + TWO_PER_COMPANY = 4, + DIVERSIFY_BY_LOOSER_SIMILARITY = 5 + } + + /** KeywordMatchMode enum. */ + enum KeywordMatchMode { + KEYWORD_MATCH_MODE_UNSPECIFIED = 0, + KEYWORD_MATCH_DISABLED = 1, + KEYWORD_MATCH_ALL = 2, + KEYWORD_MATCH_TITLE_ONLY = 3 + } + + /** Properties of a CustomRankingInfo. */ + interface ICustomRankingInfo { + + /** CustomRankingInfo importanceLevel */ + importanceLevel?: (google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ImportanceLevel|keyof typeof google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ImportanceLevel|null); + + /** CustomRankingInfo rankingExpression */ + rankingExpression?: (string|null); + } + + /** Represents a CustomRankingInfo. */ + class CustomRankingInfo implements ICustomRankingInfo { + + /** + * Constructs a new CustomRankingInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.SearchJobsRequest.ICustomRankingInfo); + + /** CustomRankingInfo importanceLevel. */ + public importanceLevel: (google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ImportanceLevel|keyof typeof google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ImportanceLevel); + + /** CustomRankingInfo rankingExpression. */ + public rankingExpression: string; + + /** + * Creates a new CustomRankingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomRankingInfo instance + */ + public static create(properties?: google.cloud.talent.v4.SearchJobsRequest.ICustomRankingInfo): google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo; + + /** + * Encodes the specified CustomRankingInfo message. Does not implicitly {@link google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.verify|verify} messages. + * @param message CustomRankingInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.SearchJobsRequest.ICustomRankingInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomRankingInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.verify|verify} messages. + * @param message CustomRankingInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.SearchJobsRequest.ICustomRankingInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomRankingInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomRankingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo; + + /** + * Decodes a CustomRankingInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomRankingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo; + + /** + * Verifies a CustomRankingInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomRankingInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomRankingInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo; + + /** + * Creates a plain object from a CustomRankingInfo message. Also converts values to other types if specified. + * @param message CustomRankingInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomRankingInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomRankingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CustomRankingInfo { + + /** ImportanceLevel enum. */ + enum ImportanceLevel { + IMPORTANCE_LEVEL_UNSPECIFIED = 0, + NONE = 1, + LOW = 2, + MILD = 3, + MEDIUM = 4, + HIGH = 5, + EXTREME = 6 + } + } + } + + /** Properties of a SearchJobsResponse. */ + interface ISearchJobsResponse { + + /** SearchJobsResponse matchingJobs */ + matchingJobs?: (google.cloud.talent.v4.SearchJobsResponse.IMatchingJob[]|null); + + /** SearchJobsResponse histogramQueryResults */ + histogramQueryResults?: (google.cloud.talent.v4.IHistogramQueryResult[]|null); + + /** SearchJobsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** SearchJobsResponse locationFilters */ + locationFilters?: (google.cloud.talent.v4.ILocation[]|null); + + /** SearchJobsResponse totalSize */ + totalSize?: (number|null); + + /** SearchJobsResponse metadata */ + metadata?: (google.cloud.talent.v4.IResponseMetadata|null); + + /** SearchJobsResponse broadenedQueryJobsCount */ + broadenedQueryJobsCount?: (number|null); + + /** SearchJobsResponse spellCorrection */ + spellCorrection?: (google.cloud.talent.v4.ISpellingCorrection|null); + } + + /** Represents a SearchJobsResponse. */ + class SearchJobsResponse implements ISearchJobsResponse { + + /** + * Constructs a new SearchJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.ISearchJobsResponse); + + /** SearchJobsResponse matchingJobs. */ + public matchingJobs: google.cloud.talent.v4.SearchJobsResponse.IMatchingJob[]; + + /** SearchJobsResponse histogramQueryResults. */ + public histogramQueryResults: google.cloud.talent.v4.IHistogramQueryResult[]; + + /** SearchJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** SearchJobsResponse locationFilters. */ + public locationFilters: google.cloud.talent.v4.ILocation[]; + + /** SearchJobsResponse totalSize. */ + public totalSize: number; + + /** SearchJobsResponse metadata. */ + public metadata?: (google.cloud.talent.v4.IResponseMetadata|null); + + /** SearchJobsResponse broadenedQueryJobsCount. */ + public broadenedQueryJobsCount: number; + + /** SearchJobsResponse spellCorrection. */ + public spellCorrection?: (google.cloud.talent.v4.ISpellingCorrection|null); + + /** + * Creates a new SearchJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchJobsResponse instance + */ + public static create(properties?: google.cloud.talent.v4.ISearchJobsResponse): google.cloud.talent.v4.SearchJobsResponse; + + /** + * Encodes the specified SearchJobsResponse message. Does not implicitly {@link google.cloud.talent.v4.SearchJobsResponse.verify|verify} messages. + * @param message SearchJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.ISearchJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchJobsResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4.SearchJobsResponse.verify|verify} messages. + * @param message SearchJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.ISearchJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.SearchJobsResponse; + + /** + * Decodes a SearchJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.SearchJobsResponse; + + /** + * Verifies a SearchJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.SearchJobsResponse; + + /** + * Creates a plain object from a SearchJobsResponse message. Also converts values to other types if specified. + * @param message SearchJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.SearchJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SearchJobsResponse { + + /** Properties of a MatchingJob. */ + interface IMatchingJob { + + /** MatchingJob job */ + job?: (google.cloud.talent.v4.IJob|null); + + /** MatchingJob jobSummary */ + jobSummary?: (string|null); + + /** MatchingJob jobTitleSnippet */ + jobTitleSnippet?: (string|null); + + /** MatchingJob searchTextSnippet */ + searchTextSnippet?: (string|null); + + /** MatchingJob commuteInfo */ + commuteInfo?: (google.cloud.talent.v4.SearchJobsResponse.ICommuteInfo|null); + } + + /** Represents a MatchingJob. */ + class MatchingJob implements IMatchingJob { + + /** + * Constructs a new MatchingJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.SearchJobsResponse.IMatchingJob); + + /** MatchingJob job. */ + public job?: (google.cloud.talent.v4.IJob|null); + + /** MatchingJob jobSummary. */ + public jobSummary: string; + + /** MatchingJob jobTitleSnippet. */ + public jobTitleSnippet: string; + + /** MatchingJob searchTextSnippet. */ + public searchTextSnippet: string; + + /** MatchingJob commuteInfo. */ + public commuteInfo?: (google.cloud.talent.v4.SearchJobsResponse.ICommuteInfo|null); + + /** + * Creates a new MatchingJob instance using the specified properties. + * @param [properties] Properties to set + * @returns MatchingJob instance + */ + public static create(properties?: google.cloud.talent.v4.SearchJobsResponse.IMatchingJob): google.cloud.talent.v4.SearchJobsResponse.MatchingJob; + + /** + * Encodes the specified MatchingJob message. Does not implicitly {@link google.cloud.talent.v4.SearchJobsResponse.MatchingJob.verify|verify} messages. + * @param message MatchingJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.SearchJobsResponse.IMatchingJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MatchingJob message, length delimited. Does not implicitly {@link google.cloud.talent.v4.SearchJobsResponse.MatchingJob.verify|verify} messages. + * @param message MatchingJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.SearchJobsResponse.IMatchingJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MatchingJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MatchingJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.SearchJobsResponse.MatchingJob; + + /** + * Decodes a MatchingJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MatchingJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.SearchJobsResponse.MatchingJob; + + /** + * Verifies a MatchingJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MatchingJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MatchingJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.SearchJobsResponse.MatchingJob; + + /** + * Creates a plain object from a MatchingJob message. Also converts values to other types if specified. + * @param message MatchingJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.SearchJobsResponse.MatchingJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MatchingJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MatchingJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommuteInfo. */ + interface ICommuteInfo { + + /** CommuteInfo jobLocation */ + jobLocation?: (google.cloud.talent.v4.ILocation|null); + + /** CommuteInfo travelDuration */ + travelDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a CommuteInfo. */ + class CommuteInfo implements ICommuteInfo { + + /** + * Constructs a new CommuteInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.SearchJobsResponse.ICommuteInfo); + + /** CommuteInfo jobLocation. */ + public jobLocation?: (google.cloud.talent.v4.ILocation|null); + + /** CommuteInfo travelDuration. */ + public travelDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new CommuteInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns CommuteInfo instance + */ + public static create(properties?: google.cloud.talent.v4.SearchJobsResponse.ICommuteInfo): google.cloud.talent.v4.SearchJobsResponse.CommuteInfo; + + /** + * Encodes the specified CommuteInfo message. Does not implicitly {@link google.cloud.talent.v4.SearchJobsResponse.CommuteInfo.verify|verify} messages. + * @param message CommuteInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.SearchJobsResponse.ICommuteInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommuteInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4.SearchJobsResponse.CommuteInfo.verify|verify} messages. + * @param message CommuteInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.SearchJobsResponse.ICommuteInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommuteInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommuteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.SearchJobsResponse.CommuteInfo; + + /** + * Decodes a CommuteInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommuteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.SearchJobsResponse.CommuteInfo; + + /** + * Verifies a CommuteInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommuteInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommuteInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.SearchJobsResponse.CommuteInfo; + + /** + * Creates a plain object from a CommuteInfo message. Also converts values to other types if specified. + * @param message CommuteInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.SearchJobsResponse.CommuteInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommuteInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommuteInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a BatchCreateJobsRequest. */ + interface IBatchCreateJobsRequest { + + /** BatchCreateJobsRequest parent */ + parent?: (string|null); + + /** BatchCreateJobsRequest jobs */ + jobs?: (google.cloud.talent.v4.IJob[]|null); + } + + /** Represents a BatchCreateJobsRequest. */ + class BatchCreateJobsRequest implements IBatchCreateJobsRequest { + + /** + * Constructs a new BatchCreateJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IBatchCreateJobsRequest); + + /** BatchCreateJobsRequest parent. */ + public parent: string; + + /** BatchCreateJobsRequest jobs. */ + public jobs: google.cloud.talent.v4.IJob[]; + + /** + * Creates a new BatchCreateJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateJobsRequest instance + */ + public static create(properties?: google.cloud.talent.v4.IBatchCreateJobsRequest): google.cloud.talent.v4.BatchCreateJobsRequest; + + /** + * Encodes the specified BatchCreateJobsRequest message. Does not implicitly {@link google.cloud.talent.v4.BatchCreateJobsRequest.verify|verify} messages. + * @param message BatchCreateJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IBatchCreateJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateJobsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.BatchCreateJobsRequest.verify|verify} messages. + * @param message BatchCreateJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IBatchCreateJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.BatchCreateJobsRequest; + + /** + * Decodes a BatchCreateJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.BatchCreateJobsRequest; + + /** + * Verifies a BatchCreateJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.BatchCreateJobsRequest; + + /** + * Creates a plain object from a BatchCreateJobsRequest message. Also converts values to other types if specified. + * @param message BatchCreateJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.BatchCreateJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchUpdateJobsRequest. */ + interface IBatchUpdateJobsRequest { + + /** BatchUpdateJobsRequest parent */ + parent?: (string|null); + + /** BatchUpdateJobsRequest jobs */ + jobs?: (google.cloud.talent.v4.IJob[]|null); + + /** BatchUpdateJobsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a BatchUpdateJobsRequest. */ + class BatchUpdateJobsRequest implements IBatchUpdateJobsRequest { + + /** + * Constructs a new BatchUpdateJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IBatchUpdateJobsRequest); + + /** BatchUpdateJobsRequest parent. */ + public parent: string; + + /** BatchUpdateJobsRequest jobs. */ + public jobs: google.cloud.talent.v4.IJob[]; + + /** BatchUpdateJobsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new BatchUpdateJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchUpdateJobsRequest instance + */ + public static create(properties?: google.cloud.talent.v4.IBatchUpdateJobsRequest): google.cloud.talent.v4.BatchUpdateJobsRequest; + + /** + * Encodes the specified BatchUpdateJobsRequest message. Does not implicitly {@link google.cloud.talent.v4.BatchUpdateJobsRequest.verify|verify} messages. + * @param message BatchUpdateJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IBatchUpdateJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchUpdateJobsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.BatchUpdateJobsRequest.verify|verify} messages. + * @param message BatchUpdateJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IBatchUpdateJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchUpdateJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchUpdateJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.BatchUpdateJobsRequest; + + /** + * Decodes a BatchUpdateJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchUpdateJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.BatchUpdateJobsRequest; + + /** + * Verifies a BatchUpdateJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchUpdateJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchUpdateJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.BatchUpdateJobsRequest; + + /** + * Creates a plain object from a BatchUpdateJobsRequest message. Also converts values to other types if specified. + * @param message BatchUpdateJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.BatchUpdateJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchUpdateJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchUpdateJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDeleteJobsRequest. */ + interface IBatchDeleteJobsRequest { + + /** BatchDeleteJobsRequest parent */ + parent?: (string|null); + + /** BatchDeleteJobsRequest names */ + names?: (string[]|null); + } + + /** Represents a BatchDeleteJobsRequest. */ + class BatchDeleteJobsRequest implements IBatchDeleteJobsRequest { + + /** + * Constructs a new BatchDeleteJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IBatchDeleteJobsRequest); + + /** BatchDeleteJobsRequest parent. */ + public parent: string; + + /** BatchDeleteJobsRequest names. */ + public names: string[]; + + /** + * Creates a new BatchDeleteJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteJobsRequest instance + */ + public static create(properties?: google.cloud.talent.v4.IBatchDeleteJobsRequest): google.cloud.talent.v4.BatchDeleteJobsRequest; + + /** + * Encodes the specified BatchDeleteJobsRequest message. Does not implicitly {@link google.cloud.talent.v4.BatchDeleteJobsRequest.verify|verify} messages. + * @param message BatchDeleteJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IBatchDeleteJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDeleteJobsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.BatchDeleteJobsRequest.verify|verify} messages. + * @param message BatchDeleteJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IBatchDeleteJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDeleteJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.BatchDeleteJobsRequest; + + /** + * Decodes a BatchDeleteJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.BatchDeleteJobsRequest; + + /** + * Verifies a BatchDeleteJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDeleteJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.BatchDeleteJobsRequest; + + /** + * Creates a plain object from a BatchDeleteJobsRequest message. Also converts values to other types if specified. + * @param message BatchDeleteJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.BatchDeleteJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDeleteJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDeleteJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobResult. */ + interface IJobResult { + + /** JobResult job */ + job?: (google.cloud.talent.v4.IJob|null); + + /** JobResult status */ + status?: (google.rpc.IStatus|null); + } + + /** Represents a JobResult. */ + class JobResult implements IJobResult { + + /** + * Constructs a new JobResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IJobResult); + + /** JobResult job. */ + public job?: (google.cloud.talent.v4.IJob|null); + + /** JobResult status. */ + public status?: (google.rpc.IStatus|null); + + /** + * Creates a new JobResult instance using the specified properties. + * @param [properties] Properties to set + * @returns JobResult instance + */ + public static create(properties?: google.cloud.talent.v4.IJobResult): google.cloud.talent.v4.JobResult; + + /** + * Encodes the specified JobResult message. Does not implicitly {@link google.cloud.talent.v4.JobResult.verify|verify} messages. + * @param message JobResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IJobResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobResult message, length delimited. Does not implicitly {@link google.cloud.talent.v4.JobResult.verify|verify} messages. + * @param message JobResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IJobResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.JobResult; + + /** + * Decodes a JobResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.JobResult; + + /** + * Verifies a JobResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.JobResult; + + /** + * Creates a plain object from a JobResult message. Also converts values to other types if specified. + * @param message JobResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.JobResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateJobsResponse. */ + interface IBatchCreateJobsResponse { + + /** BatchCreateJobsResponse jobResults */ + jobResults?: (google.cloud.talent.v4.IJobResult[]|null); + } + + /** Represents a BatchCreateJobsResponse. */ + class BatchCreateJobsResponse implements IBatchCreateJobsResponse { + + /** + * Constructs a new BatchCreateJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IBatchCreateJobsResponse); + + /** BatchCreateJobsResponse jobResults. */ + public jobResults: google.cloud.talent.v4.IJobResult[]; + + /** + * Creates a new BatchCreateJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateJobsResponse instance + */ + public static create(properties?: google.cloud.talent.v4.IBatchCreateJobsResponse): google.cloud.talent.v4.BatchCreateJobsResponse; + + /** + * Encodes the specified BatchCreateJobsResponse message. Does not implicitly {@link google.cloud.talent.v4.BatchCreateJobsResponse.verify|verify} messages. + * @param message BatchCreateJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IBatchCreateJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateJobsResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4.BatchCreateJobsResponse.verify|verify} messages. + * @param message BatchCreateJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IBatchCreateJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.BatchCreateJobsResponse; + + /** + * Decodes a BatchCreateJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.BatchCreateJobsResponse; + + /** + * Verifies a BatchCreateJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.BatchCreateJobsResponse; + + /** + * Creates a plain object from a BatchCreateJobsResponse message. Also converts values to other types if specified. + * @param message BatchCreateJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.BatchCreateJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchUpdateJobsResponse. */ + interface IBatchUpdateJobsResponse { + + /** BatchUpdateJobsResponse jobResults */ + jobResults?: (google.cloud.talent.v4.IJobResult[]|null); + } + + /** Represents a BatchUpdateJobsResponse. */ + class BatchUpdateJobsResponse implements IBatchUpdateJobsResponse { + + /** + * Constructs a new BatchUpdateJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IBatchUpdateJobsResponse); + + /** BatchUpdateJobsResponse jobResults. */ + public jobResults: google.cloud.talent.v4.IJobResult[]; + + /** + * Creates a new BatchUpdateJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchUpdateJobsResponse instance + */ + public static create(properties?: google.cloud.talent.v4.IBatchUpdateJobsResponse): google.cloud.talent.v4.BatchUpdateJobsResponse; + + /** + * Encodes the specified BatchUpdateJobsResponse message. Does not implicitly {@link google.cloud.talent.v4.BatchUpdateJobsResponse.verify|verify} messages. + * @param message BatchUpdateJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IBatchUpdateJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchUpdateJobsResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4.BatchUpdateJobsResponse.verify|verify} messages. + * @param message BatchUpdateJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IBatchUpdateJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchUpdateJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchUpdateJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.BatchUpdateJobsResponse; + + /** + * Decodes a BatchUpdateJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchUpdateJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.BatchUpdateJobsResponse; + + /** + * Verifies a BatchUpdateJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchUpdateJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchUpdateJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.BatchUpdateJobsResponse; + + /** + * Creates a plain object from a BatchUpdateJobsResponse message. Also converts values to other types if specified. + * @param message BatchUpdateJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.BatchUpdateJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchUpdateJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchUpdateJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDeleteJobsResponse. */ + interface IBatchDeleteJobsResponse { + + /** BatchDeleteJobsResponse jobResults */ + jobResults?: (google.cloud.talent.v4.IJobResult[]|null); + } + + /** Represents a BatchDeleteJobsResponse. */ + class BatchDeleteJobsResponse implements IBatchDeleteJobsResponse { + + /** + * Constructs a new BatchDeleteJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IBatchDeleteJobsResponse); + + /** BatchDeleteJobsResponse jobResults. */ + public jobResults: google.cloud.talent.v4.IJobResult[]; + + /** + * Creates a new BatchDeleteJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteJobsResponse instance + */ + public static create(properties?: google.cloud.talent.v4.IBatchDeleteJobsResponse): google.cloud.talent.v4.BatchDeleteJobsResponse; + + /** + * Encodes the specified BatchDeleteJobsResponse message. Does not implicitly {@link google.cloud.talent.v4.BatchDeleteJobsResponse.verify|verify} messages. + * @param message BatchDeleteJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IBatchDeleteJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDeleteJobsResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4.BatchDeleteJobsResponse.verify|verify} messages. + * @param message BatchDeleteJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IBatchDeleteJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDeleteJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.BatchDeleteJobsResponse; + + /** + * Decodes a BatchDeleteJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.BatchDeleteJobsResponse; + + /** + * Verifies a BatchDeleteJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDeleteJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.BatchDeleteJobsResponse; + + /** + * Creates a plain object from a BatchDeleteJobsResponse message. Also converts values to other types if specified. + * @param message BatchDeleteJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.BatchDeleteJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDeleteJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDeleteJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Tenant. */ + interface ITenant { + + /** Tenant name */ + name?: (string|null); + + /** Tenant externalId */ + externalId?: (string|null); + } + + /** Represents a Tenant. */ + class Tenant implements ITenant { + + /** + * Constructs a new Tenant. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.ITenant); + + /** Tenant name. */ + public name: string; + + /** Tenant externalId. */ + public externalId: string; + + /** + * Creates a new Tenant instance using the specified properties. + * @param [properties] Properties to set + * @returns Tenant instance + */ + public static create(properties?: google.cloud.talent.v4.ITenant): google.cloud.talent.v4.Tenant; + + /** + * Encodes the specified Tenant message. Does not implicitly {@link google.cloud.talent.v4.Tenant.verify|verify} messages. + * @param message Tenant message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.ITenant, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Tenant message, length delimited. Does not implicitly {@link google.cloud.talent.v4.Tenant.verify|verify} messages. + * @param message Tenant message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.ITenant, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Tenant message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Tenant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.Tenant; + + /** + * Decodes a Tenant message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Tenant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.Tenant; + + /** + * Verifies a Tenant message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Tenant message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Tenant + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.Tenant; + + /** + * Creates a plain object from a Tenant message. Also converts values to other types if specified. + * @param message Tenant + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.Tenant, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Tenant to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Tenant + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a TenantService */ + class TenantService extends $protobuf.rpc.Service { + + /** + * Constructs a new TenantService 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 TenantService 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): TenantService; + + /** + * Calls CreateTenant. + * @param request CreateTenantRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tenant + */ + public createTenant(request: google.cloud.talent.v4.ICreateTenantRequest, callback: google.cloud.talent.v4.TenantService.CreateTenantCallback): void; + + /** + * Calls CreateTenant. + * @param request CreateTenantRequest message or plain object + * @returns Promise + */ + public createTenant(request: google.cloud.talent.v4.ICreateTenantRequest): Promise; + + /** + * Calls GetTenant. + * @param request GetTenantRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tenant + */ + public getTenant(request: google.cloud.talent.v4.IGetTenantRequest, callback: google.cloud.talent.v4.TenantService.GetTenantCallback): void; + + /** + * Calls GetTenant. + * @param request GetTenantRequest message or plain object + * @returns Promise + */ + public getTenant(request: google.cloud.talent.v4.IGetTenantRequest): Promise; + + /** + * Calls UpdateTenant. + * @param request UpdateTenantRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tenant + */ + public updateTenant(request: google.cloud.talent.v4.IUpdateTenantRequest, callback: google.cloud.talent.v4.TenantService.UpdateTenantCallback): void; + + /** + * Calls UpdateTenant. + * @param request UpdateTenantRequest message or plain object + * @returns Promise + */ + public updateTenant(request: google.cloud.talent.v4.IUpdateTenantRequest): Promise; + + /** + * Calls DeleteTenant. + * @param request DeleteTenantRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTenant(request: google.cloud.talent.v4.IDeleteTenantRequest, callback: google.cloud.talent.v4.TenantService.DeleteTenantCallback): void; + + /** + * Calls DeleteTenant. + * @param request DeleteTenantRequest message or plain object + * @returns Promise + */ + public deleteTenant(request: google.cloud.talent.v4.IDeleteTenantRequest): Promise; + + /** + * Calls ListTenants. + * @param request ListTenantsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTenantsResponse + */ + public listTenants(request: google.cloud.talent.v4.IListTenantsRequest, callback: google.cloud.talent.v4.TenantService.ListTenantsCallback): void; + + /** + * Calls ListTenants. + * @param request ListTenantsRequest message or plain object + * @returns Promise + */ + public listTenants(request: google.cloud.talent.v4.IListTenantsRequest): Promise; + } + + namespace TenantService { + + /** + * Callback as used by {@link google.cloud.talent.v4.TenantService|createTenant}. + * @param error Error, if any + * @param [response] Tenant + */ + type CreateTenantCallback = (error: (Error|null), response?: google.cloud.talent.v4.Tenant) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4.TenantService|getTenant}. + * @param error Error, if any + * @param [response] Tenant + */ + type GetTenantCallback = (error: (Error|null), response?: google.cloud.talent.v4.Tenant) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4.TenantService|updateTenant}. + * @param error Error, if any + * @param [response] Tenant + */ + type UpdateTenantCallback = (error: (Error|null), response?: google.cloud.talent.v4.Tenant) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4.TenantService|deleteTenant}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteTenantCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4.TenantService|listTenants}. + * @param error Error, if any + * @param [response] ListTenantsResponse + */ + type ListTenantsCallback = (error: (Error|null), response?: google.cloud.talent.v4.ListTenantsResponse) => void; + } + + /** Properties of a CreateTenantRequest. */ + interface ICreateTenantRequest { + + /** CreateTenantRequest parent */ + parent?: (string|null); + + /** CreateTenantRequest tenant */ + tenant?: (google.cloud.talent.v4.ITenant|null); + } + + /** Represents a CreateTenantRequest. */ + class CreateTenantRequest implements ICreateTenantRequest { + + /** + * Constructs a new CreateTenantRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.ICreateTenantRequest); + + /** CreateTenantRequest parent. */ + public parent: string; + + /** CreateTenantRequest tenant. */ + public tenant?: (google.cloud.talent.v4.ITenant|null); + + /** + * Creates a new CreateTenantRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTenantRequest instance + */ + public static create(properties?: google.cloud.talent.v4.ICreateTenantRequest): google.cloud.talent.v4.CreateTenantRequest; + + /** + * Encodes the specified CreateTenantRequest message. Does not implicitly {@link google.cloud.talent.v4.CreateTenantRequest.verify|verify} messages. + * @param message CreateTenantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.ICreateTenantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTenantRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CreateTenantRequest.verify|verify} messages. + * @param message CreateTenantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.ICreateTenantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTenantRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.CreateTenantRequest; + + /** + * Decodes a CreateTenantRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.CreateTenantRequest; + + /** + * Verifies a CreateTenantRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTenantRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTenantRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.CreateTenantRequest; + + /** + * Creates a plain object from a CreateTenantRequest message. Also converts values to other types if specified. + * @param message CreateTenantRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.CreateTenantRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTenantRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTenantRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTenantRequest. */ + interface IGetTenantRequest { + + /** GetTenantRequest name */ + name?: (string|null); + } + + /** Represents a GetTenantRequest. */ + class GetTenantRequest implements IGetTenantRequest { + + /** + * Constructs a new GetTenantRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IGetTenantRequest); + + /** GetTenantRequest name. */ + public name: string; + + /** + * Creates a new GetTenantRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTenantRequest instance + */ + public static create(properties?: google.cloud.talent.v4.IGetTenantRequest): google.cloud.talent.v4.GetTenantRequest; + + /** + * Encodes the specified GetTenantRequest message. Does not implicitly {@link google.cloud.talent.v4.GetTenantRequest.verify|verify} messages. + * @param message GetTenantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IGetTenantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTenantRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.GetTenantRequest.verify|verify} messages. + * @param message GetTenantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IGetTenantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTenantRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.GetTenantRequest; + + /** + * Decodes a GetTenantRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.GetTenantRequest; + + /** + * Verifies a GetTenantRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTenantRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTenantRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.GetTenantRequest; + + /** + * Creates a plain object from a GetTenantRequest message. Also converts values to other types if specified. + * @param message GetTenantRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.GetTenantRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTenantRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTenantRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTenantRequest. */ + interface IUpdateTenantRequest { + + /** UpdateTenantRequest tenant */ + tenant?: (google.cloud.talent.v4.ITenant|null); + + /** UpdateTenantRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateTenantRequest. */ + class UpdateTenantRequest implements IUpdateTenantRequest { + + /** + * Constructs a new UpdateTenantRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IUpdateTenantRequest); + + /** UpdateTenantRequest tenant. */ + public tenant?: (google.cloud.talent.v4.ITenant|null); + + /** UpdateTenantRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateTenantRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTenantRequest instance + */ + public static create(properties?: google.cloud.talent.v4.IUpdateTenantRequest): google.cloud.talent.v4.UpdateTenantRequest; + + /** + * Encodes the specified UpdateTenantRequest message. Does not implicitly {@link google.cloud.talent.v4.UpdateTenantRequest.verify|verify} messages. + * @param message UpdateTenantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IUpdateTenantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTenantRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.UpdateTenantRequest.verify|verify} messages. + * @param message UpdateTenantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IUpdateTenantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTenantRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.UpdateTenantRequest; + + /** + * Decodes an UpdateTenantRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.UpdateTenantRequest; + + /** + * Verifies an UpdateTenantRequest message. + * @param message Plain 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 UpdateTenantRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTenantRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.UpdateTenantRequest; + + /** + * Creates a plain object from an UpdateTenantRequest message. Also converts values to other types if specified. + * @param message UpdateTenantRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.UpdateTenantRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTenantRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTenantRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTenantRequest. */ + interface IDeleteTenantRequest { + + /** DeleteTenantRequest name */ + name?: (string|null); + } + + /** Represents a DeleteTenantRequest. */ + class DeleteTenantRequest implements IDeleteTenantRequest { + + /** + * Constructs a new DeleteTenantRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IDeleteTenantRequest); + + /** DeleteTenantRequest name. */ + public name: string; + + /** + * Creates a new DeleteTenantRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTenantRequest instance + */ + public static create(properties?: google.cloud.talent.v4.IDeleteTenantRequest): google.cloud.talent.v4.DeleteTenantRequest; + + /** + * Encodes the specified DeleteTenantRequest message. Does not implicitly {@link google.cloud.talent.v4.DeleteTenantRequest.verify|verify} messages. + * @param message DeleteTenantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IDeleteTenantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTenantRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.DeleteTenantRequest.verify|verify} messages. + * @param message DeleteTenantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IDeleteTenantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTenantRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.DeleteTenantRequest; + + /** + * Decodes a DeleteTenantRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.DeleteTenantRequest; + + /** + * Verifies a DeleteTenantRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTenantRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTenantRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.DeleteTenantRequest; + + /** + * Creates a plain object from a DeleteTenantRequest message. Also converts values to other types if specified. + * @param message DeleteTenantRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.DeleteTenantRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTenantRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTenantRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTenantsRequest. */ + interface IListTenantsRequest { + + /** ListTenantsRequest parent */ + parent?: (string|null); + + /** ListTenantsRequest pageToken */ + pageToken?: (string|null); + + /** ListTenantsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListTenantsRequest. */ + class ListTenantsRequest implements IListTenantsRequest { + + /** + * Constructs a new ListTenantsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IListTenantsRequest); + + /** ListTenantsRequest parent. */ + public parent: string; + + /** ListTenantsRequest pageToken. */ + public pageToken: string; + + /** ListTenantsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListTenantsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTenantsRequest instance + */ + public static create(properties?: google.cloud.talent.v4.IListTenantsRequest): google.cloud.talent.v4.ListTenantsRequest; + + /** + * Encodes the specified ListTenantsRequest message. Does not implicitly {@link google.cloud.talent.v4.ListTenantsRequest.verify|verify} messages. + * @param message ListTenantsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IListTenantsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTenantsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.ListTenantsRequest.verify|verify} messages. + * @param message ListTenantsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IListTenantsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTenantsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTenantsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.ListTenantsRequest; + + /** + * Decodes a ListTenantsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTenantsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.ListTenantsRequest; + + /** + * Verifies a ListTenantsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTenantsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTenantsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.ListTenantsRequest; + + /** + * Creates a plain object from a ListTenantsRequest message. Also converts values to other types if specified. + * @param message ListTenantsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.ListTenantsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTenantsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTenantsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTenantsResponse. */ + interface IListTenantsResponse { + + /** ListTenantsResponse tenants */ + tenants?: (google.cloud.talent.v4.ITenant[]|null); + + /** ListTenantsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListTenantsResponse metadata */ + metadata?: (google.cloud.talent.v4.IResponseMetadata|null); + } + + /** Represents a ListTenantsResponse. */ + class ListTenantsResponse implements IListTenantsResponse { + + /** + * Constructs a new ListTenantsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4.IListTenantsResponse); + + /** ListTenantsResponse tenants. */ + public tenants: google.cloud.talent.v4.ITenant[]; + + /** ListTenantsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListTenantsResponse metadata. */ + public metadata?: (google.cloud.talent.v4.IResponseMetadata|null); + + /** + * Creates a new ListTenantsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTenantsResponse instance + */ + public static create(properties?: google.cloud.talent.v4.IListTenantsResponse): google.cloud.talent.v4.ListTenantsResponse; + + /** + * Encodes the specified ListTenantsResponse message. Does not implicitly {@link google.cloud.talent.v4.ListTenantsResponse.verify|verify} messages. + * @param message ListTenantsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4.IListTenantsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTenantsResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4.ListTenantsResponse.verify|verify} messages. + * @param message ListTenantsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4.IListTenantsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTenantsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTenantsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4.ListTenantsResponse; + + /** + * Decodes a ListTenantsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTenantsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4.ListTenantsResponse; + + /** + * Verifies a ListTenantsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTenantsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTenantsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4.ListTenantsResponse; + + /** + * Creates a plain object from a ListTenantsResponse message. Also converts values to other types if specified. + * @param message ListTenantsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4.ListTenantsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTenantsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTenantsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace v4beta1. */ + namespace v4beta1 { + + /** Properties of a TimestampRange. */ + interface ITimestampRange { + + /** TimestampRange startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimestampRange endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TimestampRange. */ + class TimestampRange implements ITimestampRange { + + /** + * Constructs a new TimestampRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.ITimestampRange); + + /** TimestampRange startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TimestampRange endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TimestampRange instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampRange instance + */ + public static create(properties?: google.cloud.talent.v4beta1.ITimestampRange): google.cloud.talent.v4beta1.TimestampRange; + + /** + * Encodes the specified TimestampRange message. Does not implicitly {@link google.cloud.talent.v4beta1.TimestampRange.verify|verify} messages. + * @param message TimestampRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.ITimestampRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimestampRange message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.TimestampRange.verify|verify} messages. + * @param message TimestampRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.ITimestampRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimestampRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.TimestampRange; + + /** + * Decodes a TimestampRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimestampRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.TimestampRange; + + /** + * Verifies a TimestampRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimestampRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimestampRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.TimestampRange; + + /** + * Creates a plain object from a TimestampRange message. Also converts values to other types if specified. + * @param message TimestampRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.TimestampRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimestampRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimestampRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** CompanySize enum. */ + enum CompanySize { + COMPANY_SIZE_UNSPECIFIED = 0, + MINI = 1, + SMALL = 2, + SMEDIUM = 3, + MEDIUM = 4, + BIG = 5, + BIGGER = 6, + GIANT = 7 + } + + /** JobBenefit enum. */ + enum JobBenefit { + JOB_BENEFIT_UNSPECIFIED = 0, + CHILD_CARE = 1, + DENTAL = 2, + DOMESTIC_PARTNER = 3, + FLEXIBLE_HOURS = 4, + MEDICAL = 5, + LIFE_INSURANCE = 6, + PARENTAL_LEAVE = 7, + RETIREMENT_PLAN = 8, + SICK_DAYS = 9, + VACATION = 10, + VISION = 11 + } + + /** DegreeType enum. */ + enum DegreeType { + DEGREE_TYPE_UNSPECIFIED = 0, + PRIMARY_EDUCATION = 1, + LOWER_SECONDARY_EDUCATION = 2, + UPPER_SECONDARY_EDUCATION = 3, + ADULT_REMEDIAL_EDUCATION = 4, + ASSOCIATES_OR_EQUIVALENT = 5, + BACHELORS_OR_EQUIVALENT = 6, + MASTERS_OR_EQUIVALENT = 7, + DOCTORAL_OR_EQUIVALENT = 8 + } + + /** EmploymentType enum. */ + enum EmploymentType { + EMPLOYMENT_TYPE_UNSPECIFIED = 0, + FULL_TIME = 1, + PART_TIME = 2, + CONTRACTOR = 3, + CONTRACT_TO_HIRE = 4, + TEMPORARY = 5, + INTERN = 6, + VOLUNTEER = 7, + PER_DIEM = 8, + FLY_IN_FLY_OUT = 9, + OTHER_EMPLOYMENT_TYPE = 10 + } + + /** JobLevel enum. */ + enum JobLevel { + JOB_LEVEL_UNSPECIFIED = 0, + ENTRY_LEVEL = 1, + EXPERIENCED = 2, + MANAGER = 3, + DIRECTOR = 4, + EXECUTIVE = 5 + } + + /** JobCategory enum. */ + enum JobCategory { + JOB_CATEGORY_UNSPECIFIED = 0, + ACCOUNTING_AND_FINANCE = 1, + ADMINISTRATIVE_AND_OFFICE = 2, + ADVERTISING_AND_MARKETING = 3, + ANIMAL_CARE = 4, + ART_FASHION_AND_DESIGN = 5, + BUSINESS_OPERATIONS = 6, + CLEANING_AND_FACILITIES = 7, + COMPUTER_AND_IT = 8, + CONSTRUCTION = 9, + CUSTOMER_SERVICE = 10, + EDUCATION = 11, + ENTERTAINMENT_AND_TRAVEL = 12, + FARMING_AND_OUTDOORS = 13, + HEALTHCARE = 14, + HUMAN_RESOURCES = 15, + INSTALLATION_MAINTENANCE_AND_REPAIR = 16, + LEGAL = 17, + MANAGEMENT = 18, + MANUFACTURING_AND_WAREHOUSE = 19, + MEDIA_COMMUNICATIONS_AND_WRITING = 20, + OIL_GAS_AND_MINING = 21, + PERSONAL_CARE_AND_SERVICES = 22, + PROTECTIVE_SERVICES = 23, + REAL_ESTATE = 24, + RESTAURANT_AND_HOSPITALITY = 25, + SALES_AND_RETAIL = 26, + SCIENCE_AND_ENGINEERING = 27, + SOCIAL_SERVICES_AND_NON_PROFIT = 28, + SPORTS_FITNESS_AND_RECREATION = 29, + TRANSPORTATION_AND_LOGISTICS = 30 + } + + /** PostingRegion enum. */ + enum PostingRegion { + POSTING_REGION_UNSPECIFIED = 0, + ADMINISTRATIVE_AREA = 1, + NATION = 2, + TELECOMMUTE = 3 + } + + /** Visibility enum. */ + enum Visibility { + VISIBILITY_UNSPECIFIED = 0, + ACCOUNT_ONLY = 1, + SHARED_WITH_GOOGLE = 2, + SHARED_WITH_PUBLIC = 3 + } + + /** HtmlSanitization enum. */ + enum HtmlSanitization { + HTML_SANITIZATION_UNSPECIFIED = 0, + HTML_SANITIZATION_DISABLED = 1, + SIMPLE_FORMATTING_ONLY = 2 + } + + /** CommuteMethod enum. */ + enum CommuteMethod { + COMMUTE_METHOD_UNSPECIFIED = 0, + DRIVING = 1, + TRANSIT = 2, + WALKING = 3, + CYCLING = 4 + } + + /** Properties of a Location. */ + interface ILocation { + + /** Location locationType */ + locationType?: (google.cloud.talent.v4beta1.Location.LocationType|keyof typeof google.cloud.talent.v4beta1.Location.LocationType|null); + + /** Location postalAddress */ + postalAddress?: (google.type.IPostalAddress|null); + + /** Location latLng */ + latLng?: (google.type.ILatLng|null); + + /** Location radiusMiles */ + radiusMiles?: (number|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.ILocation); + + /** Location locationType. */ + public locationType: (google.cloud.talent.v4beta1.Location.LocationType|keyof typeof google.cloud.talent.v4beta1.Location.LocationType); + + /** Location postalAddress. */ + public postalAddress?: (google.type.IPostalAddress|null); + + /** Location latLng. */ + public latLng?: (google.type.ILatLng|null); + + /** Location radiusMiles. */ + public radiusMiles: number; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.cloud.talent.v4beta1.ILocation): google.cloud.talent.v4beta1.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.cloud.talent.v4beta1.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.cloud.talent.v4beta1.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.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.cloud.talent.v4beta1.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.cloud.talent.v4beta1.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.cloud.talent.v4beta1.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.cloud.talent.v4beta1.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.cloud.talent.v4beta1.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; + } + + namespace Location { + + /** LocationType enum. */ + enum LocationType { + LOCATION_TYPE_UNSPECIFIED = 0, + COUNTRY = 1, + ADMINISTRATIVE_AREA = 2, + SUB_ADMINISTRATIVE_AREA = 3, + LOCALITY = 4, + POSTAL_CODE = 5, + SUB_LOCALITY = 6, + SUB_LOCALITY_1 = 7, + SUB_LOCALITY_2 = 8, + NEIGHBORHOOD = 9, + STREET_ADDRESS = 10 + } + } + + /** Properties of a RequestMetadata. */ + interface IRequestMetadata { + + /** RequestMetadata domain */ + domain?: (string|null); + + /** RequestMetadata sessionId */ + sessionId?: (string|null); + + /** RequestMetadata userId */ + userId?: (string|null); + + /** RequestMetadata allowMissingIds */ + allowMissingIds?: (boolean|null); + + /** RequestMetadata deviceInfo */ + deviceInfo?: (google.cloud.talent.v4beta1.IDeviceInfo|null); + } + + /** Represents a RequestMetadata. */ + class RequestMetadata implements IRequestMetadata { + + /** + * Constructs a new RequestMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IRequestMetadata); + + /** RequestMetadata domain. */ + public domain: string; + + /** RequestMetadata sessionId. */ + public sessionId: string; + + /** RequestMetadata userId. */ + public userId: string; + + /** RequestMetadata allowMissingIds. */ + public allowMissingIds: boolean; + + /** RequestMetadata deviceInfo. */ + public deviceInfo?: (google.cloud.talent.v4beta1.IDeviceInfo|null); + + /** + * Creates a new RequestMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestMetadata instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IRequestMetadata): google.cloud.talent.v4beta1.RequestMetadata; + + /** + * Encodes the specified RequestMetadata message. Does not implicitly {@link google.cloud.talent.v4beta1.RequestMetadata.verify|verify} messages. + * @param message RequestMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IRequestMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestMetadata message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.RequestMetadata.verify|verify} messages. + * @param message RequestMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IRequestMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.RequestMetadata; + + /** + * Decodes a RequestMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.RequestMetadata; + + /** + * Verifies a RequestMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RequestMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.RequestMetadata; + + /** + * Creates a plain object from a RequestMetadata message. Also converts values to other types if specified. + * @param message RequestMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.RequestMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RequestMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResponseMetadata. */ + interface IResponseMetadata { + + /** ResponseMetadata requestId */ + requestId?: (string|null); + } + + /** Represents a ResponseMetadata. */ + class ResponseMetadata implements IResponseMetadata { + + /** + * Constructs a new ResponseMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IResponseMetadata); + + /** ResponseMetadata requestId. */ + public requestId: string; + + /** + * Creates a new ResponseMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ResponseMetadata instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IResponseMetadata): google.cloud.talent.v4beta1.ResponseMetadata; + + /** + * Encodes the specified ResponseMetadata message. Does not implicitly {@link google.cloud.talent.v4beta1.ResponseMetadata.verify|verify} messages. + * @param message ResponseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IResponseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResponseMetadata message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.ResponseMetadata.verify|verify} messages. + * @param message ResponseMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IResponseMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResponseMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.ResponseMetadata; + + /** + * Decodes a ResponseMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.ResponseMetadata; + + /** + * Verifies a ResponseMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResponseMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResponseMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.ResponseMetadata; + + /** + * Creates a plain object from a ResponseMetadata message. Also converts values to other types if specified. + * @param message ResponseMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.ResponseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResponseMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResponseMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeviceInfo. */ + interface IDeviceInfo { + + /** DeviceInfo deviceType */ + deviceType?: (google.cloud.talent.v4beta1.DeviceInfo.DeviceType|keyof typeof google.cloud.talent.v4beta1.DeviceInfo.DeviceType|null); + + /** DeviceInfo id */ + id?: (string|null); + } + + /** Represents a DeviceInfo. */ + class DeviceInfo implements IDeviceInfo { + + /** + * Constructs a new DeviceInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IDeviceInfo); + + /** DeviceInfo deviceType. */ + public deviceType: (google.cloud.talent.v4beta1.DeviceInfo.DeviceType|keyof typeof google.cloud.talent.v4beta1.DeviceInfo.DeviceType); + + /** DeviceInfo id. */ + public id: string; + + /** + * Creates a new DeviceInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DeviceInfo instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IDeviceInfo): google.cloud.talent.v4beta1.DeviceInfo; + + /** + * Encodes the specified DeviceInfo message. Does not implicitly {@link google.cloud.talent.v4beta1.DeviceInfo.verify|verify} messages. + * @param message DeviceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IDeviceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeviceInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.DeviceInfo.verify|verify} messages. + * @param message DeviceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IDeviceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeviceInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeviceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.DeviceInfo; + + /** + * Decodes a DeviceInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeviceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.DeviceInfo; + + /** + * Verifies a DeviceInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeviceInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeviceInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.DeviceInfo; + + /** + * Creates a plain object from a DeviceInfo message. Also converts values to other types if specified. + * @param message DeviceInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.DeviceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeviceInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeviceInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DeviceInfo { + + /** DeviceType enum. */ + enum DeviceType { + DEVICE_TYPE_UNSPECIFIED = 0, + WEB = 1, + MOBILE_WEB = 2, + ANDROID = 3, + IOS = 4, + BOT = 5, + OTHER = 6 + } + } + + /** Properties of a CustomAttribute. */ + interface ICustomAttribute { + + /** CustomAttribute stringValues */ + stringValues?: (string[]|null); + + /** CustomAttribute longValues */ + longValues?: ((number|Long|string)[]|null); + + /** CustomAttribute filterable */ + filterable?: (boolean|null); + + /** CustomAttribute keywordSearchable */ + keywordSearchable?: (boolean|null); + } + + /** Represents a CustomAttribute. */ + class CustomAttribute implements ICustomAttribute { + + /** + * Constructs a new CustomAttribute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.ICustomAttribute); + + /** CustomAttribute stringValues. */ + public stringValues: string[]; + + /** CustomAttribute longValues. */ + public longValues: (number|Long|string)[]; + + /** CustomAttribute filterable. */ + public filterable: boolean; + + /** CustomAttribute keywordSearchable. */ + public keywordSearchable: boolean; + + /** + * Creates a new CustomAttribute instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomAttribute instance + */ + public static create(properties?: google.cloud.talent.v4beta1.ICustomAttribute): google.cloud.talent.v4beta1.CustomAttribute; + + /** + * Encodes the specified CustomAttribute message. Does not implicitly {@link google.cloud.talent.v4beta1.CustomAttribute.verify|verify} messages. + * @param message CustomAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomAttribute message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CustomAttribute.verify|verify} messages. + * @param message CustomAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomAttribute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.CustomAttribute; + + /** + * Decodes a CustomAttribute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.CustomAttribute; + + /** + * Verifies a CustomAttribute message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomAttribute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomAttribute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.CustomAttribute; + + /** + * Creates a plain object from a CustomAttribute message. Also converts values to other types if specified. + * @param message CustomAttribute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.CustomAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomAttribute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomAttribute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpellingCorrection. */ + interface ISpellingCorrection { + + /** SpellingCorrection corrected */ + corrected?: (boolean|null); + + /** SpellingCorrection correctedText */ + correctedText?: (string|null); + + /** SpellingCorrection correctedHtml */ + correctedHtml?: (string|null); + } + + /** Represents a SpellingCorrection. */ + class SpellingCorrection implements ISpellingCorrection { + + /** + * Constructs a new SpellingCorrection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.ISpellingCorrection); + + /** SpellingCorrection corrected. */ + public corrected: boolean; + + /** SpellingCorrection correctedText. */ + public correctedText: string; + + /** SpellingCorrection correctedHtml. */ + public correctedHtml: string; + + /** + * Creates a new SpellingCorrection instance using the specified properties. + * @param [properties] Properties to set + * @returns SpellingCorrection instance + */ + public static create(properties?: google.cloud.talent.v4beta1.ISpellingCorrection): google.cloud.talent.v4beta1.SpellingCorrection; + + /** + * Encodes the specified SpellingCorrection message. Does not implicitly {@link google.cloud.talent.v4beta1.SpellingCorrection.verify|verify} messages. + * @param message SpellingCorrection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.ISpellingCorrection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpellingCorrection message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.SpellingCorrection.verify|verify} messages. + * @param message SpellingCorrection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.ISpellingCorrection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpellingCorrection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpellingCorrection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.SpellingCorrection; + + /** + * Decodes a SpellingCorrection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpellingCorrection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.SpellingCorrection; + + /** + * Verifies a SpellingCorrection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpellingCorrection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpellingCorrection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.SpellingCorrection; + + /** + * Creates a plain object from a SpellingCorrection message. Also converts values to other types if specified. + * @param message SpellingCorrection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.SpellingCorrection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpellingCorrection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpellingCorrection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CompensationInfo. */ + interface ICompensationInfo { + + /** CompensationInfo entries */ + entries?: (google.cloud.talent.v4beta1.CompensationInfo.ICompensationEntry[]|null); + + /** CompensationInfo annualizedBaseCompensationRange */ + annualizedBaseCompensationRange?: (google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange|null); + + /** CompensationInfo annualizedTotalCompensationRange */ + annualizedTotalCompensationRange?: (google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange|null); + } + + /** Represents a CompensationInfo. */ + class CompensationInfo implements ICompensationInfo { + + /** + * Constructs a new CompensationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.ICompensationInfo); + + /** CompensationInfo entries. */ + public entries: google.cloud.talent.v4beta1.CompensationInfo.ICompensationEntry[]; + + /** CompensationInfo annualizedBaseCompensationRange. */ + public annualizedBaseCompensationRange?: (google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange|null); + + /** CompensationInfo annualizedTotalCompensationRange. */ + public annualizedTotalCompensationRange?: (google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange|null); + + /** + * Creates a new CompensationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns CompensationInfo instance + */ + public static create(properties?: google.cloud.talent.v4beta1.ICompensationInfo): google.cloud.talent.v4beta1.CompensationInfo; + + /** + * Encodes the specified CompensationInfo message. Does not implicitly {@link google.cloud.talent.v4beta1.CompensationInfo.verify|verify} messages. + * @param message CompensationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.ICompensationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompensationInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CompensationInfo.verify|verify} messages. + * @param message CompensationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.ICompensationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompensationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompensationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.CompensationInfo; + + /** + * Decodes a CompensationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompensationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.CompensationInfo; + + /** + * Verifies a CompensationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompensationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompensationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.CompensationInfo; + + /** + * Creates a plain object from a CompensationInfo message. Also converts values to other types if specified. + * @param message CompensationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.CompensationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompensationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompensationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CompensationInfo { + + /** Properties of a CompensationEntry. */ + interface ICompensationEntry { + + /** CompensationEntry type */ + type?: (google.cloud.talent.v4beta1.CompensationInfo.CompensationType|keyof typeof google.cloud.talent.v4beta1.CompensationInfo.CompensationType|null); + + /** CompensationEntry unit */ + unit?: (google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit|keyof typeof google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit|null); + + /** CompensationEntry amount */ + amount?: (google.type.IMoney|null); + + /** CompensationEntry range */ + range?: (google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange|null); + + /** CompensationEntry description */ + description?: (string|null); + + /** CompensationEntry expectedUnitsPerYear */ + expectedUnitsPerYear?: (google.protobuf.IDoubleValue|null); + } + + /** Represents a CompensationEntry. */ + class CompensationEntry implements ICompensationEntry { + + /** + * Constructs a new CompensationEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.CompensationInfo.ICompensationEntry); + + /** CompensationEntry type. */ + public type: (google.cloud.talent.v4beta1.CompensationInfo.CompensationType|keyof typeof google.cloud.talent.v4beta1.CompensationInfo.CompensationType); + + /** CompensationEntry unit. */ + public unit: (google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit|keyof typeof google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit); + + /** CompensationEntry amount. */ + public amount?: (google.type.IMoney|null); + + /** CompensationEntry range. */ + public range?: (google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange|null); + + /** CompensationEntry description. */ + public description: string; + + /** CompensationEntry expectedUnitsPerYear. */ + public expectedUnitsPerYear?: (google.protobuf.IDoubleValue|null); + + /** CompensationEntry compensationAmount. */ + public compensationAmount?: ("amount"|"range"); + + /** + * Creates a new CompensationEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns CompensationEntry instance + */ + public static create(properties?: google.cloud.talent.v4beta1.CompensationInfo.ICompensationEntry): google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry; + + /** + * Encodes the specified CompensationEntry message. Does not implicitly {@link google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.verify|verify} messages. + * @param message CompensationEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.CompensationInfo.ICompensationEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompensationEntry message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.verify|verify} messages. + * @param message CompensationEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.CompensationInfo.ICompensationEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompensationEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompensationEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry; + + /** + * Decodes a CompensationEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompensationEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry; + + /** + * Verifies a CompensationEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompensationEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompensationEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry; + + /** + * Creates a plain object from a CompensationEntry message. Also converts values to other types if specified. + * @param message CompensationEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompensationEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompensationEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** CompensationType enum. */ + enum CompensationType { + COMPENSATION_TYPE_UNSPECIFIED = 0, + BASE = 1, + BONUS = 2, + SIGNING_BONUS = 3, + EQUITY = 4, + PROFIT_SHARING = 5, + COMMISSIONS = 6, + TIPS = 7, + OTHER_COMPENSATION_TYPE = 8 + } + + /** CompensationUnit enum. */ + enum CompensationUnit { + COMPENSATION_UNIT_UNSPECIFIED = 0, + HOURLY = 1, + DAILY = 2, + WEEKLY = 3, + MONTHLY = 4, + YEARLY = 5, + ONE_TIME = 6, + OTHER_COMPENSATION_UNIT = 7 + } + + /** Properties of a CompensationRange. */ + interface ICompensationRange { + + /** CompensationRange maxCompensation */ + maxCompensation?: (google.type.IMoney|null); + + /** CompensationRange minCompensation */ + minCompensation?: (google.type.IMoney|null); + } + + /** Represents a CompensationRange. */ + class CompensationRange implements ICompensationRange { + + /** + * Constructs a new CompensationRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange); + + /** CompensationRange maxCompensation. */ + public maxCompensation?: (google.type.IMoney|null); + + /** CompensationRange minCompensation. */ + public minCompensation?: (google.type.IMoney|null); + + /** + * Creates a new CompensationRange instance using the specified properties. + * @param [properties] Properties to set + * @returns CompensationRange instance + */ + public static create(properties?: google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange): google.cloud.talent.v4beta1.CompensationInfo.CompensationRange; + + /** + * Encodes the specified CompensationRange message. Does not implicitly {@link google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.verify|verify} messages. + * @param message CompensationRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompensationRange message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.verify|verify} messages. + * @param message CompensationRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompensationRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompensationRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.CompensationInfo.CompensationRange; + + /** + * Decodes a CompensationRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompensationRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.CompensationInfo.CompensationRange; + + /** + * Verifies a CompensationRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompensationRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompensationRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.CompensationInfo.CompensationRange; + + /** + * Creates a plain object from a CompensationRange message. Also converts values to other types if specified. + * @param message CompensationRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.CompensationInfo.CompensationRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompensationRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompensationRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a BatchOperationMetadata. */ + interface IBatchOperationMetadata { + + /** BatchOperationMetadata state */ + state?: (google.cloud.talent.v4beta1.BatchOperationMetadata.State|keyof typeof google.cloud.talent.v4beta1.BatchOperationMetadata.State|null); + + /** BatchOperationMetadata stateDescription */ + stateDescription?: (string|null); + + /** BatchOperationMetadata successCount */ + successCount?: (number|null); + + /** BatchOperationMetadata failureCount */ + failureCount?: (number|null); + + /** BatchOperationMetadata totalCount */ + totalCount?: (number|null); + + /** BatchOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BatchOperationMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** BatchOperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BatchOperationMetadata. */ + class BatchOperationMetadata implements IBatchOperationMetadata { + + /** + * Constructs a new BatchOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IBatchOperationMetadata); + + /** BatchOperationMetadata state. */ + public state: (google.cloud.talent.v4beta1.BatchOperationMetadata.State|keyof typeof google.cloud.talent.v4beta1.BatchOperationMetadata.State); + + /** BatchOperationMetadata stateDescription. */ + public stateDescription: string; + + /** BatchOperationMetadata successCount. */ + public successCount: number; + + /** BatchOperationMetadata failureCount. */ + public failureCount: number; + + /** BatchOperationMetadata totalCount. */ + public totalCount: number; + + /** BatchOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BatchOperationMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BatchOperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BatchOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchOperationMetadata instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IBatchOperationMetadata): google.cloud.talent.v4beta1.BatchOperationMetadata; + + /** + * Encodes the specified BatchOperationMetadata message. Does not implicitly {@link google.cloud.talent.v4beta1.BatchOperationMetadata.verify|verify} messages. + * @param message BatchOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IBatchOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.BatchOperationMetadata.verify|verify} messages. + * @param message BatchOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IBatchOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.BatchOperationMetadata; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.BatchOperationMetadata; + + /** + * Verifies a BatchOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.BatchOperationMetadata; + + /** + * Creates a plain object from a BatchOperationMetadata message. Also converts values to other types if specified. + * @param message BatchOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.BatchOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchOperationMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + INITIALIZING = 1, + PROCESSING = 2, + SUCCEEDED = 3, + FAILED = 4, + CANCELLING = 5, + CANCELLED = 6 + } + } + + /** Properties of a Company. */ + interface ICompany { + + /** Company name */ + name?: (string|null); + + /** Company displayName */ + displayName?: (string|null); + + /** Company externalId */ + externalId?: (string|null); + + /** Company size */ + size?: (google.cloud.talent.v4beta1.CompanySize|keyof typeof google.cloud.talent.v4beta1.CompanySize|null); + + /** Company headquartersAddress */ + headquartersAddress?: (string|null); + + /** Company hiringAgency */ + hiringAgency?: (boolean|null); + + /** Company eeoText */ + eeoText?: (string|null); + + /** Company websiteUri */ + websiteUri?: (string|null); + + /** Company careerSiteUri */ + careerSiteUri?: (string|null); + + /** Company imageUri */ + imageUri?: (string|null); + + /** Company keywordSearchableJobCustomAttributes */ + keywordSearchableJobCustomAttributes?: (string[]|null); + + /** Company derivedInfo */ + derivedInfo?: (google.cloud.talent.v4beta1.Company.IDerivedInfo|null); + + /** Company suspended */ + suspended?: (boolean|null); + } + + /** Represents a Company. */ + class Company implements ICompany { + + /** + * Constructs a new Company. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.ICompany); + + /** Company name. */ + public name: string; + + /** Company displayName. */ + public displayName: string; + + /** Company externalId. */ + public externalId: string; + + /** Company size. */ + public size: (google.cloud.talent.v4beta1.CompanySize|keyof typeof google.cloud.talent.v4beta1.CompanySize); + + /** Company headquartersAddress. */ + public headquartersAddress: string; + + /** Company hiringAgency. */ + public hiringAgency: boolean; + + /** Company eeoText. */ + public eeoText: string; + + /** Company websiteUri. */ + public websiteUri: string; + + /** Company careerSiteUri. */ + public careerSiteUri: string; + + /** Company imageUri. */ + public imageUri: string; + + /** Company keywordSearchableJobCustomAttributes. */ + public keywordSearchableJobCustomAttributes: string[]; + + /** Company derivedInfo. */ + public derivedInfo?: (google.cloud.talent.v4beta1.Company.IDerivedInfo|null); + + /** Company suspended. */ + public suspended: boolean; + + /** + * Creates a new Company instance using the specified properties. + * @param [properties] Properties to set + * @returns Company instance + */ + public static create(properties?: google.cloud.talent.v4beta1.ICompany): google.cloud.talent.v4beta1.Company; + + /** + * Encodes the specified Company message. Does not implicitly {@link google.cloud.talent.v4beta1.Company.verify|verify} messages. + * @param message Company message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.ICompany, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Company message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.Company.verify|verify} messages. + * @param message Company message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.ICompany, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Company message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Company + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.Company; + + /** + * Decodes a Company message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Company + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.Company; + + /** + * Verifies a Company message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Company message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Company + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.Company; + + /** + * Creates a plain object from a Company message. Also converts values to other types if specified. + * @param message Company + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.Company, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Company to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Company + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Company { + + /** Properties of a DerivedInfo. */ + interface IDerivedInfo { + + /** DerivedInfo headquartersLocation */ + headquartersLocation?: (google.cloud.talent.v4beta1.ILocation|null); + } + + /** Represents a DerivedInfo. */ + class DerivedInfo implements IDerivedInfo { + + /** + * Constructs a new DerivedInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.Company.IDerivedInfo); + + /** DerivedInfo headquartersLocation. */ + public headquartersLocation?: (google.cloud.talent.v4beta1.ILocation|null); + + /** + * Creates a new DerivedInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DerivedInfo instance + */ + public static create(properties?: google.cloud.talent.v4beta1.Company.IDerivedInfo): google.cloud.talent.v4beta1.Company.DerivedInfo; + + /** + * Encodes the specified DerivedInfo message. Does not implicitly {@link google.cloud.talent.v4beta1.Company.DerivedInfo.verify|verify} messages. + * @param message DerivedInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.Company.IDerivedInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DerivedInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.Company.DerivedInfo.verify|verify} messages. + * @param message DerivedInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.Company.IDerivedInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DerivedInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DerivedInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.Company.DerivedInfo; + + /** + * Decodes a DerivedInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DerivedInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.Company.DerivedInfo; + + /** + * Verifies a DerivedInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DerivedInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DerivedInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.Company.DerivedInfo; + + /** + * Creates a plain object from a DerivedInfo message. Also converts values to other types if specified. + * @param message DerivedInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.Company.DerivedInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DerivedInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DerivedInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a CompanyService */ + class CompanyService extends $protobuf.rpc.Service { + + /** + * Constructs a new CompanyService 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 CompanyService 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): CompanyService; + + /** + * Calls CreateCompany. + * @param request CreateCompanyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Company + */ + public createCompany(request: google.cloud.talent.v4beta1.ICreateCompanyRequest, callback: google.cloud.talent.v4beta1.CompanyService.CreateCompanyCallback): void; + + /** + * Calls CreateCompany. + * @param request CreateCompanyRequest message or plain object + * @returns Promise + */ + public createCompany(request: google.cloud.talent.v4beta1.ICreateCompanyRequest): Promise; + + /** + * Calls GetCompany. + * @param request GetCompanyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Company + */ + public getCompany(request: google.cloud.talent.v4beta1.IGetCompanyRequest, callback: google.cloud.talent.v4beta1.CompanyService.GetCompanyCallback): void; + + /** + * Calls GetCompany. + * @param request GetCompanyRequest message or plain object + * @returns Promise + */ + public getCompany(request: google.cloud.talent.v4beta1.IGetCompanyRequest): Promise; + + /** + * Calls UpdateCompany. + * @param request UpdateCompanyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Company + */ + public updateCompany(request: google.cloud.talent.v4beta1.IUpdateCompanyRequest, callback: google.cloud.talent.v4beta1.CompanyService.UpdateCompanyCallback): void; + + /** + * Calls UpdateCompany. + * @param request UpdateCompanyRequest message or plain object + * @returns Promise + */ + public updateCompany(request: google.cloud.talent.v4beta1.IUpdateCompanyRequest): Promise; + + /** + * Calls DeleteCompany. + * @param request DeleteCompanyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteCompany(request: google.cloud.talent.v4beta1.IDeleteCompanyRequest, callback: google.cloud.talent.v4beta1.CompanyService.DeleteCompanyCallback): void; + + /** + * Calls DeleteCompany. + * @param request DeleteCompanyRequest message or plain object + * @returns Promise + */ + public deleteCompany(request: google.cloud.talent.v4beta1.IDeleteCompanyRequest): Promise; + + /** + * Calls ListCompanies. + * @param request ListCompaniesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCompaniesResponse + */ + public listCompanies(request: google.cloud.talent.v4beta1.IListCompaniesRequest, callback: google.cloud.talent.v4beta1.CompanyService.ListCompaniesCallback): void; + + /** + * Calls ListCompanies. + * @param request ListCompaniesRequest message or plain object + * @returns Promise + */ + public listCompanies(request: google.cloud.talent.v4beta1.IListCompaniesRequest): Promise; + } + + namespace CompanyService { + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.CompanyService|createCompany}. + * @param error Error, if any + * @param [response] Company + */ + type CreateCompanyCallback = (error: (Error|null), response?: google.cloud.talent.v4beta1.Company) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.CompanyService|getCompany}. + * @param error Error, if any + * @param [response] Company + */ + type GetCompanyCallback = (error: (Error|null), response?: google.cloud.talent.v4beta1.Company) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.CompanyService|updateCompany}. + * @param error Error, if any + * @param [response] Company + */ + type UpdateCompanyCallback = (error: (Error|null), response?: google.cloud.talent.v4beta1.Company) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.CompanyService|deleteCompany}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteCompanyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.CompanyService|listCompanies}. + * @param error Error, if any + * @param [response] ListCompaniesResponse + */ + type ListCompaniesCallback = (error: (Error|null), response?: google.cloud.talent.v4beta1.ListCompaniesResponse) => void; + } + + /** Properties of a CreateCompanyRequest. */ + interface ICreateCompanyRequest { + + /** CreateCompanyRequest parent */ + parent?: (string|null); + + /** CreateCompanyRequest company */ + company?: (google.cloud.talent.v4beta1.ICompany|null); + } + + /** Represents a CreateCompanyRequest. */ + class CreateCompanyRequest implements ICreateCompanyRequest { + + /** + * Constructs a new CreateCompanyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.ICreateCompanyRequest); + + /** CreateCompanyRequest parent. */ + public parent: string; + + /** CreateCompanyRequest company. */ + public company?: (google.cloud.talent.v4beta1.ICompany|null); + + /** + * Creates a new CreateCompanyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCompanyRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.ICreateCompanyRequest): google.cloud.talent.v4beta1.CreateCompanyRequest; + + /** + * Encodes the specified CreateCompanyRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.CreateCompanyRequest.verify|verify} messages. + * @param message CreateCompanyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.ICreateCompanyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCompanyRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CreateCompanyRequest.verify|verify} messages. + * @param message CreateCompanyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.ICreateCompanyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCompanyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.CreateCompanyRequest; + + /** + * Decodes a CreateCompanyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.CreateCompanyRequest; + + /** + * Verifies a CreateCompanyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCompanyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCompanyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.CreateCompanyRequest; + + /** + * Creates a plain object from a CreateCompanyRequest message. Also converts values to other types if specified. + * @param message CreateCompanyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.CreateCompanyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCompanyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCompanyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCompanyRequest. */ + interface IGetCompanyRequest { + + /** GetCompanyRequest name */ + name?: (string|null); + } + + /** Represents a GetCompanyRequest. */ + class GetCompanyRequest implements IGetCompanyRequest { + + /** + * Constructs a new GetCompanyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IGetCompanyRequest); + + /** GetCompanyRequest name. */ + public name: string; + + /** + * Creates a new GetCompanyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCompanyRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IGetCompanyRequest): google.cloud.talent.v4beta1.GetCompanyRequest; + + /** + * Encodes the specified GetCompanyRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.GetCompanyRequest.verify|verify} messages. + * @param message GetCompanyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IGetCompanyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCompanyRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.GetCompanyRequest.verify|verify} messages. + * @param message GetCompanyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IGetCompanyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCompanyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.GetCompanyRequest; + + /** + * Decodes a GetCompanyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.GetCompanyRequest; + + /** + * Verifies a GetCompanyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCompanyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCompanyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.GetCompanyRequest; + + /** + * Creates a plain object from a GetCompanyRequest message. Also converts values to other types if specified. + * @param message GetCompanyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.GetCompanyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCompanyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCompanyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCompanyRequest. */ + interface IUpdateCompanyRequest { + + /** UpdateCompanyRequest company */ + company?: (google.cloud.talent.v4beta1.ICompany|null); + + /** UpdateCompanyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateCompanyRequest. */ + class UpdateCompanyRequest implements IUpdateCompanyRequest { + + /** + * Constructs a new UpdateCompanyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IUpdateCompanyRequest); + + /** UpdateCompanyRequest company. */ + public company?: (google.cloud.talent.v4beta1.ICompany|null); + + /** UpdateCompanyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateCompanyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCompanyRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IUpdateCompanyRequest): google.cloud.talent.v4beta1.UpdateCompanyRequest; + + /** + * Encodes the specified UpdateCompanyRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.UpdateCompanyRequest.verify|verify} messages. + * @param message UpdateCompanyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IUpdateCompanyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCompanyRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.UpdateCompanyRequest.verify|verify} messages. + * @param message UpdateCompanyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IUpdateCompanyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCompanyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.UpdateCompanyRequest; + + /** + * Decodes an UpdateCompanyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.UpdateCompanyRequest; + + /** + * Verifies an UpdateCompanyRequest message. + * @param message Plain 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 UpdateCompanyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCompanyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.UpdateCompanyRequest; + + /** + * Creates a plain object from an UpdateCompanyRequest message. Also converts values to other types if specified. + * @param message UpdateCompanyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.UpdateCompanyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCompanyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCompanyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCompanyRequest. */ + interface IDeleteCompanyRequest { + + /** DeleteCompanyRequest name */ + name?: (string|null); + } + + /** Represents a DeleteCompanyRequest. */ + class DeleteCompanyRequest implements IDeleteCompanyRequest { + + /** + * Constructs a new DeleteCompanyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IDeleteCompanyRequest); + + /** DeleteCompanyRequest name. */ + public name: string; + + /** + * Creates a new DeleteCompanyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCompanyRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IDeleteCompanyRequest): google.cloud.talent.v4beta1.DeleteCompanyRequest; + + /** + * Encodes the specified DeleteCompanyRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.DeleteCompanyRequest.verify|verify} messages. + * @param message DeleteCompanyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IDeleteCompanyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCompanyRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.DeleteCompanyRequest.verify|verify} messages. + * @param message DeleteCompanyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IDeleteCompanyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCompanyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.DeleteCompanyRequest; + + /** + * Decodes a DeleteCompanyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.DeleteCompanyRequest; + + /** + * Verifies a DeleteCompanyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCompanyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCompanyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.DeleteCompanyRequest; + + /** + * Creates a plain object from a DeleteCompanyRequest message. Also converts values to other types if specified. + * @param message DeleteCompanyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.DeleteCompanyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCompanyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCompanyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCompaniesRequest. */ + interface IListCompaniesRequest { + + /** ListCompaniesRequest parent */ + parent?: (string|null); + + /** ListCompaniesRequest pageToken */ + pageToken?: (string|null); + + /** ListCompaniesRequest pageSize */ + pageSize?: (number|null); + + /** ListCompaniesRequest requireOpenJobs */ + requireOpenJobs?: (boolean|null); + } + + /** Represents a ListCompaniesRequest. */ + class ListCompaniesRequest implements IListCompaniesRequest { + + /** + * Constructs a new ListCompaniesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IListCompaniesRequest); + + /** ListCompaniesRequest parent. */ + public parent: string; + + /** ListCompaniesRequest pageToken. */ + public pageToken: string; + + /** ListCompaniesRequest pageSize. */ + public pageSize: number; + + /** ListCompaniesRequest requireOpenJobs. */ + public requireOpenJobs: boolean; + + /** + * Creates a new ListCompaniesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCompaniesRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IListCompaniesRequest): google.cloud.talent.v4beta1.ListCompaniesRequest; + + /** + * Encodes the specified ListCompaniesRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.ListCompaniesRequest.verify|verify} messages. + * @param message ListCompaniesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IListCompaniesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCompaniesRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.ListCompaniesRequest.verify|verify} messages. + * @param message ListCompaniesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IListCompaniesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCompaniesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCompaniesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.ListCompaniesRequest; + + /** + * Decodes a ListCompaniesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCompaniesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.ListCompaniesRequest; + + /** + * Verifies a ListCompaniesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCompaniesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCompaniesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.ListCompaniesRequest; + + /** + * Creates a plain object from a ListCompaniesRequest message. Also converts values to other types if specified. + * @param message ListCompaniesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.ListCompaniesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCompaniesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCompaniesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCompaniesResponse. */ + interface IListCompaniesResponse { + + /** ListCompaniesResponse companies */ + companies?: (google.cloud.talent.v4beta1.ICompany[]|null); + + /** ListCompaniesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListCompaniesResponse metadata */ + metadata?: (google.cloud.talent.v4beta1.IResponseMetadata|null); + } + + /** Represents a ListCompaniesResponse. */ + class ListCompaniesResponse implements IListCompaniesResponse { + + /** + * Constructs a new ListCompaniesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IListCompaniesResponse); + + /** ListCompaniesResponse companies. */ + public companies: google.cloud.talent.v4beta1.ICompany[]; + + /** ListCompaniesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListCompaniesResponse metadata. */ + public metadata?: (google.cloud.talent.v4beta1.IResponseMetadata|null); + + /** + * Creates a new ListCompaniesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCompaniesResponse instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IListCompaniesResponse): google.cloud.talent.v4beta1.ListCompaniesResponse; + + /** + * Encodes the specified ListCompaniesResponse message. Does not implicitly {@link google.cloud.talent.v4beta1.ListCompaniesResponse.verify|verify} messages. + * @param message ListCompaniesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IListCompaniesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCompaniesResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.ListCompaniesResponse.verify|verify} messages. + * @param message ListCompaniesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IListCompaniesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCompaniesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCompaniesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.ListCompaniesResponse; + + /** + * Decodes a ListCompaniesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCompaniesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.ListCompaniesResponse; + + /** + * Verifies a ListCompaniesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCompaniesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCompaniesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.ListCompaniesResponse; + + /** + * Creates a plain object from a ListCompaniesResponse message. Also converts values to other types if specified. + * @param message ListCompaniesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.ListCompaniesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCompaniesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCompaniesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Completion */ + class Completion extends $protobuf.rpc.Service { + + /** + * Constructs a new Completion 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 Completion 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): Completion; + + /** + * Calls CompleteQuery. + * @param request CompleteQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CompleteQueryResponse + */ + public completeQuery(request: google.cloud.talent.v4beta1.ICompleteQueryRequest, callback: google.cloud.talent.v4beta1.Completion.CompleteQueryCallback): void; + + /** + * Calls CompleteQuery. + * @param request CompleteQueryRequest message or plain object + * @returns Promise + */ + public completeQuery(request: google.cloud.talent.v4beta1.ICompleteQueryRequest): Promise; + } + + namespace Completion { + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.Completion|completeQuery}. + * @param error Error, if any + * @param [response] CompleteQueryResponse + */ + type CompleteQueryCallback = (error: (Error|null), response?: google.cloud.talent.v4beta1.CompleteQueryResponse) => void; + } + + /** Properties of a CompleteQueryRequest. */ + interface ICompleteQueryRequest { + + /** CompleteQueryRequest parent */ + parent?: (string|null); + + /** CompleteQueryRequest query */ + query?: (string|null); + + /** CompleteQueryRequest languageCodes */ + languageCodes?: (string[]|null); + + /** CompleteQueryRequest pageSize */ + pageSize?: (number|null); + + /** CompleteQueryRequest company */ + company?: (string|null); + + /** CompleteQueryRequest scope */ + scope?: (google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope|keyof typeof google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope|null); + + /** CompleteQueryRequest type */ + type?: (google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType|keyof typeof google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType|null); + } + + /** Represents a CompleteQueryRequest. */ + class CompleteQueryRequest implements ICompleteQueryRequest { + + /** + * Constructs a new CompleteQueryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.ICompleteQueryRequest); + + /** CompleteQueryRequest parent. */ + public parent: string; + + /** CompleteQueryRequest query. */ + public query: string; + + /** CompleteQueryRequest languageCodes. */ + public languageCodes: string[]; + + /** CompleteQueryRequest pageSize. */ + public pageSize: number; + + /** CompleteQueryRequest company. */ + public company: string; + + /** CompleteQueryRequest scope. */ + public scope: (google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope|keyof typeof google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope); + + /** CompleteQueryRequest type. */ + public type: (google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType|keyof typeof google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType); + + /** + * Creates a new CompleteQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CompleteQueryRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.ICompleteQueryRequest): google.cloud.talent.v4beta1.CompleteQueryRequest; + + /** + * Encodes the specified CompleteQueryRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.CompleteQueryRequest.verify|verify} messages. + * @param message CompleteQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.ICompleteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompleteQueryRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CompleteQueryRequest.verify|verify} messages. + * @param message CompleteQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.ICompleteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompleteQueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompleteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.CompleteQueryRequest; + + /** + * Decodes a CompleteQueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompleteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.CompleteQueryRequest; + + /** + * Verifies a CompleteQueryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompleteQueryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompleteQueryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.CompleteQueryRequest; + + /** + * Creates a plain object from a CompleteQueryRequest message. Also converts values to other types if specified. + * @param message CompleteQueryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.CompleteQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompleteQueryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompleteQueryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CompleteQueryRequest { + + /** CompletionScope enum. */ + enum CompletionScope { + COMPLETION_SCOPE_UNSPECIFIED = 0, + TENANT = 1, + PUBLIC = 2 + } + + /** CompletionType enum. */ + enum CompletionType { + COMPLETION_TYPE_UNSPECIFIED = 0, + JOB_TITLE = 1, + COMPANY_NAME = 2, + COMBINED = 3 + } + } + + /** Properties of a CompleteQueryResponse. */ + interface ICompleteQueryResponse { + + /** CompleteQueryResponse completionResults */ + completionResults?: (google.cloud.talent.v4beta1.CompleteQueryResponse.ICompletionResult[]|null); + + /** CompleteQueryResponse metadata */ + metadata?: (google.cloud.talent.v4beta1.IResponseMetadata|null); + } + + /** Represents a CompleteQueryResponse. */ + class CompleteQueryResponse implements ICompleteQueryResponse { + + /** + * Constructs a new CompleteQueryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.ICompleteQueryResponse); + + /** CompleteQueryResponse completionResults. */ + public completionResults: google.cloud.talent.v4beta1.CompleteQueryResponse.ICompletionResult[]; + + /** CompleteQueryResponse metadata. */ + public metadata?: (google.cloud.talent.v4beta1.IResponseMetadata|null); + + /** + * Creates a new CompleteQueryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CompleteQueryResponse instance + */ + public static create(properties?: google.cloud.talent.v4beta1.ICompleteQueryResponse): google.cloud.talent.v4beta1.CompleteQueryResponse; + + /** + * Encodes the specified CompleteQueryResponse message. Does not implicitly {@link google.cloud.talent.v4beta1.CompleteQueryResponse.verify|verify} messages. + * @param message CompleteQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.ICompleteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompleteQueryResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CompleteQueryResponse.verify|verify} messages. + * @param message CompleteQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.ICompleteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompleteQueryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompleteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.CompleteQueryResponse; + + /** + * Decodes a CompleteQueryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompleteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.CompleteQueryResponse; + + /** + * Verifies a CompleteQueryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompleteQueryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompleteQueryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.CompleteQueryResponse; + + /** + * Creates a plain object from a CompleteQueryResponse message. Also converts values to other types if specified. + * @param message CompleteQueryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.CompleteQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompleteQueryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompleteQueryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CompleteQueryResponse { + + /** Properties of a CompletionResult. */ + interface ICompletionResult { + + /** CompletionResult suggestion */ + suggestion?: (string|null); + + /** CompletionResult type */ + type?: (google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType|keyof typeof google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType|null); + + /** CompletionResult imageUri */ + imageUri?: (string|null); + } + + /** Represents a CompletionResult. */ + class CompletionResult implements ICompletionResult { + + /** + * Constructs a new CompletionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.CompleteQueryResponse.ICompletionResult); + + /** CompletionResult suggestion. */ + public suggestion: string; + + /** CompletionResult type. */ + public type: (google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType|keyof typeof google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType); + + /** CompletionResult imageUri. */ + public imageUri: string; + + /** + * Creates a new CompletionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns CompletionResult instance + */ + public static create(properties?: google.cloud.talent.v4beta1.CompleteQueryResponse.ICompletionResult): google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult; + + /** + * Encodes the specified CompletionResult message. Does not implicitly {@link google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult.verify|verify} messages. + * @param message CompletionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.CompleteQueryResponse.ICompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompletionResult message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult.verify|verify} messages. + * @param message CompletionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.CompleteQueryResponse.ICompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompletionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult; + + /** + * Decodes a CompletionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult; + + /** + * Verifies a CompletionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompletionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompletionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult; + + /** + * Creates a plain object from a CompletionResult message. Also converts values to other types if specified. + * @param message CompletionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompletionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompletionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ClientEvent. */ + interface IClientEvent { + + /** ClientEvent requestId */ + requestId?: (string|null); + + /** ClientEvent eventId */ + eventId?: (string|null); + + /** ClientEvent createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ClientEvent jobEvent */ + jobEvent?: (google.cloud.talent.v4beta1.IJobEvent|null); + + /** ClientEvent eventNotes */ + eventNotes?: (string|null); + } + + /** Represents a ClientEvent. */ + class ClientEvent implements IClientEvent { + + /** + * Constructs a new ClientEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IClientEvent); + + /** ClientEvent requestId. */ + public requestId: string; + + /** ClientEvent eventId. */ + public eventId: string; + + /** ClientEvent createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ClientEvent jobEvent. */ + public jobEvent?: (google.cloud.talent.v4beta1.IJobEvent|null); + + /** ClientEvent eventNotes. */ + public eventNotes: string; + + /** ClientEvent event. */ + public event?: "jobEvent"; + + /** + * Creates a new ClientEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientEvent instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IClientEvent): google.cloud.talent.v4beta1.ClientEvent; + + /** + * Encodes the specified ClientEvent message. Does not implicitly {@link google.cloud.talent.v4beta1.ClientEvent.verify|verify} messages. + * @param message ClientEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IClientEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientEvent message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.ClientEvent.verify|verify} messages. + * @param message ClientEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IClientEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.ClientEvent; + + /** + * Decodes a ClientEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.ClientEvent; + + /** + * Verifies a ClientEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.ClientEvent; + + /** + * Creates a plain object from a ClientEvent message. Also converts values to other types if specified. + * @param message ClientEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.ClientEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobEvent. */ + interface IJobEvent { + + /** JobEvent type */ + type?: (google.cloud.talent.v4beta1.JobEvent.JobEventType|keyof typeof google.cloud.talent.v4beta1.JobEvent.JobEventType|null); + + /** JobEvent jobs */ + jobs?: (string[]|null); + + /** JobEvent profile */ + profile?: (string|null); + } + + /** Represents a JobEvent. */ + class JobEvent implements IJobEvent { + + /** + * Constructs a new JobEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IJobEvent); + + /** JobEvent type. */ + public type: (google.cloud.talent.v4beta1.JobEvent.JobEventType|keyof typeof google.cloud.talent.v4beta1.JobEvent.JobEventType); + + /** JobEvent jobs. */ + public jobs: string[]; + + /** JobEvent profile. */ + public profile: string; + + /** + * Creates a new JobEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns JobEvent instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IJobEvent): google.cloud.talent.v4beta1.JobEvent; + + /** + * Encodes the specified JobEvent message. Does not implicitly {@link google.cloud.talent.v4beta1.JobEvent.verify|verify} messages. + * @param message JobEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IJobEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobEvent message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.JobEvent.verify|verify} messages. + * @param message JobEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IJobEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.JobEvent; + + /** + * Decodes a JobEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.JobEvent; + + /** + * Verifies a JobEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.JobEvent; + + /** + * Creates a plain object from a JobEvent message. Also converts values to other types if specified. + * @param message JobEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.JobEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobEvent { + + /** JobEventType enum. */ + enum JobEventType { + JOB_EVENT_TYPE_UNSPECIFIED = 0, + IMPRESSION = 1, + VIEW = 2, + VIEW_REDIRECT = 3, + APPLICATION_START = 4, + APPLICATION_FINISH = 5, + APPLICATION_QUICK_SUBMISSION = 6, + APPLICATION_REDIRECT = 7, + APPLICATION_START_FROM_SEARCH = 8, + APPLICATION_REDIRECT_FROM_SEARCH = 9, + APPLICATION_COMPANY_SUBMIT = 10, + BOOKMARK = 11, + NOTIFICATION = 12, + HIRED = 13, + SENT_CV = 14, + INTERVIEW_GRANTED = 15 + } + } + + /** Represents an EventService */ + class EventService extends $protobuf.rpc.Service { + + /** + * Constructs a new EventService 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 EventService 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): EventService; + + /** + * Calls CreateClientEvent. + * @param request CreateClientEventRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ClientEvent + */ + public createClientEvent(request: google.cloud.talent.v4beta1.ICreateClientEventRequest, callback: google.cloud.talent.v4beta1.EventService.CreateClientEventCallback): void; + + /** + * Calls CreateClientEvent. + * @param request CreateClientEventRequest message or plain object + * @returns Promise + */ + public createClientEvent(request: google.cloud.talent.v4beta1.ICreateClientEventRequest): Promise; + } + + namespace EventService { + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.EventService|createClientEvent}. + * @param error Error, if any + * @param [response] ClientEvent + */ + type CreateClientEventCallback = (error: (Error|null), response?: google.cloud.talent.v4beta1.ClientEvent) => void; + } + + /** Properties of a CreateClientEventRequest. */ + interface ICreateClientEventRequest { + + /** CreateClientEventRequest parent */ + parent?: (string|null); + + /** CreateClientEventRequest clientEvent */ + clientEvent?: (google.cloud.talent.v4beta1.IClientEvent|null); + } + + /** Represents a CreateClientEventRequest. */ + class CreateClientEventRequest implements ICreateClientEventRequest { + + /** + * Constructs a new CreateClientEventRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.ICreateClientEventRequest); + + /** CreateClientEventRequest parent. */ + public parent: string; + + /** CreateClientEventRequest clientEvent. */ + public clientEvent?: (google.cloud.talent.v4beta1.IClientEvent|null); + + /** + * Creates a new CreateClientEventRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateClientEventRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.ICreateClientEventRequest): google.cloud.talent.v4beta1.CreateClientEventRequest; + + /** + * Encodes the specified CreateClientEventRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.CreateClientEventRequest.verify|verify} messages. + * @param message CreateClientEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.ICreateClientEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateClientEventRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CreateClientEventRequest.verify|verify} messages. + * @param message CreateClientEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.ICreateClientEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateClientEventRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateClientEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.CreateClientEventRequest; + + /** + * Decodes a CreateClientEventRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateClientEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.CreateClientEventRequest; + + /** + * Verifies a CreateClientEventRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateClientEventRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateClientEventRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.CreateClientEventRequest; + + /** + * Creates a plain object from a CreateClientEventRequest message. Also converts values to other types if specified. + * @param message CreateClientEventRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.CreateClientEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateClientEventRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateClientEventRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobQuery. */ + interface IJobQuery { + + /** JobQuery query */ + query?: (string|null); + + /** JobQuery queryLanguageCode */ + queryLanguageCode?: (string|null); + + /** JobQuery companies */ + companies?: (string[]|null); + + /** JobQuery locationFilters */ + locationFilters?: (google.cloud.talent.v4beta1.ILocationFilter[]|null); + + /** JobQuery jobCategories */ + jobCategories?: (google.cloud.talent.v4beta1.JobCategory[]|null); + + /** JobQuery commuteFilter */ + commuteFilter?: (google.cloud.talent.v4beta1.ICommuteFilter|null); + + /** JobQuery companyDisplayNames */ + companyDisplayNames?: (string[]|null); + + /** JobQuery compensationFilter */ + compensationFilter?: (google.cloud.talent.v4beta1.ICompensationFilter|null); + + /** JobQuery customAttributeFilter */ + customAttributeFilter?: (string|null); + + /** JobQuery disableSpellCheck */ + disableSpellCheck?: (boolean|null); + + /** JobQuery employmentTypes */ + employmentTypes?: (google.cloud.talent.v4beta1.EmploymentType[]|null); + + /** JobQuery languageCodes */ + languageCodes?: (string[]|null); + + /** JobQuery publishTimeRange */ + publishTimeRange?: (google.cloud.talent.v4beta1.ITimestampRange|null); + + /** JobQuery excludedJobs */ + excludedJobs?: (string[]|null); + } + + /** Represents a JobQuery. */ + class JobQuery implements IJobQuery { + + /** + * Constructs a new JobQuery. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IJobQuery); + + /** JobQuery query. */ + public query: string; + + /** JobQuery queryLanguageCode. */ + public queryLanguageCode: string; + + /** JobQuery companies. */ + public companies: string[]; + + /** JobQuery locationFilters. */ + public locationFilters: google.cloud.talent.v4beta1.ILocationFilter[]; + + /** JobQuery jobCategories. */ + public jobCategories: google.cloud.talent.v4beta1.JobCategory[]; + + /** JobQuery commuteFilter. */ + public commuteFilter?: (google.cloud.talent.v4beta1.ICommuteFilter|null); + + /** JobQuery companyDisplayNames. */ + public companyDisplayNames: string[]; + + /** JobQuery compensationFilter. */ + public compensationFilter?: (google.cloud.talent.v4beta1.ICompensationFilter|null); + + /** JobQuery customAttributeFilter. */ + public customAttributeFilter: string; + + /** JobQuery disableSpellCheck. */ + public disableSpellCheck: boolean; + + /** JobQuery employmentTypes. */ + public employmentTypes: google.cloud.talent.v4beta1.EmploymentType[]; + + /** JobQuery languageCodes. */ + public languageCodes: string[]; + + /** JobQuery publishTimeRange. */ + public publishTimeRange?: (google.cloud.talent.v4beta1.ITimestampRange|null); + + /** JobQuery excludedJobs. */ + public excludedJobs: string[]; + + /** + * Creates a new JobQuery instance using the specified properties. + * @param [properties] Properties to set + * @returns JobQuery instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IJobQuery): google.cloud.talent.v4beta1.JobQuery; + + /** + * Encodes the specified JobQuery message. Does not implicitly {@link google.cloud.talent.v4beta1.JobQuery.verify|verify} messages. + * @param message JobQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IJobQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobQuery message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.JobQuery.verify|verify} messages. + * @param message JobQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IJobQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobQuery message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.JobQuery; + + /** + * Decodes a JobQuery message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.JobQuery; + + /** + * Verifies a JobQuery message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobQuery message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobQuery + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.JobQuery; + + /** + * Creates a plain object from a JobQuery message. Also converts values to other types if specified. + * @param message JobQuery + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.JobQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobQuery to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobQuery + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LocationFilter. */ + interface ILocationFilter { + + /** LocationFilter address */ + address?: (string|null); + + /** LocationFilter regionCode */ + regionCode?: (string|null); + + /** LocationFilter latLng */ + latLng?: (google.type.ILatLng|null); + + /** LocationFilter distanceInMiles */ + distanceInMiles?: (number|null); + + /** LocationFilter telecommutePreference */ + telecommutePreference?: (google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference|keyof typeof google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference|null); + + /** LocationFilter negated */ + negated?: (boolean|null); + } + + /** Represents a LocationFilter. */ + class LocationFilter implements ILocationFilter { + + /** + * Constructs a new LocationFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.ILocationFilter); + + /** LocationFilter address. */ + public address: string; + + /** LocationFilter regionCode. */ + public regionCode: string; + + /** LocationFilter latLng. */ + public latLng?: (google.type.ILatLng|null); + + /** LocationFilter distanceInMiles. */ + public distanceInMiles: number; + + /** LocationFilter telecommutePreference. */ + public telecommutePreference: (google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference|keyof typeof google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference); + + /** LocationFilter negated. */ + public negated: boolean; + + /** + * Creates a new LocationFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationFilter instance + */ + public static create(properties?: google.cloud.talent.v4beta1.ILocationFilter): google.cloud.talent.v4beta1.LocationFilter; + + /** + * Encodes the specified LocationFilter message. Does not implicitly {@link google.cloud.talent.v4beta1.LocationFilter.verify|verify} messages. + * @param message LocationFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.ILocationFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationFilter message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.LocationFilter.verify|verify} messages. + * @param message LocationFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.ILocationFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.LocationFilter; + + /** + * Decodes a LocationFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.LocationFilter; + + /** + * Verifies a LocationFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.LocationFilter; + + /** + * Creates a plain object from a LocationFilter message. Also converts values to other types if specified. + * @param message LocationFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.LocationFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LocationFilter { + + /** TelecommutePreference enum. */ + enum TelecommutePreference { + TELECOMMUTE_PREFERENCE_UNSPECIFIED = 0, + TELECOMMUTE_EXCLUDED = 1, + TELECOMMUTE_ALLOWED = 2, + TELECOMMUTE_JOBS_EXCLUDED = 3 + } + } + + /** Properties of a CompensationFilter. */ + interface ICompensationFilter { + + /** CompensationFilter type */ + type?: (google.cloud.talent.v4beta1.CompensationFilter.FilterType|keyof typeof google.cloud.talent.v4beta1.CompensationFilter.FilterType|null); + + /** CompensationFilter units */ + units?: (google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit[]|null); + + /** CompensationFilter range */ + range?: (google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange|null); + + /** CompensationFilter includeJobsWithUnspecifiedCompensationRange */ + includeJobsWithUnspecifiedCompensationRange?: (boolean|null); + } + + /** Represents a CompensationFilter. */ + class CompensationFilter implements ICompensationFilter { + + /** + * Constructs a new CompensationFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.ICompensationFilter); + + /** CompensationFilter type. */ + public type: (google.cloud.talent.v4beta1.CompensationFilter.FilterType|keyof typeof google.cloud.talent.v4beta1.CompensationFilter.FilterType); + + /** CompensationFilter units. */ + public units: google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit[]; + + /** CompensationFilter range. */ + public range?: (google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange|null); + + /** CompensationFilter includeJobsWithUnspecifiedCompensationRange. */ + public includeJobsWithUnspecifiedCompensationRange: boolean; + + /** + * Creates a new CompensationFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns CompensationFilter instance + */ + public static create(properties?: google.cloud.talent.v4beta1.ICompensationFilter): google.cloud.talent.v4beta1.CompensationFilter; + + /** + * Encodes the specified CompensationFilter message. Does not implicitly {@link google.cloud.talent.v4beta1.CompensationFilter.verify|verify} messages. + * @param message CompensationFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.ICompensationFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompensationFilter message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CompensationFilter.verify|verify} messages. + * @param message CompensationFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.ICompensationFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompensationFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompensationFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.CompensationFilter; + + /** + * Decodes a CompensationFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompensationFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.CompensationFilter; + + /** + * Verifies a CompensationFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompensationFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompensationFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.CompensationFilter; + + /** + * Creates a plain object from a CompensationFilter message. Also converts values to other types if specified. + * @param message CompensationFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.CompensationFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompensationFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompensationFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CompensationFilter { + + /** FilterType enum. */ + enum FilterType { + FILTER_TYPE_UNSPECIFIED = 0, + UNIT_ONLY = 1, + UNIT_AND_AMOUNT = 2, + ANNUALIZED_BASE_AMOUNT = 3, + ANNUALIZED_TOTAL_AMOUNT = 4 + } + } + + /** Properties of a CommuteFilter. */ + interface ICommuteFilter { + + /** CommuteFilter commuteMethod */ + commuteMethod?: (google.cloud.talent.v4beta1.CommuteMethod|keyof typeof google.cloud.talent.v4beta1.CommuteMethod|null); + + /** CommuteFilter startCoordinates */ + startCoordinates?: (google.type.ILatLng|null); + + /** CommuteFilter travelDuration */ + travelDuration?: (google.protobuf.IDuration|null); + + /** CommuteFilter allowImpreciseAddresses */ + allowImpreciseAddresses?: (boolean|null); + + /** CommuteFilter roadTraffic */ + roadTraffic?: (google.cloud.talent.v4beta1.CommuteFilter.RoadTraffic|keyof typeof google.cloud.talent.v4beta1.CommuteFilter.RoadTraffic|null); + + /** CommuteFilter departureTime */ + departureTime?: (google.type.ITimeOfDay|null); + } + + /** Represents a CommuteFilter. */ + class CommuteFilter implements ICommuteFilter { + + /** + * Constructs a new CommuteFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.ICommuteFilter); + + /** CommuteFilter commuteMethod. */ + public commuteMethod: (google.cloud.talent.v4beta1.CommuteMethod|keyof typeof google.cloud.talent.v4beta1.CommuteMethod); + + /** CommuteFilter startCoordinates. */ + public startCoordinates?: (google.type.ILatLng|null); + + /** CommuteFilter travelDuration. */ + public travelDuration?: (google.protobuf.IDuration|null); + + /** CommuteFilter allowImpreciseAddresses. */ + public allowImpreciseAddresses: boolean; + + /** CommuteFilter roadTraffic. */ + public roadTraffic?: (google.cloud.talent.v4beta1.CommuteFilter.RoadTraffic|keyof typeof google.cloud.talent.v4beta1.CommuteFilter.RoadTraffic|null); + + /** CommuteFilter departureTime. */ + public departureTime?: (google.type.ITimeOfDay|null); + + /** CommuteFilter trafficOption. */ + public trafficOption?: ("roadTraffic"|"departureTime"); + + /** + * Creates a new CommuteFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns CommuteFilter instance + */ + public static create(properties?: google.cloud.talent.v4beta1.ICommuteFilter): google.cloud.talent.v4beta1.CommuteFilter; + + /** + * Encodes the specified CommuteFilter message. Does not implicitly {@link google.cloud.talent.v4beta1.CommuteFilter.verify|verify} messages. + * @param message CommuteFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.ICommuteFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommuteFilter message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CommuteFilter.verify|verify} messages. + * @param message CommuteFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.ICommuteFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommuteFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommuteFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.CommuteFilter; + + /** + * Decodes a CommuteFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommuteFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.CommuteFilter; + + /** + * Verifies a CommuteFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommuteFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommuteFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.CommuteFilter; + + /** + * Creates a plain object from a CommuteFilter message. Also converts values to other types if specified. + * @param message CommuteFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.CommuteFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommuteFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommuteFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CommuteFilter { + + /** RoadTraffic enum. */ + enum RoadTraffic { + ROAD_TRAFFIC_UNSPECIFIED = 0, + TRAFFIC_FREE = 1, + BUSY_HOUR = 2 + } + } + + /** Properties of a HistogramQuery. */ + interface IHistogramQuery { + + /** HistogramQuery histogramQuery */ + histogramQuery?: (string|null); + } + + /** Represents a HistogramQuery. */ + class HistogramQuery implements IHistogramQuery { + + /** + * Constructs a new HistogramQuery. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IHistogramQuery); + + /** HistogramQuery histogramQuery. */ + public histogramQuery: string; + + /** + * Creates a new HistogramQuery instance using the specified properties. + * @param [properties] Properties to set + * @returns HistogramQuery instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IHistogramQuery): google.cloud.talent.v4beta1.HistogramQuery; + + /** + * Encodes the specified HistogramQuery message. Does not implicitly {@link google.cloud.talent.v4beta1.HistogramQuery.verify|verify} messages. + * @param message HistogramQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IHistogramQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HistogramQuery message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.HistogramQuery.verify|verify} messages. + * @param message HistogramQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IHistogramQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HistogramQuery message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HistogramQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.HistogramQuery; + + /** + * Decodes a HistogramQuery message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HistogramQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.HistogramQuery; + + /** + * Verifies a HistogramQuery message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HistogramQuery message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HistogramQuery + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.HistogramQuery; + + /** + * Creates a plain object from a HistogramQuery message. Also converts values to other types if specified. + * @param message HistogramQuery + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.HistogramQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HistogramQuery to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HistogramQuery + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HistogramQueryResult. */ + interface IHistogramQueryResult { + + /** HistogramQueryResult histogramQuery */ + histogramQuery?: (string|null); + + /** HistogramQueryResult histogram */ + histogram?: ({ [k: string]: (number|Long|string) }|null); + } + + /** Represents a HistogramQueryResult. */ + class HistogramQueryResult implements IHistogramQueryResult { + + /** + * Constructs a new HistogramQueryResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IHistogramQueryResult); + + /** HistogramQueryResult histogramQuery. */ + public histogramQuery: string; + + /** HistogramQueryResult histogram. */ + public histogram: { [k: string]: (number|Long|string) }; + + /** + * Creates a new HistogramQueryResult instance using the specified properties. + * @param [properties] Properties to set + * @returns HistogramQueryResult instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IHistogramQueryResult): google.cloud.talent.v4beta1.HistogramQueryResult; + + /** + * Encodes the specified HistogramQueryResult message. Does not implicitly {@link google.cloud.talent.v4beta1.HistogramQueryResult.verify|verify} messages. + * @param message HistogramQueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IHistogramQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HistogramQueryResult message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.HistogramQueryResult.verify|verify} messages. + * @param message HistogramQueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IHistogramQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HistogramQueryResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HistogramQueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.HistogramQueryResult; + + /** + * Decodes a HistogramQueryResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HistogramQueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.HistogramQueryResult; + + /** + * Verifies a HistogramQueryResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HistogramQueryResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HistogramQueryResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.HistogramQueryResult; + + /** + * Creates a plain object from a HistogramQueryResult message. Also converts values to other types if specified. + * @param message HistogramQueryResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.HistogramQueryResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HistogramQueryResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HistogramQueryResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Job. */ + interface IJob { + + /** Job name */ + name?: (string|null); + + /** Job company */ + company?: (string|null); + + /** Job requisitionId */ + requisitionId?: (string|null); + + /** Job title */ + title?: (string|null); + + /** Job description */ + description?: (string|null); + + /** Job addresses */ + addresses?: (string[]|null); + + /** Job applicationInfo */ + applicationInfo?: (google.cloud.talent.v4beta1.Job.IApplicationInfo|null); + + /** Job jobBenefits */ + jobBenefits?: (google.cloud.talent.v4beta1.JobBenefit[]|null); + + /** Job compensationInfo */ + compensationInfo?: (google.cloud.talent.v4beta1.ICompensationInfo|null); + + /** Job customAttributes */ + customAttributes?: ({ [k: string]: google.cloud.talent.v4beta1.ICustomAttribute }|null); + + /** Job degreeTypes */ + degreeTypes?: (google.cloud.talent.v4beta1.DegreeType[]|null); + + /** Job department */ + department?: (string|null); + + /** Job employmentTypes */ + employmentTypes?: (google.cloud.talent.v4beta1.EmploymentType[]|null); + + /** Job incentives */ + incentives?: (string|null); + + /** Job languageCode */ + languageCode?: (string|null); + + /** Job jobLevel */ + jobLevel?: (google.cloud.talent.v4beta1.JobLevel|keyof typeof google.cloud.talent.v4beta1.JobLevel|null); + + /** Job promotionValue */ + promotionValue?: (number|null); + + /** Job qualifications */ + qualifications?: (string|null); + + /** Job responsibilities */ + responsibilities?: (string|null); + + /** Job postingRegion */ + postingRegion?: (google.cloud.talent.v4beta1.PostingRegion|keyof typeof google.cloud.talent.v4beta1.PostingRegion|null); + + /** Job visibility */ + visibility?: (google.cloud.talent.v4beta1.Visibility|keyof typeof google.cloud.talent.v4beta1.Visibility|null); + + /** Job jobStartTime */ + jobStartTime?: (google.protobuf.ITimestamp|null); + + /** Job jobEndTime */ + jobEndTime?: (google.protobuf.ITimestamp|null); + + /** Job postingPublishTime */ + postingPublishTime?: (google.protobuf.ITimestamp|null); + + /** Job postingExpireTime */ + postingExpireTime?: (google.protobuf.ITimestamp|null); + + /** Job postingCreateTime */ + postingCreateTime?: (google.protobuf.ITimestamp|null); + + /** Job postingUpdateTime */ + postingUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Job companyDisplayName */ + companyDisplayName?: (string|null); + + /** Job derivedInfo */ + derivedInfo?: (google.cloud.talent.v4beta1.Job.IDerivedInfo|null); + + /** Job processingOptions */ + processingOptions?: (google.cloud.talent.v4beta1.Job.IProcessingOptions|null); + } + + /** Represents a Job. */ + class Job implements IJob { + + /** + * Constructs a new Job. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IJob); + + /** Job name. */ + public name: string; + + /** Job company. */ + public company: string; + + /** Job requisitionId. */ + public requisitionId: string; + + /** Job title. */ + public title: string; + + /** Job description. */ + public description: string; + + /** Job addresses. */ + public addresses: string[]; + + /** Job applicationInfo. */ + public applicationInfo?: (google.cloud.talent.v4beta1.Job.IApplicationInfo|null); + + /** Job jobBenefits. */ + public jobBenefits: google.cloud.talent.v4beta1.JobBenefit[]; + + /** Job compensationInfo. */ + public compensationInfo?: (google.cloud.talent.v4beta1.ICompensationInfo|null); + + /** Job customAttributes. */ + public customAttributes: { [k: string]: google.cloud.talent.v4beta1.ICustomAttribute }; + + /** Job degreeTypes. */ + public degreeTypes: google.cloud.talent.v4beta1.DegreeType[]; + + /** Job department. */ + public department: string; + + /** Job employmentTypes. */ + public employmentTypes: google.cloud.talent.v4beta1.EmploymentType[]; + + /** Job incentives. */ + public incentives: string; + + /** Job languageCode. */ + public languageCode: string; + + /** Job jobLevel. */ + public jobLevel: (google.cloud.talent.v4beta1.JobLevel|keyof typeof google.cloud.talent.v4beta1.JobLevel); + + /** Job promotionValue. */ + public promotionValue: number; + + /** Job qualifications. */ + public qualifications: string; + + /** Job responsibilities. */ + public responsibilities: string; + + /** Job postingRegion. */ + public postingRegion: (google.cloud.talent.v4beta1.PostingRegion|keyof typeof google.cloud.talent.v4beta1.PostingRegion); + + /** Job visibility. */ + public visibility: (google.cloud.talent.v4beta1.Visibility|keyof typeof google.cloud.talent.v4beta1.Visibility); + + /** Job jobStartTime. */ + public jobStartTime?: (google.protobuf.ITimestamp|null); + + /** Job jobEndTime. */ + public jobEndTime?: (google.protobuf.ITimestamp|null); + + /** Job postingPublishTime. */ + public postingPublishTime?: (google.protobuf.ITimestamp|null); + + /** Job postingExpireTime. */ + public postingExpireTime?: (google.protobuf.ITimestamp|null); + + /** Job postingCreateTime. */ + public postingCreateTime?: (google.protobuf.ITimestamp|null); + + /** Job postingUpdateTime. */ + public postingUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Job companyDisplayName. */ + public companyDisplayName: string; + + /** Job derivedInfo. */ + public derivedInfo?: (google.cloud.talent.v4beta1.Job.IDerivedInfo|null); + + /** Job processingOptions. */ + public processingOptions?: (google.cloud.talent.v4beta1.Job.IProcessingOptions|null); + + /** + * Creates a new Job instance using the specified properties. + * @param [properties] Properties to set + * @returns Job instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IJob): google.cloud.talent.v4beta1.Job; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.talent.v4beta1.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Job message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.Job; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.Job; + + /** + * Verifies a Job message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Job + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.Job; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @param message Job + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.Job, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Job to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Job + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Job { + + /** Properties of an ApplicationInfo. */ + interface IApplicationInfo { + + /** ApplicationInfo emails */ + emails?: (string[]|null); + + /** ApplicationInfo instruction */ + instruction?: (string|null); + + /** ApplicationInfo uris */ + uris?: (string[]|null); + } + + /** Represents an ApplicationInfo. */ + class ApplicationInfo implements IApplicationInfo { + + /** + * Constructs a new ApplicationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.Job.IApplicationInfo); + + /** ApplicationInfo emails. */ + public emails: string[]; + + /** ApplicationInfo instruction. */ + public instruction: string; + + /** ApplicationInfo uris. */ + public uris: string[]; + + /** + * Creates a new ApplicationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ApplicationInfo instance + */ + public static create(properties?: google.cloud.talent.v4beta1.Job.IApplicationInfo): google.cloud.talent.v4beta1.Job.ApplicationInfo; + + /** + * Encodes the specified ApplicationInfo message. Does not implicitly {@link google.cloud.talent.v4beta1.Job.ApplicationInfo.verify|verify} messages. + * @param message ApplicationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.Job.IApplicationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApplicationInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.Job.ApplicationInfo.verify|verify} messages. + * @param message ApplicationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.Job.IApplicationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApplicationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApplicationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.Job.ApplicationInfo; + + /** + * Decodes an ApplicationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApplicationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.Job.ApplicationInfo; + + /** + * Verifies an ApplicationInfo message. + * @param message Plain 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 ApplicationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApplicationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.Job.ApplicationInfo; + + /** + * Creates a plain object from an ApplicationInfo message. Also converts values to other types if specified. + * @param message ApplicationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.Job.ApplicationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApplicationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApplicationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DerivedInfo. */ + interface IDerivedInfo { + + /** DerivedInfo locations */ + locations?: (google.cloud.talent.v4beta1.ILocation[]|null); + + /** DerivedInfo jobCategories */ + jobCategories?: (google.cloud.talent.v4beta1.JobCategory[]|null); + } + + /** Represents a DerivedInfo. */ + class DerivedInfo implements IDerivedInfo { + + /** + * Constructs a new DerivedInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.Job.IDerivedInfo); + + /** DerivedInfo locations. */ + public locations: google.cloud.talent.v4beta1.ILocation[]; + + /** DerivedInfo jobCategories. */ + public jobCategories: google.cloud.talent.v4beta1.JobCategory[]; + + /** + * Creates a new DerivedInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DerivedInfo instance + */ + public static create(properties?: google.cloud.talent.v4beta1.Job.IDerivedInfo): google.cloud.talent.v4beta1.Job.DerivedInfo; + + /** + * Encodes the specified DerivedInfo message. Does not implicitly {@link google.cloud.talent.v4beta1.Job.DerivedInfo.verify|verify} messages. + * @param message DerivedInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.Job.IDerivedInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DerivedInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.Job.DerivedInfo.verify|verify} messages. + * @param message DerivedInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.Job.IDerivedInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DerivedInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DerivedInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.Job.DerivedInfo; + + /** + * Decodes a DerivedInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DerivedInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.Job.DerivedInfo; + + /** + * Verifies a DerivedInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DerivedInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DerivedInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.Job.DerivedInfo; + + /** + * Creates a plain object from a DerivedInfo message. Also converts values to other types if specified. + * @param message DerivedInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.Job.DerivedInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DerivedInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DerivedInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ProcessingOptions. */ + interface IProcessingOptions { + + /** ProcessingOptions disableStreetAddressResolution */ + disableStreetAddressResolution?: (boolean|null); + + /** ProcessingOptions htmlSanitization */ + htmlSanitization?: (google.cloud.talent.v4beta1.HtmlSanitization|keyof typeof google.cloud.talent.v4beta1.HtmlSanitization|null); + } + + /** Represents a ProcessingOptions. */ + class ProcessingOptions implements IProcessingOptions { + + /** + * Constructs a new ProcessingOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.Job.IProcessingOptions); + + /** ProcessingOptions disableStreetAddressResolution. */ + public disableStreetAddressResolution: boolean; + + /** ProcessingOptions htmlSanitization. */ + public htmlSanitization: (google.cloud.talent.v4beta1.HtmlSanitization|keyof typeof google.cloud.talent.v4beta1.HtmlSanitization); + + /** + * Creates a new ProcessingOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessingOptions instance + */ + public static create(properties?: google.cloud.talent.v4beta1.Job.IProcessingOptions): google.cloud.talent.v4beta1.Job.ProcessingOptions; + + /** + * Encodes the specified ProcessingOptions message. Does not implicitly {@link google.cloud.talent.v4beta1.Job.ProcessingOptions.verify|verify} messages. + * @param message ProcessingOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.Job.IProcessingOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessingOptions message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.Job.ProcessingOptions.verify|verify} messages. + * @param message ProcessingOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.Job.IProcessingOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessingOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.Job.ProcessingOptions; + + /** + * Decodes a ProcessingOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.Job.ProcessingOptions; + + /** + * Verifies a ProcessingOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProcessingOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessingOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.Job.ProcessingOptions; + + /** + * Creates a plain object from a ProcessingOptions message. Also converts values to other types if specified. + * @param message ProcessingOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.Job.ProcessingOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessingOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessingOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a JobService */ + class JobService extends $protobuf.rpc.Service { + + /** + * Constructs a new JobService 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 JobService 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): JobService; + + /** + * Calls CreateJob. + * @param request CreateJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public createJob(request: google.cloud.talent.v4beta1.ICreateJobRequest, callback: google.cloud.talent.v4beta1.JobService.CreateJobCallback): void; + + /** + * Calls CreateJob. + * @param request CreateJobRequest message or plain object + * @returns Promise + */ + public createJob(request: google.cloud.talent.v4beta1.ICreateJobRequest): Promise; + + /** + * Calls BatchCreateJobs. + * @param request BatchCreateJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchCreateJobs(request: google.cloud.talent.v4beta1.IBatchCreateJobsRequest, callback: google.cloud.talent.v4beta1.JobService.BatchCreateJobsCallback): void; + + /** + * Calls BatchCreateJobs. + * @param request BatchCreateJobsRequest message or plain object + * @returns Promise + */ + public batchCreateJobs(request: google.cloud.talent.v4beta1.IBatchCreateJobsRequest): Promise; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public getJob(request: google.cloud.talent.v4beta1.IGetJobRequest, callback: google.cloud.talent.v4beta1.JobService.GetJobCallback): void; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @returns Promise + */ + public getJob(request: google.cloud.talent.v4beta1.IGetJobRequest): Promise; + + /** + * Calls UpdateJob. + * @param request UpdateJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public updateJob(request: google.cloud.talent.v4beta1.IUpdateJobRequest, callback: google.cloud.talent.v4beta1.JobService.UpdateJobCallback): void; + + /** + * Calls UpdateJob. + * @param request UpdateJobRequest message or plain object + * @returns Promise + */ + public updateJob(request: google.cloud.talent.v4beta1.IUpdateJobRequest): Promise; + + /** + * Calls BatchUpdateJobs. + * @param request BatchUpdateJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchUpdateJobs(request: google.cloud.talent.v4beta1.IBatchUpdateJobsRequest, callback: google.cloud.talent.v4beta1.JobService.BatchUpdateJobsCallback): void; + + /** + * Calls BatchUpdateJobs. + * @param request BatchUpdateJobsRequest message or plain object + * @returns Promise + */ + public batchUpdateJobs(request: google.cloud.talent.v4beta1.IBatchUpdateJobsRequest): Promise; + + /** + * Calls DeleteJob. + * @param request DeleteJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteJob(request: google.cloud.talent.v4beta1.IDeleteJobRequest, callback: google.cloud.talent.v4beta1.JobService.DeleteJobCallback): void; + + /** + * Calls DeleteJob. + * @param request DeleteJobRequest message or plain object + * @returns Promise + */ + public deleteJob(request: google.cloud.talent.v4beta1.IDeleteJobRequest): Promise; + + /** + * Calls BatchDeleteJobs. + * @param request BatchDeleteJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public batchDeleteJobs(request: google.cloud.talent.v4beta1.IBatchDeleteJobsRequest, callback: google.cloud.talent.v4beta1.JobService.BatchDeleteJobsCallback): void; + + /** + * Calls BatchDeleteJobs. + * @param request BatchDeleteJobsRequest message or plain object + * @returns Promise + */ + public batchDeleteJobs(request: google.cloud.talent.v4beta1.IBatchDeleteJobsRequest): Promise; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListJobsResponse + */ + public listJobs(request: google.cloud.talent.v4beta1.IListJobsRequest, callback: google.cloud.talent.v4beta1.JobService.ListJobsCallback): void; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @returns Promise + */ + public listJobs(request: google.cloud.talent.v4beta1.IListJobsRequest): Promise; + + /** + * Calls SearchJobs. + * @param request SearchJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchJobsResponse + */ + public searchJobs(request: google.cloud.talent.v4beta1.ISearchJobsRequest, callback: google.cloud.talent.v4beta1.JobService.SearchJobsCallback): void; + + /** + * Calls SearchJobs. + * @param request SearchJobsRequest message or plain object + * @returns Promise + */ + public searchJobs(request: google.cloud.talent.v4beta1.ISearchJobsRequest): Promise; + + /** + * Calls SearchJobsForAlert. + * @param request SearchJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchJobsResponse + */ + public searchJobsForAlert(request: google.cloud.talent.v4beta1.ISearchJobsRequest, callback: google.cloud.talent.v4beta1.JobService.SearchJobsForAlertCallback): void; + + /** + * Calls SearchJobsForAlert. + * @param request SearchJobsRequest message or plain object + * @returns Promise + */ + public searchJobsForAlert(request: google.cloud.talent.v4beta1.ISearchJobsRequest): Promise; + } + + namespace JobService { + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.JobService|createJob}. + * @param error Error, if any + * @param [response] Job + */ + type CreateJobCallback = (error: (Error|null), response?: google.cloud.talent.v4beta1.Job) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.JobService|batchCreateJobs}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchCreateJobsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.JobService|getJob}. + * @param error Error, if any + * @param [response] Job + */ + type GetJobCallback = (error: (Error|null), response?: google.cloud.talent.v4beta1.Job) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.JobService|updateJob}. + * @param error Error, if any + * @param [response] Job + */ + type UpdateJobCallback = (error: (Error|null), response?: google.cloud.talent.v4beta1.Job) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.JobService|batchUpdateJobs}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchUpdateJobsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.JobService|deleteJob}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteJobCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.JobService|batchDeleteJobs}. + * @param error Error, if any + * @param [response] Empty + */ + type BatchDeleteJobsCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.JobService|listJobs}. + * @param error Error, if any + * @param [response] ListJobsResponse + */ + type ListJobsCallback = (error: (Error|null), response?: google.cloud.talent.v4beta1.ListJobsResponse) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.JobService|searchJobs}. + * @param error Error, if any + * @param [response] SearchJobsResponse + */ + type SearchJobsCallback = (error: (Error|null), response?: google.cloud.talent.v4beta1.SearchJobsResponse) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.JobService|searchJobsForAlert}. + * @param error Error, if any + * @param [response] SearchJobsResponse + */ + type SearchJobsForAlertCallback = (error: (Error|null), response?: google.cloud.talent.v4beta1.SearchJobsResponse) => void; + } + + /** Properties of a CreateJobRequest. */ + interface ICreateJobRequest { + + /** CreateJobRequest parent */ + parent?: (string|null); + + /** CreateJobRequest job */ + job?: (google.cloud.talent.v4beta1.IJob|null); + } + + /** Represents a CreateJobRequest. */ + class CreateJobRequest implements ICreateJobRequest { + + /** + * Constructs a new CreateJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.ICreateJobRequest); + + /** CreateJobRequest parent. */ + public parent: string; + + /** CreateJobRequest job. */ + public job?: (google.cloud.talent.v4beta1.IJob|null); + + /** + * Creates a new CreateJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateJobRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.ICreateJobRequest): google.cloud.talent.v4beta1.CreateJobRequest; + + /** + * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.CreateJobRequest.verify|verify} messages. + * @param message CreateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CreateJobRequest.verify|verify} messages. + * @param message CreateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.CreateJobRequest; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.CreateJobRequest; + + /** + * Verifies a CreateJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.CreateJobRequest; + + /** + * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. + * @param message CreateJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.CreateJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetJobRequest. */ + interface IGetJobRequest { + + /** GetJobRequest name */ + name?: (string|null); + } + + /** Represents a GetJobRequest. */ + class GetJobRequest implements IGetJobRequest { + + /** + * Constructs a new GetJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IGetJobRequest); + + /** GetJobRequest name. */ + public name: string; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetJobRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IGetJobRequest): google.cloud.talent.v4beta1.GetJobRequest; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.GetJobRequest; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.GetJobRequest; + + /** + * Verifies a GetJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.GetJobRequest; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @param message GetJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.GetJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateJobRequest. */ + interface IUpdateJobRequest { + + /** UpdateJobRequest job */ + job?: (google.cloud.talent.v4beta1.IJob|null); + + /** UpdateJobRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateJobRequest. */ + class UpdateJobRequest implements IUpdateJobRequest { + + /** + * Constructs a new UpdateJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IUpdateJobRequest); + + /** UpdateJobRequest job. */ + public job?: (google.cloud.talent.v4beta1.IJob|null); + + /** UpdateJobRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateJobRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IUpdateJobRequest): google.cloud.talent.v4beta1.UpdateJobRequest; + + /** + * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.UpdateJobRequest.verify|verify} messages. + * @param message UpdateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IUpdateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.UpdateJobRequest.verify|verify} messages. + * @param message UpdateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IUpdateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.UpdateJobRequest; + + /** + * Decodes an UpdateJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.UpdateJobRequest; + + /** + * Verifies an UpdateJobRequest message. + * @param message Plain 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 UpdateJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.UpdateJobRequest; + + /** + * Creates a plain object from an UpdateJobRequest message. Also converts values to other types if specified. + * @param message UpdateJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.UpdateJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteJobRequest. */ + interface IDeleteJobRequest { + + /** DeleteJobRequest name */ + name?: (string|null); + } + + /** Represents a DeleteJobRequest. */ + class DeleteJobRequest implements IDeleteJobRequest { + + /** + * Constructs a new DeleteJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IDeleteJobRequest); + + /** DeleteJobRequest name. */ + public name: string; + + /** + * Creates a new DeleteJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteJobRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IDeleteJobRequest): google.cloud.talent.v4beta1.DeleteJobRequest; + + /** + * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.DeleteJobRequest.verify|verify} messages. + * @param message DeleteJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.DeleteJobRequest.verify|verify} messages. + * @param message DeleteJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.DeleteJobRequest; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.DeleteJobRequest; + + /** + * Verifies a DeleteJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.DeleteJobRequest; + + /** + * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. + * @param message DeleteJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.DeleteJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDeleteJobsRequest. */ + interface IBatchDeleteJobsRequest { + + /** BatchDeleteJobsRequest parent */ + parent?: (string|null); + + /** BatchDeleteJobsRequest filter */ + filter?: (string|null); + } + + /** Represents a BatchDeleteJobsRequest. */ + class BatchDeleteJobsRequest implements IBatchDeleteJobsRequest { + + /** + * Constructs a new BatchDeleteJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IBatchDeleteJobsRequest); + + /** BatchDeleteJobsRequest parent. */ + public parent: string; + + /** BatchDeleteJobsRequest filter. */ + public filter: string; + + /** + * Creates a new BatchDeleteJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteJobsRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IBatchDeleteJobsRequest): google.cloud.talent.v4beta1.BatchDeleteJobsRequest; + + /** + * Encodes the specified BatchDeleteJobsRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.BatchDeleteJobsRequest.verify|verify} messages. + * @param message BatchDeleteJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IBatchDeleteJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDeleteJobsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.BatchDeleteJobsRequest.verify|verify} messages. + * @param message BatchDeleteJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IBatchDeleteJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDeleteJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.BatchDeleteJobsRequest; + + /** + * Decodes a BatchDeleteJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.BatchDeleteJobsRequest; + + /** + * Verifies a BatchDeleteJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDeleteJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.BatchDeleteJobsRequest; + + /** + * Creates a plain object from a BatchDeleteJobsRequest message. Also converts values to other types if specified. + * @param message BatchDeleteJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.BatchDeleteJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDeleteJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDeleteJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** JobView enum. */ + enum JobView { + JOB_VIEW_UNSPECIFIED = 0, + JOB_VIEW_ID_ONLY = 1, + JOB_VIEW_MINIMAL = 2, + JOB_VIEW_SMALL = 3, + JOB_VIEW_FULL = 4 + } + + /** Properties of a ListJobsRequest. */ + interface IListJobsRequest { + + /** ListJobsRequest parent */ + parent?: (string|null); + + /** ListJobsRequest filter */ + filter?: (string|null); + + /** ListJobsRequest pageToken */ + pageToken?: (string|null); + + /** ListJobsRequest pageSize */ + pageSize?: (number|null); + + /** ListJobsRequest jobView */ + jobView?: (google.cloud.talent.v4beta1.JobView|keyof typeof google.cloud.talent.v4beta1.JobView|null); + } + + /** Represents a ListJobsRequest. */ + class ListJobsRequest implements IListJobsRequest { + + /** + * Constructs a new ListJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IListJobsRequest); + + /** ListJobsRequest parent. */ + public parent: string; + + /** ListJobsRequest filter. */ + public filter: string; + + /** ListJobsRequest pageToken. */ + public pageToken: string; + + /** ListJobsRequest pageSize. */ + public pageSize: number; + + /** ListJobsRequest jobView. */ + public jobView: (google.cloud.talent.v4beta1.JobView|keyof typeof google.cloud.talent.v4beta1.JobView); + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IListJobsRequest): google.cloud.talent.v4beta1.ListJobsRequest; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.ListJobsRequest; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.ListJobsRequest; + + /** + * Verifies a ListJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.ListJobsRequest; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @param message ListJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.ListJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobsResponse. */ + interface IListJobsResponse { + + /** ListJobsResponse jobs */ + jobs?: (google.cloud.talent.v4beta1.IJob[]|null); + + /** ListJobsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListJobsResponse metadata */ + metadata?: (google.cloud.talent.v4beta1.IResponseMetadata|null); + } + + /** Represents a ListJobsResponse. */ + class ListJobsResponse implements IListJobsResponse { + + /** + * Constructs a new ListJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IListJobsResponse); + + /** ListJobsResponse jobs. */ + public jobs: google.cloud.talent.v4beta1.IJob[]; + + /** ListJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListJobsResponse metadata. */ + public metadata?: (google.cloud.talent.v4beta1.IResponseMetadata|null); + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsResponse instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IListJobsResponse): google.cloud.talent.v4beta1.ListJobsResponse; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.talent.v4beta1.ListJobsResponse.verify|verify} messages. + * @param message ListJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.ListJobsResponse.verify|verify} messages. + * @param message ListJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.ListJobsResponse; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.ListJobsResponse; + + /** + * Verifies a ListJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.ListJobsResponse; + + /** + * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. + * @param message ListJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.ListJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchJobsRequest. */ + interface ISearchJobsRequest { + + /** SearchJobsRequest parent */ + parent?: (string|null); + + /** SearchJobsRequest searchMode */ + searchMode?: (google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode|keyof typeof google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode|null); + + /** SearchJobsRequest requestMetadata */ + requestMetadata?: (google.cloud.talent.v4beta1.IRequestMetadata|null); + + /** SearchJobsRequest jobQuery */ + jobQuery?: (google.cloud.talent.v4beta1.IJobQuery|null); + + /** SearchJobsRequest enableBroadening */ + enableBroadening?: (boolean|null); + + /** SearchJobsRequest requirePreciseResultSize */ + requirePreciseResultSize?: (boolean|null); + + /** SearchJobsRequest histogramQueries */ + histogramQueries?: (google.cloud.talent.v4beta1.IHistogramQuery[]|null); + + /** SearchJobsRequest jobView */ + jobView?: (google.cloud.talent.v4beta1.JobView|keyof typeof google.cloud.talent.v4beta1.JobView|null); + + /** SearchJobsRequest offset */ + offset?: (number|null); + + /** SearchJobsRequest pageSize */ + pageSize?: (number|null); + + /** SearchJobsRequest pageToken */ + pageToken?: (string|null); + + /** SearchJobsRequest orderBy */ + orderBy?: (string|null); + + /** SearchJobsRequest diversificationLevel */ + diversificationLevel?: (google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel|keyof typeof google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel|null); + + /** SearchJobsRequest customRankingInfo */ + customRankingInfo?: (google.cloud.talent.v4beta1.SearchJobsRequest.ICustomRankingInfo|null); + + /** SearchJobsRequest disableKeywordMatch */ + disableKeywordMatch?: (boolean|null); + + /** SearchJobsRequest keywordMatchMode */ + keywordMatchMode?: (google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode|keyof typeof google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode|null); + } + + /** Represents a SearchJobsRequest. */ + class SearchJobsRequest implements ISearchJobsRequest { + + /** + * Constructs a new SearchJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.ISearchJobsRequest); + + /** SearchJobsRequest parent. */ + public parent: string; + + /** SearchJobsRequest searchMode. */ + public searchMode: (google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode|keyof typeof google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode); + + /** SearchJobsRequest requestMetadata. */ + public requestMetadata?: (google.cloud.talent.v4beta1.IRequestMetadata|null); + + /** SearchJobsRequest jobQuery. */ + public jobQuery?: (google.cloud.talent.v4beta1.IJobQuery|null); + + /** SearchJobsRequest enableBroadening. */ + public enableBroadening: boolean; + + /** SearchJobsRequest requirePreciseResultSize. */ + public requirePreciseResultSize: boolean; + + /** SearchJobsRequest histogramQueries. */ + public histogramQueries: google.cloud.talent.v4beta1.IHistogramQuery[]; + + /** SearchJobsRequest jobView. */ + public jobView: (google.cloud.talent.v4beta1.JobView|keyof typeof google.cloud.talent.v4beta1.JobView); + + /** SearchJobsRequest offset. */ + public offset: number; + + /** SearchJobsRequest pageSize. */ + public pageSize: number; + + /** SearchJobsRequest pageToken. */ + public pageToken: string; + + /** SearchJobsRequest orderBy. */ + public orderBy: string; + + /** SearchJobsRequest diversificationLevel. */ + public diversificationLevel: (google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel|keyof typeof google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel); + + /** SearchJobsRequest customRankingInfo. */ + public customRankingInfo?: (google.cloud.talent.v4beta1.SearchJobsRequest.ICustomRankingInfo|null); + + /** SearchJobsRequest disableKeywordMatch. */ + public disableKeywordMatch: boolean; + + /** SearchJobsRequest keywordMatchMode. */ + public keywordMatchMode: (google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode|keyof typeof google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode); + + /** + * Creates a new SearchJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchJobsRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.ISearchJobsRequest): google.cloud.talent.v4beta1.SearchJobsRequest; + + /** + * Encodes the specified SearchJobsRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.SearchJobsRequest.verify|verify} messages. + * @param message SearchJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.ISearchJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchJobsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.SearchJobsRequest.verify|verify} messages. + * @param message SearchJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.ISearchJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.SearchJobsRequest; + + /** + * Decodes a SearchJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.SearchJobsRequest; + + /** + * Verifies a SearchJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.SearchJobsRequest; + + /** + * Creates a plain object from a SearchJobsRequest message. Also converts values to other types if specified. + * @param message SearchJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.SearchJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SearchJobsRequest { + + /** SearchMode enum. */ + enum SearchMode { + SEARCH_MODE_UNSPECIFIED = 0, + JOB_SEARCH = 1, + FEATURED_JOB_SEARCH = 2 + } + + /** DiversificationLevel enum. */ + enum DiversificationLevel { + DIVERSIFICATION_LEVEL_UNSPECIFIED = 0, + DISABLED = 1, + SIMPLE = 2 + } + + /** KeywordMatchMode enum. */ + enum KeywordMatchMode { + KEYWORD_MATCH_MODE_UNSPECIFIED = 0, + KEYWORD_MATCH_DISABLED = 1, + KEYWORD_MATCH_ALL = 2, + KEYWORD_MATCH_TITLE_ONLY = 3 + } + + /** Properties of a CustomRankingInfo. */ + interface ICustomRankingInfo { + + /** CustomRankingInfo importanceLevel */ + importanceLevel?: (google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ImportanceLevel|keyof typeof google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ImportanceLevel|null); + + /** CustomRankingInfo rankingExpression */ + rankingExpression?: (string|null); + } + + /** Represents a CustomRankingInfo. */ + class CustomRankingInfo implements ICustomRankingInfo { + + /** + * Constructs a new CustomRankingInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.SearchJobsRequest.ICustomRankingInfo); + + /** CustomRankingInfo importanceLevel. */ + public importanceLevel: (google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ImportanceLevel|keyof typeof google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ImportanceLevel); + + /** CustomRankingInfo rankingExpression. */ + public rankingExpression: string; + + /** + * Creates a new CustomRankingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomRankingInfo instance + */ + public static create(properties?: google.cloud.talent.v4beta1.SearchJobsRequest.ICustomRankingInfo): google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo; + + /** + * Encodes the specified CustomRankingInfo message. Does not implicitly {@link google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.verify|verify} messages. + * @param message CustomRankingInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.SearchJobsRequest.ICustomRankingInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomRankingInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.verify|verify} messages. + * @param message CustomRankingInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.SearchJobsRequest.ICustomRankingInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomRankingInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomRankingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo; + + /** + * Decodes a CustomRankingInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomRankingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo; + + /** + * Verifies a CustomRankingInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomRankingInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomRankingInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo; + + /** + * Creates a plain object from a CustomRankingInfo message. Also converts values to other types if specified. + * @param message CustomRankingInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomRankingInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomRankingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CustomRankingInfo { + + /** ImportanceLevel enum. */ + enum ImportanceLevel { + IMPORTANCE_LEVEL_UNSPECIFIED = 0, + NONE = 1, + LOW = 2, + MILD = 3, + MEDIUM = 4, + HIGH = 5, + EXTREME = 6 + } + } + } + + /** Properties of a SearchJobsResponse. */ + interface ISearchJobsResponse { + + /** SearchJobsResponse matchingJobs */ + matchingJobs?: (google.cloud.talent.v4beta1.SearchJobsResponse.IMatchingJob[]|null); + + /** SearchJobsResponse histogramQueryResults */ + histogramQueryResults?: (google.cloud.talent.v4beta1.IHistogramQueryResult[]|null); + + /** SearchJobsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** SearchJobsResponse locationFilters */ + locationFilters?: (google.cloud.talent.v4beta1.ILocation[]|null); + + /** SearchJobsResponse estimatedTotalSize */ + estimatedTotalSize?: (number|null); + + /** SearchJobsResponse totalSize */ + totalSize?: (number|null); + + /** SearchJobsResponse metadata */ + metadata?: (google.cloud.talent.v4beta1.IResponseMetadata|null); + + /** SearchJobsResponse broadenedQueryJobsCount */ + broadenedQueryJobsCount?: (number|null); + + /** SearchJobsResponse spellCorrection */ + spellCorrection?: (google.cloud.talent.v4beta1.ISpellingCorrection|null); + } + + /** Represents a SearchJobsResponse. */ + class SearchJobsResponse implements ISearchJobsResponse { + + /** + * Constructs a new SearchJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.ISearchJobsResponse); + + /** SearchJobsResponse matchingJobs. */ + public matchingJobs: google.cloud.talent.v4beta1.SearchJobsResponse.IMatchingJob[]; + + /** SearchJobsResponse histogramQueryResults. */ + public histogramQueryResults: google.cloud.talent.v4beta1.IHistogramQueryResult[]; + + /** SearchJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** SearchJobsResponse locationFilters. */ + public locationFilters: google.cloud.talent.v4beta1.ILocation[]; + + /** SearchJobsResponse estimatedTotalSize. */ + public estimatedTotalSize: number; + + /** SearchJobsResponse totalSize. */ + public totalSize: number; + + /** SearchJobsResponse metadata. */ + public metadata?: (google.cloud.talent.v4beta1.IResponseMetadata|null); + + /** SearchJobsResponse broadenedQueryJobsCount. */ + public broadenedQueryJobsCount: number; + + /** SearchJobsResponse spellCorrection. */ + public spellCorrection?: (google.cloud.talent.v4beta1.ISpellingCorrection|null); + + /** + * Creates a new SearchJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchJobsResponse instance + */ + public static create(properties?: google.cloud.talent.v4beta1.ISearchJobsResponse): google.cloud.talent.v4beta1.SearchJobsResponse; + + /** + * Encodes the specified SearchJobsResponse message. Does not implicitly {@link google.cloud.talent.v4beta1.SearchJobsResponse.verify|verify} messages. + * @param message SearchJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.ISearchJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchJobsResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.SearchJobsResponse.verify|verify} messages. + * @param message SearchJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.ISearchJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.SearchJobsResponse; + + /** + * Decodes a SearchJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.SearchJobsResponse; + + /** + * Verifies a SearchJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.SearchJobsResponse; + + /** + * Creates a plain object from a SearchJobsResponse message. Also converts values to other types if specified. + * @param message SearchJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.SearchJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SearchJobsResponse { + + /** Properties of a MatchingJob. */ + interface IMatchingJob { + + /** MatchingJob job */ + job?: (google.cloud.talent.v4beta1.IJob|null); + + /** MatchingJob jobSummary */ + jobSummary?: (string|null); + + /** MatchingJob jobTitleSnippet */ + jobTitleSnippet?: (string|null); + + /** MatchingJob searchTextSnippet */ + searchTextSnippet?: (string|null); + + /** MatchingJob commuteInfo */ + commuteInfo?: (google.cloud.talent.v4beta1.SearchJobsResponse.ICommuteInfo|null); + } + + /** Represents a MatchingJob. */ + class MatchingJob implements IMatchingJob { + + /** + * Constructs a new MatchingJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.SearchJobsResponse.IMatchingJob); + + /** MatchingJob job. */ + public job?: (google.cloud.talent.v4beta1.IJob|null); + + /** MatchingJob jobSummary. */ + public jobSummary: string; + + /** MatchingJob jobTitleSnippet. */ + public jobTitleSnippet: string; + + /** MatchingJob searchTextSnippet. */ + public searchTextSnippet: string; + + /** MatchingJob commuteInfo. */ + public commuteInfo?: (google.cloud.talent.v4beta1.SearchJobsResponse.ICommuteInfo|null); + + /** + * Creates a new MatchingJob instance using the specified properties. + * @param [properties] Properties to set + * @returns MatchingJob instance + */ + public static create(properties?: google.cloud.talent.v4beta1.SearchJobsResponse.IMatchingJob): google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob; + + /** + * Encodes the specified MatchingJob message. Does not implicitly {@link google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob.verify|verify} messages. + * @param message MatchingJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.SearchJobsResponse.IMatchingJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MatchingJob message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob.verify|verify} messages. + * @param message MatchingJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.SearchJobsResponse.IMatchingJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MatchingJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MatchingJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob; + + /** + * Decodes a MatchingJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MatchingJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob; + + /** + * Verifies a MatchingJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MatchingJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MatchingJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob; + + /** + * Creates a plain object from a MatchingJob message. Also converts values to other types if specified. + * @param message MatchingJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MatchingJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MatchingJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommuteInfo. */ + interface ICommuteInfo { + + /** CommuteInfo jobLocation */ + jobLocation?: (google.cloud.talent.v4beta1.ILocation|null); + + /** CommuteInfo travelDuration */ + travelDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a CommuteInfo. */ + class CommuteInfo implements ICommuteInfo { + + /** + * Constructs a new CommuteInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.SearchJobsResponse.ICommuteInfo); + + /** CommuteInfo jobLocation. */ + public jobLocation?: (google.cloud.talent.v4beta1.ILocation|null); + + /** CommuteInfo travelDuration. */ + public travelDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new CommuteInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns CommuteInfo instance + */ + public static create(properties?: google.cloud.talent.v4beta1.SearchJobsResponse.ICommuteInfo): google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo; + + /** + * Encodes the specified CommuteInfo message. Does not implicitly {@link google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo.verify|verify} messages. + * @param message CommuteInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.SearchJobsResponse.ICommuteInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommuteInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo.verify|verify} messages. + * @param message CommuteInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.SearchJobsResponse.ICommuteInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommuteInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommuteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo; + + /** + * Decodes a CommuteInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommuteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo; + + /** + * Verifies a CommuteInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommuteInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommuteInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo; + + /** + * Creates a plain object from a CommuteInfo message. Also converts values to other types if specified. + * @param message CommuteInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommuteInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommuteInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a BatchCreateJobsRequest. */ + interface IBatchCreateJobsRequest { + + /** BatchCreateJobsRequest parent */ + parent?: (string|null); + + /** BatchCreateJobsRequest jobs */ + jobs?: (google.cloud.talent.v4beta1.IJob[]|null); + } + + /** Represents a BatchCreateJobsRequest. */ + class BatchCreateJobsRequest implements IBatchCreateJobsRequest { + + /** + * Constructs a new BatchCreateJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IBatchCreateJobsRequest); + + /** BatchCreateJobsRequest parent. */ + public parent: string; + + /** BatchCreateJobsRequest jobs. */ + public jobs: google.cloud.talent.v4beta1.IJob[]; + + /** + * Creates a new BatchCreateJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateJobsRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IBatchCreateJobsRequest): google.cloud.talent.v4beta1.BatchCreateJobsRequest; + + /** + * Encodes the specified BatchCreateJobsRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.BatchCreateJobsRequest.verify|verify} messages. + * @param message BatchCreateJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IBatchCreateJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateJobsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.BatchCreateJobsRequest.verify|verify} messages. + * @param message BatchCreateJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IBatchCreateJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.BatchCreateJobsRequest; + + /** + * Decodes a BatchCreateJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.BatchCreateJobsRequest; + + /** + * Verifies a BatchCreateJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.BatchCreateJobsRequest; + + /** + * Creates a plain object from a BatchCreateJobsRequest message. Also converts values to other types if specified. + * @param message BatchCreateJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.BatchCreateJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchUpdateJobsRequest. */ + interface IBatchUpdateJobsRequest { + + /** BatchUpdateJobsRequest parent */ + parent?: (string|null); + + /** BatchUpdateJobsRequest jobs */ + jobs?: (google.cloud.talent.v4beta1.IJob[]|null); + + /** BatchUpdateJobsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a BatchUpdateJobsRequest. */ + class BatchUpdateJobsRequest implements IBatchUpdateJobsRequest { + + /** + * Constructs a new BatchUpdateJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IBatchUpdateJobsRequest); + + /** BatchUpdateJobsRequest parent. */ + public parent: string; + + /** BatchUpdateJobsRequest jobs. */ + public jobs: google.cloud.talent.v4beta1.IJob[]; + + /** BatchUpdateJobsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new BatchUpdateJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchUpdateJobsRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IBatchUpdateJobsRequest): google.cloud.talent.v4beta1.BatchUpdateJobsRequest; + + /** + * Encodes the specified BatchUpdateJobsRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.BatchUpdateJobsRequest.verify|verify} messages. + * @param message BatchUpdateJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IBatchUpdateJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchUpdateJobsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.BatchUpdateJobsRequest.verify|verify} messages. + * @param message BatchUpdateJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IBatchUpdateJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchUpdateJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchUpdateJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.BatchUpdateJobsRequest; + + /** + * Decodes a BatchUpdateJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchUpdateJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.BatchUpdateJobsRequest; + + /** + * Verifies a BatchUpdateJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchUpdateJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchUpdateJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.BatchUpdateJobsRequest; + + /** + * Creates a plain object from a BatchUpdateJobsRequest message. Also converts values to other types if specified. + * @param message BatchUpdateJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.BatchUpdateJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchUpdateJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchUpdateJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobOperationResult. */ + interface IJobOperationResult { + + /** JobOperationResult jobResults */ + jobResults?: (google.cloud.talent.v4beta1.JobOperationResult.IJobResult[]|null); + } + + /** Represents a JobOperationResult. */ + class JobOperationResult implements IJobOperationResult { + + /** + * Constructs a new JobOperationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IJobOperationResult); + + /** JobOperationResult jobResults. */ + public jobResults: google.cloud.talent.v4beta1.JobOperationResult.IJobResult[]; + + /** + * Creates a new JobOperationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns JobOperationResult instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IJobOperationResult): google.cloud.talent.v4beta1.JobOperationResult; + + /** + * Encodes the specified JobOperationResult message. Does not implicitly {@link google.cloud.talent.v4beta1.JobOperationResult.verify|verify} messages. + * @param message JobOperationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IJobOperationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobOperationResult message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.JobOperationResult.verify|verify} messages. + * @param message JobOperationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IJobOperationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobOperationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobOperationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.JobOperationResult; + + /** + * Decodes a JobOperationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobOperationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.JobOperationResult; + + /** + * Verifies a JobOperationResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobOperationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobOperationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.JobOperationResult; + + /** + * Creates a plain object from a JobOperationResult message. Also converts values to other types if specified. + * @param message JobOperationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.JobOperationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobOperationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobOperationResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobOperationResult { + + /** Properties of a JobResult. */ + interface IJobResult { + + /** JobResult job */ + job?: (google.cloud.talent.v4beta1.IJob|null); + + /** JobResult status */ + status?: (google.rpc.IStatus|null); + } + + /** Represents a JobResult. */ + class JobResult implements IJobResult { + + /** + * Constructs a new JobResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.JobOperationResult.IJobResult); + + /** JobResult job. */ + public job?: (google.cloud.talent.v4beta1.IJob|null); + + /** JobResult status. */ + public status?: (google.rpc.IStatus|null); + + /** + * Creates a new JobResult instance using the specified properties. + * @param [properties] Properties to set + * @returns JobResult instance + */ + public static create(properties?: google.cloud.talent.v4beta1.JobOperationResult.IJobResult): google.cloud.talent.v4beta1.JobOperationResult.JobResult; + + /** + * Encodes the specified JobResult message. Does not implicitly {@link google.cloud.talent.v4beta1.JobOperationResult.JobResult.verify|verify} messages. + * @param message JobResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.JobOperationResult.IJobResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobResult message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.JobOperationResult.JobResult.verify|verify} messages. + * @param message JobResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.JobOperationResult.IJobResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.JobOperationResult.JobResult; + + /** + * Decodes a JobResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.JobOperationResult.JobResult; + + /** + * Verifies a JobResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.JobOperationResult.JobResult; + + /** + * Creates a plain object from a JobResult message. Also converts values to other types if specified. + * @param message JobResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.JobOperationResult.JobResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Tenant. */ + interface ITenant { + + /** Tenant name */ + name?: (string|null); + + /** Tenant externalId */ + externalId?: (string|null); + + /** Tenant usageType */ + usageType?: (google.cloud.talent.v4beta1.Tenant.DataUsageType|keyof typeof google.cloud.talent.v4beta1.Tenant.DataUsageType|null); + + /** Tenant keywordSearchableProfileCustomAttributes */ + keywordSearchableProfileCustomAttributes?: (string[]|null); + } + + /** Represents a Tenant. */ + class Tenant implements ITenant { + + /** + * Constructs a new Tenant. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.ITenant); + + /** Tenant name. */ + public name: string; + + /** Tenant externalId. */ + public externalId: string; + + /** Tenant usageType. */ + public usageType: (google.cloud.talent.v4beta1.Tenant.DataUsageType|keyof typeof google.cloud.talent.v4beta1.Tenant.DataUsageType); + + /** Tenant keywordSearchableProfileCustomAttributes. */ + public keywordSearchableProfileCustomAttributes: string[]; + + /** + * Creates a new Tenant instance using the specified properties. + * @param [properties] Properties to set + * @returns Tenant instance + */ + public static create(properties?: google.cloud.talent.v4beta1.ITenant): google.cloud.talent.v4beta1.Tenant; + + /** + * Encodes the specified Tenant message. Does not implicitly {@link google.cloud.talent.v4beta1.Tenant.verify|verify} messages. + * @param message Tenant message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.ITenant, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Tenant message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.Tenant.verify|verify} messages. + * @param message Tenant message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.ITenant, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Tenant message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Tenant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.Tenant; + + /** + * Decodes a Tenant message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Tenant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.Tenant; + + /** + * Verifies a Tenant message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Tenant message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Tenant + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.Tenant; + + /** + * Creates a plain object from a Tenant message. Also converts values to other types if specified. + * @param message Tenant + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.Tenant, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Tenant to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Tenant + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Tenant { + + /** DataUsageType enum. */ + enum DataUsageType { + DATA_USAGE_TYPE_UNSPECIFIED = 0, + AGGREGATED = 1, + ISOLATED = 2 + } + } + + /** Represents a TenantService */ + class TenantService extends $protobuf.rpc.Service { + + /** + * Constructs a new TenantService 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 TenantService 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): TenantService; + + /** + * Calls CreateTenant. + * @param request CreateTenantRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tenant + */ + public createTenant(request: google.cloud.talent.v4beta1.ICreateTenantRequest, callback: google.cloud.talent.v4beta1.TenantService.CreateTenantCallback): void; + + /** + * Calls CreateTenant. + * @param request CreateTenantRequest message or plain object + * @returns Promise + */ + public createTenant(request: google.cloud.talent.v4beta1.ICreateTenantRequest): Promise; + + /** + * Calls GetTenant. + * @param request GetTenantRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tenant + */ + public getTenant(request: google.cloud.talent.v4beta1.IGetTenantRequest, callback: google.cloud.talent.v4beta1.TenantService.GetTenantCallback): void; + + /** + * Calls GetTenant. + * @param request GetTenantRequest message or plain object + * @returns Promise + */ + public getTenant(request: google.cloud.talent.v4beta1.IGetTenantRequest): Promise; + + /** + * Calls UpdateTenant. + * @param request UpdateTenantRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tenant + */ + public updateTenant(request: google.cloud.talent.v4beta1.IUpdateTenantRequest, callback: google.cloud.talent.v4beta1.TenantService.UpdateTenantCallback): void; + + /** + * Calls UpdateTenant. + * @param request UpdateTenantRequest message or plain object + * @returns Promise + */ + public updateTenant(request: google.cloud.talent.v4beta1.IUpdateTenantRequest): Promise; + + /** + * Calls DeleteTenant. + * @param request DeleteTenantRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTenant(request: google.cloud.talent.v4beta1.IDeleteTenantRequest, callback: google.cloud.talent.v4beta1.TenantService.DeleteTenantCallback): void; + + /** + * Calls DeleteTenant. + * @param request DeleteTenantRequest message or plain object + * @returns Promise + */ + public deleteTenant(request: google.cloud.talent.v4beta1.IDeleteTenantRequest): Promise; + + /** + * Calls ListTenants. + * @param request ListTenantsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTenantsResponse + */ + public listTenants(request: google.cloud.talent.v4beta1.IListTenantsRequest, callback: google.cloud.talent.v4beta1.TenantService.ListTenantsCallback): void; + + /** + * Calls ListTenants. + * @param request ListTenantsRequest message or plain object + * @returns Promise + */ + public listTenants(request: google.cloud.talent.v4beta1.IListTenantsRequest): Promise; + } + + namespace TenantService { + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.TenantService|createTenant}. + * @param error Error, if any + * @param [response] Tenant + */ + type CreateTenantCallback = (error: (Error|null), response?: google.cloud.talent.v4beta1.Tenant) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.TenantService|getTenant}. + * @param error Error, if any + * @param [response] Tenant + */ + type GetTenantCallback = (error: (Error|null), response?: google.cloud.talent.v4beta1.Tenant) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.TenantService|updateTenant}. + * @param error Error, if any + * @param [response] Tenant + */ + type UpdateTenantCallback = (error: (Error|null), response?: google.cloud.talent.v4beta1.Tenant) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.TenantService|deleteTenant}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteTenantCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.TenantService|listTenants}. + * @param error Error, if any + * @param [response] ListTenantsResponse + */ + type ListTenantsCallback = (error: (Error|null), response?: google.cloud.talent.v4beta1.ListTenantsResponse) => void; + } + + /** Properties of a CreateTenantRequest. */ + interface ICreateTenantRequest { + + /** CreateTenantRequest parent */ + parent?: (string|null); + + /** CreateTenantRequest tenant */ + tenant?: (google.cloud.talent.v4beta1.ITenant|null); + } + + /** Represents a CreateTenantRequest. */ + class CreateTenantRequest implements ICreateTenantRequest { + + /** + * Constructs a new CreateTenantRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.ICreateTenantRequest); + + /** CreateTenantRequest parent. */ + public parent: string; + + /** CreateTenantRequest tenant. */ + public tenant?: (google.cloud.talent.v4beta1.ITenant|null); + + /** + * Creates a new CreateTenantRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTenantRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.ICreateTenantRequest): google.cloud.talent.v4beta1.CreateTenantRequest; + + /** + * Encodes the specified CreateTenantRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.CreateTenantRequest.verify|verify} messages. + * @param message CreateTenantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.ICreateTenantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTenantRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CreateTenantRequest.verify|verify} messages. + * @param message CreateTenantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.ICreateTenantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTenantRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.CreateTenantRequest; + + /** + * Decodes a CreateTenantRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.CreateTenantRequest; + + /** + * Verifies a CreateTenantRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTenantRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTenantRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.CreateTenantRequest; + + /** + * Creates a plain object from a CreateTenantRequest message. Also converts values to other types if specified. + * @param message CreateTenantRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.CreateTenantRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTenantRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTenantRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTenantRequest. */ + interface IGetTenantRequest { + + /** GetTenantRequest name */ + name?: (string|null); + } + + /** Represents a GetTenantRequest. */ + class GetTenantRequest implements IGetTenantRequest { + + /** + * Constructs a new GetTenantRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IGetTenantRequest); + + /** GetTenantRequest name. */ + public name: string; + + /** + * Creates a new GetTenantRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTenantRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IGetTenantRequest): google.cloud.talent.v4beta1.GetTenantRequest; + + /** + * Encodes the specified GetTenantRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.GetTenantRequest.verify|verify} messages. + * @param message GetTenantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IGetTenantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTenantRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.GetTenantRequest.verify|verify} messages. + * @param message GetTenantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IGetTenantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTenantRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.GetTenantRequest; + + /** + * Decodes a GetTenantRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.GetTenantRequest; + + /** + * Verifies a GetTenantRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTenantRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTenantRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.GetTenantRequest; + + /** + * Creates a plain object from a GetTenantRequest message. Also converts values to other types if specified. + * @param message GetTenantRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.GetTenantRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTenantRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTenantRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTenantRequest. */ + interface IUpdateTenantRequest { + + /** UpdateTenantRequest tenant */ + tenant?: (google.cloud.talent.v4beta1.ITenant|null); + + /** UpdateTenantRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateTenantRequest. */ + class UpdateTenantRequest implements IUpdateTenantRequest { + + /** + * Constructs a new UpdateTenantRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IUpdateTenantRequest); + + /** UpdateTenantRequest tenant. */ + public tenant?: (google.cloud.talent.v4beta1.ITenant|null); + + /** UpdateTenantRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateTenantRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTenantRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IUpdateTenantRequest): google.cloud.talent.v4beta1.UpdateTenantRequest; + + /** + * Encodes the specified UpdateTenantRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.UpdateTenantRequest.verify|verify} messages. + * @param message UpdateTenantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IUpdateTenantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTenantRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.UpdateTenantRequest.verify|verify} messages. + * @param message UpdateTenantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IUpdateTenantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTenantRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.UpdateTenantRequest; + + /** + * Decodes an UpdateTenantRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.UpdateTenantRequest; + + /** + * Verifies an UpdateTenantRequest message. + * @param message Plain 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 UpdateTenantRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTenantRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.UpdateTenantRequest; + + /** + * Creates a plain object from an UpdateTenantRequest message. Also converts values to other types if specified. + * @param message UpdateTenantRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.UpdateTenantRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTenantRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTenantRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTenantRequest. */ + interface IDeleteTenantRequest { + + /** DeleteTenantRequest name */ + name?: (string|null); + } + + /** Represents a DeleteTenantRequest. */ + class DeleteTenantRequest implements IDeleteTenantRequest { + + /** + * Constructs a new DeleteTenantRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IDeleteTenantRequest); + + /** DeleteTenantRequest name. */ + public name: string; + + /** + * Creates a new DeleteTenantRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTenantRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IDeleteTenantRequest): google.cloud.talent.v4beta1.DeleteTenantRequest; + + /** + * Encodes the specified DeleteTenantRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.DeleteTenantRequest.verify|verify} messages. + * @param message DeleteTenantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IDeleteTenantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTenantRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.DeleteTenantRequest.verify|verify} messages. + * @param message DeleteTenantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IDeleteTenantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTenantRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.DeleteTenantRequest; + + /** + * Decodes a DeleteTenantRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.DeleteTenantRequest; + + /** + * Verifies a DeleteTenantRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTenantRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTenantRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.DeleteTenantRequest; + + /** + * Creates a plain object from a DeleteTenantRequest message. Also converts values to other types if specified. + * @param message DeleteTenantRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.DeleteTenantRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTenantRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTenantRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTenantsRequest. */ + interface IListTenantsRequest { + + /** ListTenantsRequest parent */ + parent?: (string|null); + + /** ListTenantsRequest pageToken */ + pageToken?: (string|null); + + /** ListTenantsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListTenantsRequest. */ + class ListTenantsRequest implements IListTenantsRequest { + + /** + * Constructs a new ListTenantsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IListTenantsRequest); + + /** ListTenantsRequest parent. */ + public parent: string; + + /** ListTenantsRequest pageToken. */ + public pageToken: string; + + /** ListTenantsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListTenantsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTenantsRequest instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IListTenantsRequest): google.cloud.talent.v4beta1.ListTenantsRequest; + + /** + * Encodes the specified ListTenantsRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.ListTenantsRequest.verify|verify} messages. + * @param message ListTenantsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IListTenantsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTenantsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.ListTenantsRequest.verify|verify} messages. + * @param message ListTenantsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IListTenantsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTenantsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTenantsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.ListTenantsRequest; + + /** + * Decodes a ListTenantsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTenantsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.ListTenantsRequest; + + /** + * Verifies a ListTenantsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTenantsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTenantsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.ListTenantsRequest; + + /** + * Creates a plain object from a ListTenantsRequest message. Also converts values to other types if specified. + * @param message ListTenantsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.ListTenantsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTenantsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTenantsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTenantsResponse. */ + interface IListTenantsResponse { + + /** ListTenantsResponse tenants */ + tenants?: (google.cloud.talent.v4beta1.ITenant[]|null); + + /** ListTenantsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListTenantsResponse metadata */ + metadata?: (google.cloud.talent.v4beta1.IResponseMetadata|null); + } + + /** Represents a ListTenantsResponse. */ + class ListTenantsResponse implements IListTenantsResponse { + + /** + * Constructs a new ListTenantsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.talent.v4beta1.IListTenantsResponse); + + /** ListTenantsResponse tenants. */ + public tenants: google.cloud.talent.v4beta1.ITenant[]; + + /** ListTenantsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListTenantsResponse metadata. */ + public metadata?: (google.cloud.talent.v4beta1.IResponseMetadata|null); + + /** + * Creates a new ListTenantsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTenantsResponse instance + */ + public static create(properties?: google.cloud.talent.v4beta1.IListTenantsResponse): google.cloud.talent.v4beta1.ListTenantsResponse; + + /** + * Encodes the specified ListTenantsResponse message. Does not implicitly {@link google.cloud.talent.v4beta1.ListTenantsResponse.verify|verify} messages. + * @param message ListTenantsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.talent.v4beta1.IListTenantsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTenantsResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.ListTenantsResponse.verify|verify} messages. + * @param message ListTenantsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.talent.v4beta1.IListTenantsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTenantsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTenantsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.talent.v4beta1.ListTenantsResponse; + + /** + * Decodes a ListTenantsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTenantsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.talent.v4beta1.ListTenantsResponse; + + /** + * Verifies a ListTenantsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTenantsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTenantsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.talent.v4beta1.ListTenantsResponse; + + /** + * Creates a plain object from a ListTenantsResponse message. Also converts values to other types if specified. + * @param message ListTenantsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.talent.v4beta1.ListTenantsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTenantsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTenantsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a 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 a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not 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.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload 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.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not 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.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload 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.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not 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.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload 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.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain 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 Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not 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.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload 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.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not 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.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload 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.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain 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 Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not 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.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload 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.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not 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.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload 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.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not 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.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload 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.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not 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.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload 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.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @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 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 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; + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of a LatLng. */ + interface ILatLng { + + /** LatLng latitude */ + latitude?: (number|null); + + /** LatLng longitude */ + longitude?: (number|null); + } + + /** Represents a LatLng. */ + class LatLng implements ILatLng { + + /** + * Constructs a new LatLng. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ILatLng); + + /** LatLng latitude. */ + public latitude: number; + + /** LatLng longitude. */ + public longitude: number; + + /** + * Creates a new LatLng instance using the specified properties. + * @param [properties] Properties to set + * @returns LatLng instance + */ + public static create(properties?: google.type.ILatLng): google.type.LatLng; + + /** + * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @param message LatLng message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @param message LatLng message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LatLng message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.LatLng; + + /** + * Decodes a LatLng message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.LatLng; + + /** + * Verifies a LatLng message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LatLng message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LatLng + */ + public static fromObject(object: { [k: string]: any }): google.type.LatLng; + + /** + * Creates a plain object from a LatLng message. Also converts values to other types if specified. + * @param message LatLng + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.LatLng, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LatLng to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LatLng + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Money. */ + interface IMoney { + + /** Money currencyCode */ + currencyCode?: (string|null); + + /** Money units */ + units?: (number|Long|string|null); + + /** Money nanos */ + nanos?: (number|null); + } + + /** Represents a Money. */ + class Money implements IMoney { + + /** + * Constructs a new Money. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IMoney); + + /** Money currencyCode. */ + public currencyCode: string; + + /** Money units. */ + public units: (number|Long|string); + + /** Money nanos. */ + public nanos: number; + + /** + * Creates a new Money instance using the specified properties. + * @param [properties] Properties to set + * @returns Money instance + */ + public static create(properties?: google.type.IMoney): google.type.Money; + + /** + * Encodes the specified Money message. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @param message Money message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IMoney, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Money message, length delimited. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @param message Money message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IMoney, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Money message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Money; + + /** + * Decodes a Money message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Money; + + /** + * Verifies a Money message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Money message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Money + */ + public static fromObject(object: { [k: string]: any }): google.type.Money; + + /** + * Creates a plain object from a Money message. Also converts values to other types if specified. + * @param message Money + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Money, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Money to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Money + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PostalAddress. */ + interface IPostalAddress { + + /** PostalAddress revision */ + revision?: (number|null); + + /** PostalAddress regionCode */ + regionCode?: (string|null); + + /** PostalAddress languageCode */ + languageCode?: (string|null); + + /** PostalAddress postalCode */ + postalCode?: (string|null); + + /** PostalAddress sortingCode */ + sortingCode?: (string|null); + + /** PostalAddress administrativeArea */ + administrativeArea?: (string|null); + + /** PostalAddress locality */ + locality?: (string|null); + + /** PostalAddress sublocality */ + sublocality?: (string|null); + + /** PostalAddress addressLines */ + addressLines?: (string[]|null); + + /** PostalAddress recipients */ + recipients?: (string[]|null); + + /** PostalAddress organization */ + organization?: (string|null); + } + + /** Represents a PostalAddress. */ + class PostalAddress implements IPostalAddress { + + /** + * Constructs a new PostalAddress. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IPostalAddress); + + /** PostalAddress revision. */ + public revision: number; + + /** PostalAddress regionCode. */ + public regionCode: string; + + /** PostalAddress languageCode. */ + public languageCode: string; + + /** PostalAddress postalCode. */ + public postalCode: string; + + /** PostalAddress sortingCode. */ + public sortingCode: string; + + /** PostalAddress administrativeArea. */ + public administrativeArea: string; + + /** PostalAddress locality. */ + public locality: string; + + /** PostalAddress sublocality. */ + public sublocality: string; + + /** PostalAddress addressLines. */ + public addressLines: string[]; + + /** PostalAddress recipients. */ + public recipients: string[]; + + /** PostalAddress organization. */ + public organization: string; + + /** + * Creates a new PostalAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns PostalAddress instance + */ + public static create(properties?: google.type.IPostalAddress): google.type.PostalAddress; + + /** + * Encodes the specified PostalAddress message. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. + * @param message PostalAddress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IPostalAddress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PostalAddress message, length delimited. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. + * @param message PostalAddress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IPostalAddress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PostalAddress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PostalAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.PostalAddress; + + /** + * Decodes a PostalAddress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PostalAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.PostalAddress; + + /** + * Verifies a PostalAddress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PostalAddress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PostalAddress + */ + public static fromObject(object: { [k: string]: any }): google.type.PostalAddress; + + /** + * Creates a plain object from a PostalAddress message. Also converts values to other types if specified. + * @param message PostalAddress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.PostalAddress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PostalAddress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PostalAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeOfDay. */ + interface ITimeOfDay { + + /** TimeOfDay hours */ + hours?: (number|null); + + /** TimeOfDay minutes */ + minutes?: (number|null); + + /** TimeOfDay seconds */ + seconds?: (number|null); + + /** TimeOfDay nanos */ + nanos?: (number|null); + } + + /** Represents a TimeOfDay. */ + class TimeOfDay implements ITimeOfDay { + + /** + * Constructs a new TimeOfDay. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ITimeOfDay); + + /** TimeOfDay hours. */ + public hours: number; + + /** TimeOfDay minutes. */ + public minutes: number; + + /** TimeOfDay seconds. */ + public seconds: number; + + /** TimeOfDay nanos. */ + public nanos: number; + + /** + * Creates a new TimeOfDay instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeOfDay instance + */ + public static create(properties?: google.type.ITimeOfDay): google.type.TimeOfDay; + + /** + * Encodes the specified TimeOfDay message. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @param message TimeOfDay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ITimeOfDay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeOfDay message, length delimited. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @param message TimeOfDay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ITimeOfDay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.TimeOfDay; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.TimeOfDay; + + /** + * Verifies a TimeOfDay message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeOfDay message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeOfDay + */ + public static fromObject(object: { [k: string]: any }): google.type.TimeOfDay; + + /** + * Creates a plain object from a TimeOfDay message. Also converts values to other types if specified. + * @param message TimeOfDay + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.TimeOfDay, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeOfDay to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeOfDay + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-talent/protos/protos.js b/packages/google-cloud-talent/protos/protos.js new file mode 100644 index 00000000000..c13dc51470f --- /dev/null +++ b/packages/google-cloud-talent/protos/protos.js @@ -0,0 +1,58430 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_talent_protos || ($protobuf.roots._google_cloud_talent_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.talent = (function() { + + /** + * Namespace talent. + * @memberof google.cloud + * @namespace + */ + var talent = {}; + + talent.v4 = (function() { + + /** + * Namespace v4. + * @memberof google.cloud.talent + * @namespace + */ + var v4 = {}; + + v4.TimestampRange = (function() { + + /** + * Properties of a TimestampRange. + * @memberof google.cloud.talent.v4 + * @interface ITimestampRange + * @property {google.protobuf.ITimestamp|null} [startTime] TimestampRange startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimestampRange endTime + */ + + /** + * Constructs a new TimestampRange. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a TimestampRange. + * @implements ITimestampRange + * @constructor + * @param {google.cloud.talent.v4.ITimestampRange=} [properties] Properties to set + */ + function TimestampRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimestampRange startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.talent.v4.TimestampRange + * @instance + */ + TimestampRange.prototype.startTime = null; + + /** + * TimestampRange endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.talent.v4.TimestampRange + * @instance + */ + TimestampRange.prototype.endTime = null; + + /** + * Creates a new TimestampRange instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.TimestampRange + * @static + * @param {google.cloud.talent.v4.ITimestampRange=} [properties] Properties to set + * @returns {google.cloud.talent.v4.TimestampRange} TimestampRange instance + */ + TimestampRange.create = function create(properties) { + return new TimestampRange(properties); + }; + + /** + * Encodes the specified TimestampRange message. Does not implicitly {@link google.cloud.talent.v4.TimestampRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.TimestampRange + * @static + * @param {google.cloud.talent.v4.ITimestampRange} message TimestampRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimestampRange message, length delimited. Does not implicitly {@link google.cloud.talent.v4.TimestampRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.TimestampRange + * @static + * @param {google.cloud.talent.v4.ITimestampRange} message TimestampRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimestampRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.TimestampRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.TimestampRange} TimestampRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.TimestampRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimestampRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.TimestampRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.TimestampRange} TimestampRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimestampRange message. + * @function verify + * @memberof google.cloud.talent.v4.TimestampRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimestampRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a TimestampRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.TimestampRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.TimestampRange} TimestampRange + */ + TimestampRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.TimestampRange) + return object; + var message = new $root.google.cloud.talent.v4.TimestampRange(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.talent.v4.TimestampRange.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.talent.v4.TimestampRange.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a TimestampRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.TimestampRange + * @static + * @param {google.cloud.talent.v4.TimestampRange} message TimestampRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimestampRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this TimestampRange to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.TimestampRange + * @instance + * @returns {Object.} JSON object + */ + TimestampRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimestampRange + * @function getTypeUrl + * @memberof google.cloud.talent.v4.TimestampRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.TimestampRange"; + }; + + return TimestampRange; + })(); + + /** + * CompanySize enum. + * @name google.cloud.talent.v4.CompanySize + * @enum {number} + * @property {number} COMPANY_SIZE_UNSPECIFIED=0 COMPANY_SIZE_UNSPECIFIED value + * @property {number} MINI=1 MINI value + * @property {number} SMALL=2 SMALL value + * @property {number} SMEDIUM=3 SMEDIUM value + * @property {number} MEDIUM=4 MEDIUM value + * @property {number} BIG=5 BIG value + * @property {number} BIGGER=6 BIGGER value + * @property {number} GIANT=7 GIANT value + */ + v4.CompanySize = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPANY_SIZE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MINI"] = 1; + values[valuesById[2] = "SMALL"] = 2; + values[valuesById[3] = "SMEDIUM"] = 3; + values[valuesById[4] = "MEDIUM"] = 4; + values[valuesById[5] = "BIG"] = 5; + values[valuesById[6] = "BIGGER"] = 6; + values[valuesById[7] = "GIANT"] = 7; + return values; + })(); + + /** + * JobBenefit enum. + * @name google.cloud.talent.v4.JobBenefit + * @enum {number} + * @property {number} JOB_BENEFIT_UNSPECIFIED=0 JOB_BENEFIT_UNSPECIFIED value + * @property {number} CHILD_CARE=1 CHILD_CARE value + * @property {number} DENTAL=2 DENTAL value + * @property {number} DOMESTIC_PARTNER=3 DOMESTIC_PARTNER value + * @property {number} FLEXIBLE_HOURS=4 FLEXIBLE_HOURS value + * @property {number} MEDICAL=5 MEDICAL value + * @property {number} LIFE_INSURANCE=6 LIFE_INSURANCE value + * @property {number} PARENTAL_LEAVE=7 PARENTAL_LEAVE value + * @property {number} RETIREMENT_PLAN=8 RETIREMENT_PLAN value + * @property {number} SICK_DAYS=9 SICK_DAYS value + * @property {number} VACATION=10 VACATION value + * @property {number} VISION=11 VISION value + */ + v4.JobBenefit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_BENEFIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "CHILD_CARE"] = 1; + values[valuesById[2] = "DENTAL"] = 2; + values[valuesById[3] = "DOMESTIC_PARTNER"] = 3; + values[valuesById[4] = "FLEXIBLE_HOURS"] = 4; + values[valuesById[5] = "MEDICAL"] = 5; + values[valuesById[6] = "LIFE_INSURANCE"] = 6; + values[valuesById[7] = "PARENTAL_LEAVE"] = 7; + values[valuesById[8] = "RETIREMENT_PLAN"] = 8; + values[valuesById[9] = "SICK_DAYS"] = 9; + values[valuesById[10] = "VACATION"] = 10; + values[valuesById[11] = "VISION"] = 11; + return values; + })(); + + /** + * DegreeType enum. + * @name google.cloud.talent.v4.DegreeType + * @enum {number} + * @property {number} DEGREE_TYPE_UNSPECIFIED=0 DEGREE_TYPE_UNSPECIFIED value + * @property {number} PRIMARY_EDUCATION=1 PRIMARY_EDUCATION value + * @property {number} LOWER_SECONDARY_EDUCATION=2 LOWER_SECONDARY_EDUCATION value + * @property {number} UPPER_SECONDARY_EDUCATION=3 UPPER_SECONDARY_EDUCATION value + * @property {number} ADULT_REMEDIAL_EDUCATION=4 ADULT_REMEDIAL_EDUCATION value + * @property {number} ASSOCIATES_OR_EQUIVALENT=5 ASSOCIATES_OR_EQUIVALENT value + * @property {number} BACHELORS_OR_EQUIVALENT=6 BACHELORS_OR_EQUIVALENT value + * @property {number} MASTERS_OR_EQUIVALENT=7 MASTERS_OR_EQUIVALENT value + * @property {number} DOCTORAL_OR_EQUIVALENT=8 DOCTORAL_OR_EQUIVALENT value + */ + v4.DegreeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEGREE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIMARY_EDUCATION"] = 1; + values[valuesById[2] = "LOWER_SECONDARY_EDUCATION"] = 2; + values[valuesById[3] = "UPPER_SECONDARY_EDUCATION"] = 3; + values[valuesById[4] = "ADULT_REMEDIAL_EDUCATION"] = 4; + values[valuesById[5] = "ASSOCIATES_OR_EQUIVALENT"] = 5; + values[valuesById[6] = "BACHELORS_OR_EQUIVALENT"] = 6; + values[valuesById[7] = "MASTERS_OR_EQUIVALENT"] = 7; + values[valuesById[8] = "DOCTORAL_OR_EQUIVALENT"] = 8; + return values; + })(); + + /** + * EmploymentType enum. + * @name google.cloud.talent.v4.EmploymentType + * @enum {number} + * @property {number} EMPLOYMENT_TYPE_UNSPECIFIED=0 EMPLOYMENT_TYPE_UNSPECIFIED value + * @property {number} FULL_TIME=1 FULL_TIME value + * @property {number} PART_TIME=2 PART_TIME value + * @property {number} CONTRACTOR=3 CONTRACTOR value + * @property {number} CONTRACT_TO_HIRE=4 CONTRACT_TO_HIRE value + * @property {number} TEMPORARY=5 TEMPORARY value + * @property {number} INTERN=6 INTERN value + * @property {number} VOLUNTEER=7 VOLUNTEER value + * @property {number} PER_DIEM=8 PER_DIEM value + * @property {number} FLY_IN_FLY_OUT=9 FLY_IN_FLY_OUT value + * @property {number} OTHER_EMPLOYMENT_TYPE=10 OTHER_EMPLOYMENT_TYPE value + */ + v4.EmploymentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EMPLOYMENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FULL_TIME"] = 1; + values[valuesById[2] = "PART_TIME"] = 2; + values[valuesById[3] = "CONTRACTOR"] = 3; + values[valuesById[4] = "CONTRACT_TO_HIRE"] = 4; + values[valuesById[5] = "TEMPORARY"] = 5; + values[valuesById[6] = "INTERN"] = 6; + values[valuesById[7] = "VOLUNTEER"] = 7; + values[valuesById[8] = "PER_DIEM"] = 8; + values[valuesById[9] = "FLY_IN_FLY_OUT"] = 9; + values[valuesById[10] = "OTHER_EMPLOYMENT_TYPE"] = 10; + return values; + })(); + + /** + * JobLevel enum. + * @name google.cloud.talent.v4.JobLevel + * @enum {number} + * @property {number} JOB_LEVEL_UNSPECIFIED=0 JOB_LEVEL_UNSPECIFIED value + * @property {number} ENTRY_LEVEL=1 ENTRY_LEVEL value + * @property {number} EXPERIENCED=2 EXPERIENCED value + * @property {number} MANAGER=3 MANAGER value + * @property {number} DIRECTOR=4 DIRECTOR value + * @property {number} EXECUTIVE=5 EXECUTIVE value + */ + v4.JobLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENTRY_LEVEL"] = 1; + values[valuesById[2] = "EXPERIENCED"] = 2; + values[valuesById[3] = "MANAGER"] = 3; + values[valuesById[4] = "DIRECTOR"] = 4; + values[valuesById[5] = "EXECUTIVE"] = 5; + return values; + })(); + + /** + * JobCategory enum. + * @name google.cloud.talent.v4.JobCategory + * @enum {number} + * @property {number} JOB_CATEGORY_UNSPECIFIED=0 JOB_CATEGORY_UNSPECIFIED value + * @property {number} ACCOUNTING_AND_FINANCE=1 ACCOUNTING_AND_FINANCE value + * @property {number} ADMINISTRATIVE_AND_OFFICE=2 ADMINISTRATIVE_AND_OFFICE value + * @property {number} ADVERTISING_AND_MARKETING=3 ADVERTISING_AND_MARKETING value + * @property {number} ANIMAL_CARE=4 ANIMAL_CARE value + * @property {number} ART_FASHION_AND_DESIGN=5 ART_FASHION_AND_DESIGN value + * @property {number} BUSINESS_OPERATIONS=6 BUSINESS_OPERATIONS value + * @property {number} CLEANING_AND_FACILITIES=7 CLEANING_AND_FACILITIES value + * @property {number} COMPUTER_AND_IT=8 COMPUTER_AND_IT value + * @property {number} CONSTRUCTION=9 CONSTRUCTION value + * @property {number} CUSTOMER_SERVICE=10 CUSTOMER_SERVICE value + * @property {number} EDUCATION=11 EDUCATION value + * @property {number} ENTERTAINMENT_AND_TRAVEL=12 ENTERTAINMENT_AND_TRAVEL value + * @property {number} FARMING_AND_OUTDOORS=13 FARMING_AND_OUTDOORS value + * @property {number} HEALTHCARE=14 HEALTHCARE value + * @property {number} HUMAN_RESOURCES=15 HUMAN_RESOURCES value + * @property {number} INSTALLATION_MAINTENANCE_AND_REPAIR=16 INSTALLATION_MAINTENANCE_AND_REPAIR value + * @property {number} LEGAL=17 LEGAL value + * @property {number} MANAGEMENT=18 MANAGEMENT value + * @property {number} MANUFACTURING_AND_WAREHOUSE=19 MANUFACTURING_AND_WAREHOUSE value + * @property {number} MEDIA_COMMUNICATIONS_AND_WRITING=20 MEDIA_COMMUNICATIONS_AND_WRITING value + * @property {number} OIL_GAS_AND_MINING=21 OIL_GAS_AND_MINING value + * @property {number} PERSONAL_CARE_AND_SERVICES=22 PERSONAL_CARE_AND_SERVICES value + * @property {number} PROTECTIVE_SERVICES=23 PROTECTIVE_SERVICES value + * @property {number} REAL_ESTATE=24 REAL_ESTATE value + * @property {number} RESTAURANT_AND_HOSPITALITY=25 RESTAURANT_AND_HOSPITALITY value + * @property {number} SALES_AND_RETAIL=26 SALES_AND_RETAIL value + * @property {number} SCIENCE_AND_ENGINEERING=27 SCIENCE_AND_ENGINEERING value + * @property {number} SOCIAL_SERVICES_AND_NON_PROFIT=28 SOCIAL_SERVICES_AND_NON_PROFIT value + * @property {number} SPORTS_FITNESS_AND_RECREATION=29 SPORTS_FITNESS_AND_RECREATION value + * @property {number} TRANSPORTATION_AND_LOGISTICS=30 TRANSPORTATION_AND_LOGISTICS value + */ + v4.JobCategory = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_CATEGORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACCOUNTING_AND_FINANCE"] = 1; + values[valuesById[2] = "ADMINISTRATIVE_AND_OFFICE"] = 2; + values[valuesById[3] = "ADVERTISING_AND_MARKETING"] = 3; + values[valuesById[4] = "ANIMAL_CARE"] = 4; + values[valuesById[5] = "ART_FASHION_AND_DESIGN"] = 5; + values[valuesById[6] = "BUSINESS_OPERATIONS"] = 6; + values[valuesById[7] = "CLEANING_AND_FACILITIES"] = 7; + values[valuesById[8] = "COMPUTER_AND_IT"] = 8; + values[valuesById[9] = "CONSTRUCTION"] = 9; + values[valuesById[10] = "CUSTOMER_SERVICE"] = 10; + values[valuesById[11] = "EDUCATION"] = 11; + values[valuesById[12] = "ENTERTAINMENT_AND_TRAVEL"] = 12; + values[valuesById[13] = "FARMING_AND_OUTDOORS"] = 13; + values[valuesById[14] = "HEALTHCARE"] = 14; + values[valuesById[15] = "HUMAN_RESOURCES"] = 15; + values[valuesById[16] = "INSTALLATION_MAINTENANCE_AND_REPAIR"] = 16; + values[valuesById[17] = "LEGAL"] = 17; + values[valuesById[18] = "MANAGEMENT"] = 18; + values[valuesById[19] = "MANUFACTURING_AND_WAREHOUSE"] = 19; + values[valuesById[20] = "MEDIA_COMMUNICATIONS_AND_WRITING"] = 20; + values[valuesById[21] = "OIL_GAS_AND_MINING"] = 21; + values[valuesById[22] = "PERSONAL_CARE_AND_SERVICES"] = 22; + values[valuesById[23] = "PROTECTIVE_SERVICES"] = 23; + values[valuesById[24] = "REAL_ESTATE"] = 24; + values[valuesById[25] = "RESTAURANT_AND_HOSPITALITY"] = 25; + values[valuesById[26] = "SALES_AND_RETAIL"] = 26; + values[valuesById[27] = "SCIENCE_AND_ENGINEERING"] = 27; + values[valuesById[28] = "SOCIAL_SERVICES_AND_NON_PROFIT"] = 28; + values[valuesById[29] = "SPORTS_FITNESS_AND_RECREATION"] = 29; + values[valuesById[30] = "TRANSPORTATION_AND_LOGISTICS"] = 30; + return values; + })(); + + /** + * PostingRegion enum. + * @name google.cloud.talent.v4.PostingRegion + * @enum {number} + * @property {number} POSTING_REGION_UNSPECIFIED=0 POSTING_REGION_UNSPECIFIED value + * @property {number} ADMINISTRATIVE_AREA=1 ADMINISTRATIVE_AREA value + * @property {number} NATION=2 NATION value + * @property {number} TELECOMMUTE=3 TELECOMMUTE value + */ + v4.PostingRegion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "POSTING_REGION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMINISTRATIVE_AREA"] = 1; + values[valuesById[2] = "NATION"] = 2; + values[valuesById[3] = "TELECOMMUTE"] = 3; + return values; + })(); + + /** + * Visibility enum. + * @name google.cloud.talent.v4.Visibility + * @enum {number} + * @property {number} VISIBILITY_UNSPECIFIED=0 VISIBILITY_UNSPECIFIED value + * @property {number} ACCOUNT_ONLY=1 ACCOUNT_ONLY value + * @property {number} SHARED_WITH_GOOGLE=2 SHARED_WITH_GOOGLE value + * @property {number} SHARED_WITH_PUBLIC=3 SHARED_WITH_PUBLIC value + */ + v4.Visibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACCOUNT_ONLY"] = 1; + values[valuesById[2] = "SHARED_WITH_GOOGLE"] = 2; + values[valuesById[3] = "SHARED_WITH_PUBLIC"] = 3; + return values; + })(); + + /** + * HtmlSanitization enum. + * @name google.cloud.talent.v4.HtmlSanitization + * @enum {number} + * @property {number} HTML_SANITIZATION_UNSPECIFIED=0 HTML_SANITIZATION_UNSPECIFIED value + * @property {number} HTML_SANITIZATION_DISABLED=1 HTML_SANITIZATION_DISABLED value + * @property {number} SIMPLE_FORMATTING_ONLY=2 SIMPLE_FORMATTING_ONLY value + */ + v4.HtmlSanitization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HTML_SANITIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "HTML_SANITIZATION_DISABLED"] = 1; + values[valuesById[2] = "SIMPLE_FORMATTING_ONLY"] = 2; + return values; + })(); + + /** + * CommuteMethod enum. + * @name google.cloud.talent.v4.CommuteMethod + * @enum {number} + * @property {number} COMMUTE_METHOD_UNSPECIFIED=0 COMMUTE_METHOD_UNSPECIFIED value + * @property {number} DRIVING=1 DRIVING value + * @property {number} TRANSIT=2 TRANSIT value + * @property {number} WALKING=3 WALKING value + * @property {number} CYCLING=4 CYCLING value + * @property {number} TRANSIT_ACCESSIBLE=5 TRANSIT_ACCESSIBLE value + */ + v4.CommuteMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMMUTE_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "DRIVING"] = 1; + values[valuesById[2] = "TRANSIT"] = 2; + values[valuesById[3] = "WALKING"] = 3; + values[valuesById[4] = "CYCLING"] = 4; + values[valuesById[5] = "TRANSIT_ACCESSIBLE"] = 5; + return values; + })(); + + v4.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.cloud.talent.v4 + * @interface ILocation + * @property {google.cloud.talent.v4.Location.LocationType|null} [locationType] Location locationType + * @property {google.type.IPostalAddress|null} [postalAddress] Location postalAddress + * @property {google.type.ILatLng|null} [latLng] Location latLng + * @property {number|null} [radiusMiles] Location radiusMiles + */ + + /** + * Constructs a new Location. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.cloud.talent.v4.ILocation=} [properties] Properties to set + */ + function Location(properties) { + if (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 locationType. + * @member {google.cloud.talent.v4.Location.LocationType} locationType + * @memberof google.cloud.talent.v4.Location + * @instance + */ + Location.prototype.locationType = 0; + + /** + * Location postalAddress. + * @member {google.type.IPostalAddress|null|undefined} postalAddress + * @memberof google.cloud.talent.v4.Location + * @instance + */ + Location.prototype.postalAddress = null; + + /** + * Location latLng. + * @member {google.type.ILatLng|null|undefined} latLng + * @memberof google.cloud.talent.v4.Location + * @instance + */ + Location.prototype.latLng = null; + + /** + * Location radiusMiles. + * @member {number} radiusMiles + * @memberof google.cloud.talent.v4.Location + * @instance + */ + Location.prototype.radiusMiles = 0; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.Location + * @static + * @param {google.cloud.talent.v4.ILocation=} [properties] Properties to set + * @returns {google.cloud.talent.v4.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.cloud.talent.v4.Location.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.Location + * @static + * @param {google.cloud.talent.v4.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.locationType != null && Object.hasOwnProperty.call(message, "locationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.locationType); + if (message.postalAddress != null && Object.hasOwnProperty.call(message, "postalAddress")) + $root.google.type.PostalAddress.encode(message.postalAddress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.latLng != null && Object.hasOwnProperty.call(message, "latLng")) + $root.google.type.LatLng.encode(message.latLng, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.radiusMiles != null && Object.hasOwnProperty.call(message, "radiusMiles")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.radiusMiles); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.cloud.talent.v4.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.Location + * @static + * @param {google.cloud.talent.v4.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.cloud.talent.v4.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.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.cloud.talent.v4.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.locationType = reader.int32(); + break; + } + case 2: { + message.postalAddress = $root.google.type.PostalAddress.decode(reader, reader.uint32()); + break; + } + case 3: { + message.latLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + case 4: { + message.radiusMiles = reader.double(); + 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.cloud.talent.v4.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.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.cloud.talent.v4.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.locationType != null && message.hasOwnProperty("locationType")) + switch (message.locationType) { + default: + return "locationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + } + if (message.postalAddress != null && message.hasOwnProperty("postalAddress")) { + var error = $root.google.type.PostalAddress.verify(message.postalAddress); + if (error) + return "postalAddress." + error; + } + if (message.latLng != null && message.hasOwnProperty("latLng")) { + var error = $root.google.type.LatLng.verify(message.latLng); + if (error) + return "latLng." + error; + } + if (message.radiusMiles != null && message.hasOwnProperty("radiusMiles")) + if (typeof message.radiusMiles !== "number") + return "radiusMiles: number expected"; + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.Location + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.Location) + return object; + var message = new $root.google.cloud.talent.v4.Location(); + switch (object.locationType) { + default: + if (typeof object.locationType === "number") { + message.locationType = object.locationType; + break; + } + break; + case "LOCATION_TYPE_UNSPECIFIED": + case 0: + message.locationType = 0; + break; + case "COUNTRY": + case 1: + message.locationType = 1; + break; + case "ADMINISTRATIVE_AREA": + case 2: + message.locationType = 2; + break; + case "SUB_ADMINISTRATIVE_AREA": + case 3: + message.locationType = 3; + break; + case "LOCALITY": + case 4: + message.locationType = 4; + break; + case "POSTAL_CODE": + case 5: + message.locationType = 5; + break; + case "SUB_LOCALITY": + case 6: + message.locationType = 6; + break; + case "SUB_LOCALITY_1": + case 7: + message.locationType = 7; + break; + case "SUB_LOCALITY_2": + case 8: + message.locationType = 8; + break; + case "NEIGHBORHOOD": + case 9: + message.locationType = 9; + break; + case "STREET_ADDRESS": + case 10: + message.locationType = 10; + break; + } + if (object.postalAddress != null) { + if (typeof object.postalAddress !== "object") + throw TypeError(".google.cloud.talent.v4.Location.postalAddress: object expected"); + message.postalAddress = $root.google.type.PostalAddress.fromObject(object.postalAddress); + } + if (object.latLng != null) { + if (typeof object.latLng !== "object") + throw TypeError(".google.cloud.talent.v4.Location.latLng: object expected"); + message.latLng = $root.google.type.LatLng.fromObject(object.latLng); + } + if (object.radiusMiles != null) + message.radiusMiles = Number(object.radiusMiles); + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.Location + * @static + * @param {google.cloud.talent.v4.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.defaults) { + object.locationType = options.enums === String ? "LOCATION_TYPE_UNSPECIFIED" : 0; + object.postalAddress = null; + object.latLng = null; + object.radiusMiles = 0; + } + if (message.locationType != null && message.hasOwnProperty("locationType")) + object.locationType = options.enums === String ? $root.google.cloud.talent.v4.Location.LocationType[message.locationType] === undefined ? message.locationType : $root.google.cloud.talent.v4.Location.LocationType[message.locationType] : message.locationType; + if (message.postalAddress != null && message.hasOwnProperty("postalAddress")) + object.postalAddress = $root.google.type.PostalAddress.toObject(message.postalAddress, options); + if (message.latLng != null && message.hasOwnProperty("latLng")) + object.latLng = $root.google.type.LatLng.toObject(message.latLng, options); + if (message.radiusMiles != null && message.hasOwnProperty("radiusMiles")) + object.radiusMiles = options.json && !isFinite(message.radiusMiles) ? String(message.radiusMiles) : message.radiusMiles; + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.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.cloud.talent.v4.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.cloud.talent.v4.Location"; + }; + + /** + * LocationType enum. + * @name google.cloud.talent.v4.Location.LocationType + * @enum {number} + * @property {number} LOCATION_TYPE_UNSPECIFIED=0 LOCATION_TYPE_UNSPECIFIED value + * @property {number} COUNTRY=1 COUNTRY value + * @property {number} ADMINISTRATIVE_AREA=2 ADMINISTRATIVE_AREA value + * @property {number} SUB_ADMINISTRATIVE_AREA=3 SUB_ADMINISTRATIVE_AREA value + * @property {number} LOCALITY=4 LOCALITY value + * @property {number} POSTAL_CODE=5 POSTAL_CODE value + * @property {number} SUB_LOCALITY=6 SUB_LOCALITY value + * @property {number} SUB_LOCALITY_1=7 SUB_LOCALITY_1 value + * @property {number} SUB_LOCALITY_2=8 SUB_LOCALITY_2 value + * @property {number} NEIGHBORHOOD=9 NEIGHBORHOOD value + * @property {number} STREET_ADDRESS=10 STREET_ADDRESS value + */ + Location.LocationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOCATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COUNTRY"] = 1; + values[valuesById[2] = "ADMINISTRATIVE_AREA"] = 2; + values[valuesById[3] = "SUB_ADMINISTRATIVE_AREA"] = 3; + values[valuesById[4] = "LOCALITY"] = 4; + values[valuesById[5] = "POSTAL_CODE"] = 5; + values[valuesById[6] = "SUB_LOCALITY"] = 6; + values[valuesById[7] = "SUB_LOCALITY_1"] = 7; + values[valuesById[8] = "SUB_LOCALITY_2"] = 8; + values[valuesById[9] = "NEIGHBORHOOD"] = 9; + values[valuesById[10] = "STREET_ADDRESS"] = 10; + return values; + })(); + + return Location; + })(); + + v4.RequestMetadata = (function() { + + /** + * Properties of a RequestMetadata. + * @memberof google.cloud.talent.v4 + * @interface IRequestMetadata + * @property {string|null} [domain] RequestMetadata domain + * @property {string|null} [sessionId] RequestMetadata sessionId + * @property {string|null} [userId] RequestMetadata userId + * @property {boolean|null} [allowMissingIds] RequestMetadata allowMissingIds + * @property {google.cloud.talent.v4.IDeviceInfo|null} [deviceInfo] RequestMetadata deviceInfo + */ + + /** + * Constructs a new RequestMetadata. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a RequestMetadata. + * @implements IRequestMetadata + * @constructor + * @param {google.cloud.talent.v4.IRequestMetadata=} [properties] Properties to set + */ + function RequestMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestMetadata domain. + * @member {string} domain + * @memberof google.cloud.talent.v4.RequestMetadata + * @instance + */ + RequestMetadata.prototype.domain = ""; + + /** + * RequestMetadata sessionId. + * @member {string} sessionId + * @memberof google.cloud.talent.v4.RequestMetadata + * @instance + */ + RequestMetadata.prototype.sessionId = ""; + + /** + * RequestMetadata userId. + * @member {string} userId + * @memberof google.cloud.talent.v4.RequestMetadata + * @instance + */ + RequestMetadata.prototype.userId = ""; + + /** + * RequestMetadata allowMissingIds. + * @member {boolean} allowMissingIds + * @memberof google.cloud.talent.v4.RequestMetadata + * @instance + */ + RequestMetadata.prototype.allowMissingIds = false; + + /** + * RequestMetadata deviceInfo. + * @member {google.cloud.talent.v4.IDeviceInfo|null|undefined} deviceInfo + * @memberof google.cloud.talent.v4.RequestMetadata + * @instance + */ + RequestMetadata.prototype.deviceInfo = null; + + /** + * Creates a new RequestMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.RequestMetadata + * @static + * @param {google.cloud.talent.v4.IRequestMetadata=} [properties] Properties to set + * @returns {google.cloud.talent.v4.RequestMetadata} RequestMetadata instance + */ + RequestMetadata.create = function create(properties) { + return new RequestMetadata(properties); + }; + + /** + * Encodes the specified RequestMetadata message. Does not implicitly {@link google.cloud.talent.v4.RequestMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.RequestMetadata + * @static + * @param {google.cloud.talent.v4.IRequestMetadata} message RequestMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.domain); + if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sessionId); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.userId); + if (message.allowMissingIds != null && Object.hasOwnProperty.call(message, "allowMissingIds")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissingIds); + if (message.deviceInfo != null && Object.hasOwnProperty.call(message, "deviceInfo")) + $root.google.cloud.talent.v4.DeviceInfo.encode(message.deviceInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestMetadata message, length delimited. Does not implicitly {@link google.cloud.talent.v4.RequestMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.RequestMetadata + * @static + * @param {google.cloud.talent.v4.IRequestMetadata} message RequestMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.RequestMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.RequestMetadata} RequestMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.RequestMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.domain = reader.string(); + break; + } + case 2: { + message.sessionId = reader.string(); + break; + } + case 3: { + message.userId = reader.string(); + break; + } + case 4: { + message.allowMissingIds = reader.bool(); + break; + } + case 5: { + message.deviceInfo = $root.google.cloud.talent.v4.DeviceInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.RequestMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.RequestMetadata} RequestMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestMetadata message. + * @function verify + * @memberof google.cloud.talent.v4.RequestMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.domain != null && message.hasOwnProperty("domain")) + if (!$util.isString(message.domain)) + return "domain: string expected"; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + if (!$util.isString(message.sessionId)) + return "sessionId: string expected"; + if (message.userId != null && message.hasOwnProperty("userId")) + if (!$util.isString(message.userId)) + return "userId: string expected"; + if (message.allowMissingIds != null && message.hasOwnProperty("allowMissingIds")) + if (typeof message.allowMissingIds !== "boolean") + return "allowMissingIds: boolean expected"; + if (message.deviceInfo != null && message.hasOwnProperty("deviceInfo")) { + var error = $root.google.cloud.talent.v4.DeviceInfo.verify(message.deviceInfo); + if (error) + return "deviceInfo." + error; + } + return null; + }; + + /** + * Creates a RequestMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.RequestMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.RequestMetadata} RequestMetadata + */ + RequestMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.RequestMetadata) + return object; + var message = new $root.google.cloud.talent.v4.RequestMetadata(); + if (object.domain != null) + message.domain = String(object.domain); + if (object.sessionId != null) + message.sessionId = String(object.sessionId); + if (object.userId != null) + message.userId = String(object.userId); + if (object.allowMissingIds != null) + message.allowMissingIds = Boolean(object.allowMissingIds); + if (object.deviceInfo != null) { + if (typeof object.deviceInfo !== "object") + throw TypeError(".google.cloud.talent.v4.RequestMetadata.deviceInfo: object expected"); + message.deviceInfo = $root.google.cloud.talent.v4.DeviceInfo.fromObject(object.deviceInfo); + } + return message; + }; + + /** + * Creates a plain object from a RequestMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.RequestMetadata + * @static + * @param {google.cloud.talent.v4.RequestMetadata} message RequestMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.domain = ""; + object.sessionId = ""; + object.userId = ""; + object.allowMissingIds = false; + object.deviceInfo = null; + } + if (message.domain != null && message.hasOwnProperty("domain")) + object.domain = message.domain; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + object.sessionId = message.sessionId; + if (message.userId != null && message.hasOwnProperty("userId")) + object.userId = message.userId; + if (message.allowMissingIds != null && message.hasOwnProperty("allowMissingIds")) + object.allowMissingIds = message.allowMissingIds; + if (message.deviceInfo != null && message.hasOwnProperty("deviceInfo")) + object.deviceInfo = $root.google.cloud.talent.v4.DeviceInfo.toObject(message.deviceInfo, options); + return object; + }; + + /** + * Converts this RequestMetadata to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.RequestMetadata + * @instance + * @returns {Object.} JSON object + */ + RequestMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RequestMetadata + * @function getTypeUrl + * @memberof google.cloud.talent.v4.RequestMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RequestMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.RequestMetadata"; + }; + + return RequestMetadata; + })(); + + v4.ResponseMetadata = (function() { + + /** + * Properties of a ResponseMetadata. + * @memberof google.cloud.talent.v4 + * @interface IResponseMetadata + * @property {string|null} [requestId] ResponseMetadata requestId + */ + + /** + * Constructs a new ResponseMetadata. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a ResponseMetadata. + * @implements IResponseMetadata + * @constructor + * @param {google.cloud.talent.v4.IResponseMetadata=} [properties] Properties to set + */ + function ResponseMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseMetadata requestId. + * @member {string} requestId + * @memberof google.cloud.talent.v4.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.requestId = ""; + + /** + * Creates a new ResponseMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.ResponseMetadata + * @static + * @param {google.cloud.talent.v4.IResponseMetadata=} [properties] Properties to set + * @returns {google.cloud.talent.v4.ResponseMetadata} ResponseMetadata instance + */ + ResponseMetadata.create = function create(properties) { + return new ResponseMetadata(properties); + }; + + /** + * Encodes the specified ResponseMetadata message. Does not implicitly {@link google.cloud.talent.v4.ResponseMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.ResponseMetadata + * @static + * @param {google.cloud.talent.v4.IResponseMetadata} message ResponseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified ResponseMetadata message, length delimited. Does not implicitly {@link google.cloud.talent.v4.ResponseMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.ResponseMetadata + * @static + * @param {google.cloud.talent.v4.IResponseMetadata} message ResponseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.ResponseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.ResponseMetadata} ResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.ResponseMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.ResponseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.ResponseMetadata} ResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseMetadata message. + * @function verify + * @memberof google.cloud.talent.v4.ResponseMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a ResponseMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.ResponseMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.ResponseMetadata} ResponseMetadata + */ + ResponseMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.ResponseMetadata) + return object; + var message = new $root.google.cloud.talent.v4.ResponseMetadata(); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a ResponseMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.ResponseMetadata + * @static + * @param {google.cloud.talent.v4.ResponseMetadata} message ResponseMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.requestId = ""; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this ResponseMetadata to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.ResponseMetadata + * @instance + * @returns {Object.} JSON object + */ + ResponseMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResponseMetadata + * @function getTypeUrl + * @memberof google.cloud.talent.v4.ResponseMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResponseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.ResponseMetadata"; + }; + + return ResponseMetadata; + })(); + + v4.DeviceInfo = (function() { + + /** + * Properties of a DeviceInfo. + * @memberof google.cloud.talent.v4 + * @interface IDeviceInfo + * @property {google.cloud.talent.v4.DeviceInfo.DeviceType|null} [deviceType] DeviceInfo deviceType + * @property {string|null} [id] DeviceInfo id + */ + + /** + * Constructs a new DeviceInfo. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a DeviceInfo. + * @implements IDeviceInfo + * @constructor + * @param {google.cloud.talent.v4.IDeviceInfo=} [properties] Properties to set + */ + function DeviceInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeviceInfo deviceType. + * @member {google.cloud.talent.v4.DeviceInfo.DeviceType} deviceType + * @memberof google.cloud.talent.v4.DeviceInfo + * @instance + */ + DeviceInfo.prototype.deviceType = 0; + + /** + * DeviceInfo id. + * @member {string} id + * @memberof google.cloud.talent.v4.DeviceInfo + * @instance + */ + DeviceInfo.prototype.id = ""; + + /** + * Creates a new DeviceInfo instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.DeviceInfo + * @static + * @param {google.cloud.talent.v4.IDeviceInfo=} [properties] Properties to set + * @returns {google.cloud.talent.v4.DeviceInfo} DeviceInfo instance + */ + DeviceInfo.create = function create(properties) { + return new DeviceInfo(properties); + }; + + /** + * Encodes the specified DeviceInfo message. Does not implicitly {@link google.cloud.talent.v4.DeviceInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.DeviceInfo + * @static + * @param {google.cloud.talent.v4.IDeviceInfo} message DeviceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeviceInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deviceType != null && Object.hasOwnProperty.call(message, "deviceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.deviceType); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + return writer; + }; + + /** + * Encodes the specified DeviceInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4.DeviceInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.DeviceInfo + * @static + * @param {google.cloud.talent.v4.IDeviceInfo} message DeviceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeviceInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeviceInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.DeviceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.DeviceInfo} DeviceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeviceInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.DeviceInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deviceType = reader.int32(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeviceInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.DeviceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.DeviceInfo} DeviceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeviceInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeviceInfo message. + * @function verify + * @memberof google.cloud.talent.v4.DeviceInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeviceInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deviceType != null && message.hasOwnProperty("deviceType")) + switch (message.deviceType) { + default: + return "deviceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + return null; + }; + + /** + * Creates a DeviceInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.DeviceInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.DeviceInfo} DeviceInfo + */ + DeviceInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.DeviceInfo) + return object; + var message = new $root.google.cloud.talent.v4.DeviceInfo(); + switch (object.deviceType) { + default: + if (typeof object.deviceType === "number") { + message.deviceType = object.deviceType; + break; + } + break; + case "DEVICE_TYPE_UNSPECIFIED": + case 0: + message.deviceType = 0; + break; + case "WEB": + case 1: + message.deviceType = 1; + break; + case "MOBILE_WEB": + case 2: + message.deviceType = 2; + break; + case "ANDROID": + case 3: + message.deviceType = 3; + break; + case "IOS": + case 4: + message.deviceType = 4; + break; + case "BOT": + case 5: + message.deviceType = 5; + break; + case "OTHER": + case 6: + message.deviceType = 6; + break; + } + if (object.id != null) + message.id = String(object.id); + return message; + }; + + /** + * Creates a plain object from a DeviceInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.DeviceInfo + * @static + * @param {google.cloud.talent.v4.DeviceInfo} message DeviceInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeviceInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.deviceType = options.enums === String ? "DEVICE_TYPE_UNSPECIFIED" : 0; + object.id = ""; + } + if (message.deviceType != null && message.hasOwnProperty("deviceType")) + object.deviceType = options.enums === String ? $root.google.cloud.talent.v4.DeviceInfo.DeviceType[message.deviceType] === undefined ? message.deviceType : $root.google.cloud.talent.v4.DeviceInfo.DeviceType[message.deviceType] : message.deviceType; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + return object; + }; + + /** + * Converts this DeviceInfo to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.DeviceInfo + * @instance + * @returns {Object.} JSON object + */ + DeviceInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeviceInfo + * @function getTypeUrl + * @memberof google.cloud.talent.v4.DeviceInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeviceInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.DeviceInfo"; + }; + + /** + * DeviceType enum. + * @name google.cloud.talent.v4.DeviceInfo.DeviceType + * @enum {number} + * @property {number} DEVICE_TYPE_UNSPECIFIED=0 DEVICE_TYPE_UNSPECIFIED value + * @property {number} WEB=1 WEB value + * @property {number} MOBILE_WEB=2 MOBILE_WEB value + * @property {number} ANDROID=3 ANDROID value + * @property {number} IOS=4 IOS value + * @property {number} BOT=5 BOT value + * @property {number} OTHER=6 OTHER value + */ + DeviceInfo.DeviceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEVICE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "WEB"] = 1; + values[valuesById[2] = "MOBILE_WEB"] = 2; + values[valuesById[3] = "ANDROID"] = 3; + values[valuesById[4] = "IOS"] = 4; + values[valuesById[5] = "BOT"] = 5; + values[valuesById[6] = "OTHER"] = 6; + return values; + })(); + + return DeviceInfo; + })(); + + v4.CustomAttribute = (function() { + + /** + * Properties of a CustomAttribute. + * @memberof google.cloud.talent.v4 + * @interface ICustomAttribute + * @property {Array.|null} [stringValues] CustomAttribute stringValues + * @property {Array.|null} [longValues] CustomAttribute longValues + * @property {boolean|null} [filterable] CustomAttribute filterable + * @property {boolean|null} [keywordSearchable] CustomAttribute keywordSearchable + */ + + /** + * Constructs a new CustomAttribute. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a CustomAttribute. + * @implements ICustomAttribute + * @constructor + * @param {google.cloud.talent.v4.ICustomAttribute=} [properties] Properties to set + */ + function CustomAttribute(properties) { + this.stringValues = []; + this.longValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomAttribute stringValues. + * @member {Array.} stringValues + * @memberof google.cloud.talent.v4.CustomAttribute + * @instance + */ + CustomAttribute.prototype.stringValues = $util.emptyArray; + + /** + * CustomAttribute longValues. + * @member {Array.} longValues + * @memberof google.cloud.talent.v4.CustomAttribute + * @instance + */ + CustomAttribute.prototype.longValues = $util.emptyArray; + + /** + * CustomAttribute filterable. + * @member {boolean} filterable + * @memberof google.cloud.talent.v4.CustomAttribute + * @instance + */ + CustomAttribute.prototype.filterable = false; + + /** + * CustomAttribute keywordSearchable. + * @member {boolean} keywordSearchable + * @memberof google.cloud.talent.v4.CustomAttribute + * @instance + */ + CustomAttribute.prototype.keywordSearchable = false; + + /** + * Creates a new CustomAttribute instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.CustomAttribute + * @static + * @param {google.cloud.talent.v4.ICustomAttribute=} [properties] Properties to set + * @returns {google.cloud.talent.v4.CustomAttribute} CustomAttribute instance + */ + CustomAttribute.create = function create(properties) { + return new CustomAttribute(properties); + }; + + /** + * Encodes the specified CustomAttribute message. Does not implicitly {@link google.cloud.talent.v4.CustomAttribute.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.CustomAttribute + * @static + * @param {google.cloud.talent.v4.ICustomAttribute} message CustomAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomAttribute.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stringValues != null && message.stringValues.length) + for (var i = 0; i < message.stringValues.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stringValues[i]); + if (message.longValues != null && message.longValues.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.longValues.length; ++i) + writer.int64(message.longValues[i]); + writer.ldelim(); + } + if (message.filterable != null && Object.hasOwnProperty.call(message, "filterable")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.filterable); + if (message.keywordSearchable != null && Object.hasOwnProperty.call(message, "keywordSearchable")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.keywordSearchable); + return writer; + }; + + /** + * Encodes the specified CustomAttribute message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CustomAttribute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.CustomAttribute + * @static + * @param {google.cloud.talent.v4.ICustomAttribute} message CustomAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomAttribute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomAttribute message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.CustomAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.CustomAttribute} CustomAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomAttribute.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.CustomAttribute(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.stringValues && message.stringValues.length)) + message.stringValues = []; + message.stringValues.push(reader.string()); + break; + } + case 2: { + if (!(message.longValues && message.longValues.length)) + message.longValues = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.longValues.push(reader.int64()); + } else + message.longValues.push(reader.int64()); + break; + } + case 3: { + message.filterable = reader.bool(); + break; + } + case 4: { + message.keywordSearchable = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomAttribute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.CustomAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.CustomAttribute} CustomAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomAttribute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomAttribute message. + * @function verify + * @memberof google.cloud.talent.v4.CustomAttribute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomAttribute.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stringValues != null && message.hasOwnProperty("stringValues")) { + if (!Array.isArray(message.stringValues)) + return "stringValues: array expected"; + for (var i = 0; i < message.stringValues.length; ++i) + if (!$util.isString(message.stringValues[i])) + return "stringValues: string[] expected"; + } + if (message.longValues != null && message.hasOwnProperty("longValues")) { + if (!Array.isArray(message.longValues)) + return "longValues: array expected"; + for (var i = 0; i < message.longValues.length; ++i) + if (!$util.isInteger(message.longValues[i]) && !(message.longValues[i] && $util.isInteger(message.longValues[i].low) && $util.isInteger(message.longValues[i].high))) + return "longValues: integer|Long[] expected"; + } + if (message.filterable != null && message.hasOwnProperty("filterable")) + if (typeof message.filterable !== "boolean") + return "filterable: boolean expected"; + if (message.keywordSearchable != null && message.hasOwnProperty("keywordSearchable")) + if (typeof message.keywordSearchable !== "boolean") + return "keywordSearchable: boolean expected"; + return null; + }; + + /** + * Creates a CustomAttribute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.CustomAttribute + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.CustomAttribute} CustomAttribute + */ + CustomAttribute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.CustomAttribute) + return object; + var message = new $root.google.cloud.talent.v4.CustomAttribute(); + if (object.stringValues) { + if (!Array.isArray(object.stringValues)) + throw TypeError(".google.cloud.talent.v4.CustomAttribute.stringValues: array expected"); + message.stringValues = []; + for (var i = 0; i < object.stringValues.length; ++i) + message.stringValues[i] = String(object.stringValues[i]); + } + if (object.longValues) { + if (!Array.isArray(object.longValues)) + throw TypeError(".google.cloud.talent.v4.CustomAttribute.longValues: array expected"); + message.longValues = []; + for (var i = 0; i < object.longValues.length; ++i) + if ($util.Long) + (message.longValues[i] = $util.Long.fromValue(object.longValues[i])).unsigned = false; + else if (typeof object.longValues[i] === "string") + message.longValues[i] = parseInt(object.longValues[i], 10); + else if (typeof object.longValues[i] === "number") + message.longValues[i] = object.longValues[i]; + else if (typeof object.longValues[i] === "object") + message.longValues[i] = new $util.LongBits(object.longValues[i].low >>> 0, object.longValues[i].high >>> 0).toNumber(); + } + if (object.filterable != null) + message.filterable = Boolean(object.filterable); + if (object.keywordSearchable != null) + message.keywordSearchable = Boolean(object.keywordSearchable); + return message; + }; + + /** + * Creates a plain object from a CustomAttribute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.CustomAttribute + * @static + * @param {google.cloud.talent.v4.CustomAttribute} message CustomAttribute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomAttribute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.stringValues = []; + object.longValues = []; + } + if (options.defaults) { + object.filterable = false; + object.keywordSearchable = false; + } + if (message.stringValues && message.stringValues.length) { + object.stringValues = []; + for (var j = 0; j < message.stringValues.length; ++j) + object.stringValues[j] = message.stringValues[j]; + } + if (message.longValues && message.longValues.length) { + object.longValues = []; + for (var j = 0; j < message.longValues.length; ++j) + if (typeof message.longValues[j] === "number") + object.longValues[j] = options.longs === String ? String(message.longValues[j]) : message.longValues[j]; + else + object.longValues[j] = options.longs === String ? $util.Long.prototype.toString.call(message.longValues[j]) : options.longs === Number ? new $util.LongBits(message.longValues[j].low >>> 0, message.longValues[j].high >>> 0).toNumber() : message.longValues[j]; + } + if (message.filterable != null && message.hasOwnProperty("filterable")) + object.filterable = message.filterable; + if (message.keywordSearchable != null && message.hasOwnProperty("keywordSearchable")) + object.keywordSearchable = message.keywordSearchable; + return object; + }; + + /** + * Converts this CustomAttribute to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.CustomAttribute + * @instance + * @returns {Object.} JSON object + */ + CustomAttribute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomAttribute + * @function getTypeUrl + * @memberof google.cloud.talent.v4.CustomAttribute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomAttribute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.CustomAttribute"; + }; + + return CustomAttribute; + })(); + + v4.SpellingCorrection = (function() { + + /** + * Properties of a SpellingCorrection. + * @memberof google.cloud.talent.v4 + * @interface ISpellingCorrection + * @property {boolean|null} [corrected] SpellingCorrection corrected + * @property {string|null} [correctedText] SpellingCorrection correctedText + * @property {string|null} [correctedHtml] SpellingCorrection correctedHtml + */ + + /** + * Constructs a new SpellingCorrection. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a SpellingCorrection. + * @implements ISpellingCorrection + * @constructor + * @param {google.cloud.talent.v4.ISpellingCorrection=} [properties] Properties to set + */ + function SpellingCorrection(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpellingCorrection corrected. + * @member {boolean} corrected + * @memberof google.cloud.talent.v4.SpellingCorrection + * @instance + */ + SpellingCorrection.prototype.corrected = false; + + /** + * SpellingCorrection correctedText. + * @member {string} correctedText + * @memberof google.cloud.talent.v4.SpellingCorrection + * @instance + */ + SpellingCorrection.prototype.correctedText = ""; + + /** + * SpellingCorrection correctedHtml. + * @member {string} correctedHtml + * @memberof google.cloud.talent.v4.SpellingCorrection + * @instance + */ + SpellingCorrection.prototype.correctedHtml = ""; + + /** + * Creates a new SpellingCorrection instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.SpellingCorrection + * @static + * @param {google.cloud.talent.v4.ISpellingCorrection=} [properties] Properties to set + * @returns {google.cloud.talent.v4.SpellingCorrection} SpellingCorrection instance + */ + SpellingCorrection.create = function create(properties) { + return new SpellingCorrection(properties); + }; + + /** + * Encodes the specified SpellingCorrection message. Does not implicitly {@link google.cloud.talent.v4.SpellingCorrection.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.SpellingCorrection + * @static + * @param {google.cloud.talent.v4.ISpellingCorrection} message SpellingCorrection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpellingCorrection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.corrected != null && Object.hasOwnProperty.call(message, "corrected")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.corrected); + if (message.correctedText != null && Object.hasOwnProperty.call(message, "correctedText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.correctedText); + if (message.correctedHtml != null && Object.hasOwnProperty.call(message, "correctedHtml")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.correctedHtml); + return writer; + }; + + /** + * Encodes the specified SpellingCorrection message, length delimited. Does not implicitly {@link google.cloud.talent.v4.SpellingCorrection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.SpellingCorrection + * @static + * @param {google.cloud.talent.v4.ISpellingCorrection} message SpellingCorrection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpellingCorrection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpellingCorrection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.SpellingCorrection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.SpellingCorrection} SpellingCorrection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpellingCorrection.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.SpellingCorrection(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.corrected = reader.bool(); + break; + } + case 2: { + message.correctedText = reader.string(); + break; + } + case 3: { + message.correctedHtml = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpellingCorrection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.SpellingCorrection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.SpellingCorrection} SpellingCorrection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpellingCorrection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpellingCorrection message. + * @function verify + * @memberof google.cloud.talent.v4.SpellingCorrection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpellingCorrection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.corrected != null && message.hasOwnProperty("corrected")) + if (typeof message.corrected !== "boolean") + return "corrected: boolean expected"; + if (message.correctedText != null && message.hasOwnProperty("correctedText")) + if (!$util.isString(message.correctedText)) + return "correctedText: string expected"; + if (message.correctedHtml != null && message.hasOwnProperty("correctedHtml")) + if (!$util.isString(message.correctedHtml)) + return "correctedHtml: string expected"; + return null; + }; + + /** + * Creates a SpellingCorrection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.SpellingCorrection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.SpellingCorrection} SpellingCorrection + */ + SpellingCorrection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.SpellingCorrection) + return object; + var message = new $root.google.cloud.talent.v4.SpellingCorrection(); + if (object.corrected != null) + message.corrected = Boolean(object.corrected); + if (object.correctedText != null) + message.correctedText = String(object.correctedText); + if (object.correctedHtml != null) + message.correctedHtml = String(object.correctedHtml); + return message; + }; + + /** + * Creates a plain object from a SpellingCorrection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.SpellingCorrection + * @static + * @param {google.cloud.talent.v4.SpellingCorrection} message SpellingCorrection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpellingCorrection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.corrected = false; + object.correctedText = ""; + object.correctedHtml = ""; + } + if (message.corrected != null && message.hasOwnProperty("corrected")) + object.corrected = message.corrected; + if (message.correctedText != null && message.hasOwnProperty("correctedText")) + object.correctedText = message.correctedText; + if (message.correctedHtml != null && message.hasOwnProperty("correctedHtml")) + object.correctedHtml = message.correctedHtml; + return object; + }; + + /** + * Converts this SpellingCorrection to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.SpellingCorrection + * @instance + * @returns {Object.} JSON object + */ + SpellingCorrection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpellingCorrection + * @function getTypeUrl + * @memberof google.cloud.talent.v4.SpellingCorrection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpellingCorrection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.SpellingCorrection"; + }; + + return SpellingCorrection; + })(); + + v4.CompensationInfo = (function() { + + /** + * Properties of a CompensationInfo. + * @memberof google.cloud.talent.v4 + * @interface ICompensationInfo + * @property {Array.|null} [entries] CompensationInfo entries + * @property {google.cloud.talent.v4.CompensationInfo.ICompensationRange|null} [annualizedBaseCompensationRange] CompensationInfo annualizedBaseCompensationRange + * @property {google.cloud.talent.v4.CompensationInfo.ICompensationRange|null} [annualizedTotalCompensationRange] CompensationInfo annualizedTotalCompensationRange + */ + + /** + * Constructs a new CompensationInfo. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a CompensationInfo. + * @implements ICompensationInfo + * @constructor + * @param {google.cloud.talent.v4.ICompensationInfo=} [properties] Properties to set + */ + function CompensationInfo(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompensationInfo entries. + * @member {Array.} entries + * @memberof google.cloud.talent.v4.CompensationInfo + * @instance + */ + CompensationInfo.prototype.entries = $util.emptyArray; + + /** + * CompensationInfo annualizedBaseCompensationRange. + * @member {google.cloud.talent.v4.CompensationInfo.ICompensationRange|null|undefined} annualizedBaseCompensationRange + * @memberof google.cloud.talent.v4.CompensationInfo + * @instance + */ + CompensationInfo.prototype.annualizedBaseCompensationRange = null; + + /** + * CompensationInfo annualizedTotalCompensationRange. + * @member {google.cloud.talent.v4.CompensationInfo.ICompensationRange|null|undefined} annualizedTotalCompensationRange + * @memberof google.cloud.talent.v4.CompensationInfo + * @instance + */ + CompensationInfo.prototype.annualizedTotalCompensationRange = null; + + /** + * Creates a new CompensationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.CompensationInfo + * @static + * @param {google.cloud.talent.v4.ICompensationInfo=} [properties] Properties to set + * @returns {google.cloud.talent.v4.CompensationInfo} CompensationInfo instance + */ + CompensationInfo.create = function create(properties) { + return new CompensationInfo(properties); + }; + + /** + * Encodes the specified CompensationInfo message. Does not implicitly {@link google.cloud.talent.v4.CompensationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.CompensationInfo + * @static + * @param {google.cloud.talent.v4.ICompensationInfo} message CompensationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompensationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.google.cloud.talent.v4.CompensationInfo.CompensationEntry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.annualizedBaseCompensationRange != null && Object.hasOwnProperty.call(message, "annualizedBaseCompensationRange")) + $root.google.cloud.talent.v4.CompensationInfo.CompensationRange.encode(message.annualizedBaseCompensationRange, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.annualizedTotalCompensationRange != null && Object.hasOwnProperty.call(message, "annualizedTotalCompensationRange")) + $root.google.cloud.talent.v4.CompensationInfo.CompensationRange.encode(message.annualizedTotalCompensationRange, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CompensationInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CompensationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.CompensationInfo + * @static + * @param {google.cloud.talent.v4.ICompensationInfo} message CompensationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompensationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompensationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.CompensationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.CompensationInfo} CompensationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompensationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.CompensationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.google.cloud.talent.v4.CompensationInfo.CompensationEntry.decode(reader, reader.uint32())); + break; + } + case 2: { + message.annualizedBaseCompensationRange = $root.google.cloud.talent.v4.CompensationInfo.CompensationRange.decode(reader, reader.uint32()); + break; + } + case 3: { + message.annualizedTotalCompensationRange = $root.google.cloud.talent.v4.CompensationInfo.CompensationRange.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompensationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.CompensationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.CompensationInfo} CompensationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompensationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompensationInfo message. + * @function verify + * @memberof google.cloud.talent.v4.CompensationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompensationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.google.cloud.talent.v4.CompensationInfo.CompensationEntry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + if (message.annualizedBaseCompensationRange != null && message.hasOwnProperty("annualizedBaseCompensationRange")) { + var error = $root.google.cloud.talent.v4.CompensationInfo.CompensationRange.verify(message.annualizedBaseCompensationRange); + if (error) + return "annualizedBaseCompensationRange." + error; + } + if (message.annualizedTotalCompensationRange != null && message.hasOwnProperty("annualizedTotalCompensationRange")) { + var error = $root.google.cloud.talent.v4.CompensationInfo.CompensationRange.verify(message.annualizedTotalCompensationRange); + if (error) + return "annualizedTotalCompensationRange." + error; + } + return null; + }; + + /** + * Creates a CompensationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.CompensationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.CompensationInfo} CompensationInfo + */ + CompensationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.CompensationInfo) + return object; + var message = new $root.google.cloud.talent.v4.CompensationInfo(); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".google.cloud.talent.v4.CompensationInfo.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".google.cloud.talent.v4.CompensationInfo.entries: object expected"); + message.entries[i] = $root.google.cloud.talent.v4.CompensationInfo.CompensationEntry.fromObject(object.entries[i]); + } + } + if (object.annualizedBaseCompensationRange != null) { + if (typeof object.annualizedBaseCompensationRange !== "object") + throw TypeError(".google.cloud.talent.v4.CompensationInfo.annualizedBaseCompensationRange: object expected"); + message.annualizedBaseCompensationRange = $root.google.cloud.talent.v4.CompensationInfo.CompensationRange.fromObject(object.annualizedBaseCompensationRange); + } + if (object.annualizedTotalCompensationRange != null) { + if (typeof object.annualizedTotalCompensationRange !== "object") + throw TypeError(".google.cloud.talent.v4.CompensationInfo.annualizedTotalCompensationRange: object expected"); + message.annualizedTotalCompensationRange = $root.google.cloud.talent.v4.CompensationInfo.CompensationRange.fromObject(object.annualizedTotalCompensationRange); + } + return message; + }; + + /** + * Creates a plain object from a CompensationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.CompensationInfo + * @static + * @param {google.cloud.talent.v4.CompensationInfo} message CompensationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompensationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (options.defaults) { + object.annualizedBaseCompensationRange = null; + object.annualizedTotalCompensationRange = null; + } + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.google.cloud.talent.v4.CompensationInfo.CompensationEntry.toObject(message.entries[j], options); + } + if (message.annualizedBaseCompensationRange != null && message.hasOwnProperty("annualizedBaseCompensationRange")) + object.annualizedBaseCompensationRange = $root.google.cloud.talent.v4.CompensationInfo.CompensationRange.toObject(message.annualizedBaseCompensationRange, options); + if (message.annualizedTotalCompensationRange != null && message.hasOwnProperty("annualizedTotalCompensationRange")) + object.annualizedTotalCompensationRange = $root.google.cloud.talent.v4.CompensationInfo.CompensationRange.toObject(message.annualizedTotalCompensationRange, options); + return object; + }; + + /** + * Converts this CompensationInfo to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.CompensationInfo + * @instance + * @returns {Object.} JSON object + */ + CompensationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompensationInfo + * @function getTypeUrl + * @memberof google.cloud.talent.v4.CompensationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompensationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.CompensationInfo"; + }; + + CompensationInfo.CompensationEntry = (function() { + + /** + * Properties of a CompensationEntry. + * @memberof google.cloud.talent.v4.CompensationInfo + * @interface ICompensationEntry + * @property {google.cloud.talent.v4.CompensationInfo.CompensationType|null} [type] CompensationEntry type + * @property {google.cloud.talent.v4.CompensationInfo.CompensationUnit|null} [unit] CompensationEntry unit + * @property {google.type.IMoney|null} [amount] CompensationEntry amount + * @property {google.cloud.talent.v4.CompensationInfo.ICompensationRange|null} [range] CompensationEntry range + * @property {string|null} [description] CompensationEntry description + * @property {google.protobuf.IDoubleValue|null} [expectedUnitsPerYear] CompensationEntry expectedUnitsPerYear + */ + + /** + * Constructs a new CompensationEntry. + * @memberof google.cloud.talent.v4.CompensationInfo + * @classdesc Represents a CompensationEntry. + * @implements ICompensationEntry + * @constructor + * @param {google.cloud.talent.v4.CompensationInfo.ICompensationEntry=} [properties] Properties to set + */ + function CompensationEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompensationEntry type. + * @member {google.cloud.talent.v4.CompensationInfo.CompensationType} type + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationEntry + * @instance + */ + CompensationEntry.prototype.type = 0; + + /** + * CompensationEntry unit. + * @member {google.cloud.talent.v4.CompensationInfo.CompensationUnit} unit + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationEntry + * @instance + */ + CompensationEntry.prototype.unit = 0; + + /** + * CompensationEntry amount. + * @member {google.type.IMoney|null|undefined} amount + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationEntry + * @instance + */ + CompensationEntry.prototype.amount = null; + + /** + * CompensationEntry range. + * @member {google.cloud.talent.v4.CompensationInfo.ICompensationRange|null|undefined} range + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationEntry + * @instance + */ + CompensationEntry.prototype.range = null; + + /** + * CompensationEntry description. + * @member {string} description + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationEntry + * @instance + */ + CompensationEntry.prototype.description = ""; + + /** + * CompensationEntry expectedUnitsPerYear. + * @member {google.protobuf.IDoubleValue|null|undefined} expectedUnitsPerYear + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationEntry + * @instance + */ + CompensationEntry.prototype.expectedUnitsPerYear = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CompensationEntry compensationAmount. + * @member {"amount"|"range"|undefined} compensationAmount + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationEntry + * @instance + */ + Object.defineProperty(CompensationEntry.prototype, "compensationAmount", { + get: $util.oneOfGetter($oneOfFields = ["amount", "range"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CompensationEntry instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationEntry + * @static + * @param {google.cloud.talent.v4.CompensationInfo.ICompensationEntry=} [properties] Properties to set + * @returns {google.cloud.talent.v4.CompensationInfo.CompensationEntry} CompensationEntry instance + */ + CompensationEntry.create = function create(properties) { + return new CompensationEntry(properties); + }; + + /** + * Encodes the specified CompensationEntry message. Does not implicitly {@link google.cloud.talent.v4.CompensationInfo.CompensationEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationEntry + * @static + * @param {google.cloud.talent.v4.CompensationInfo.ICompensationEntry} message CompensationEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompensationEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.unit); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + $root.google.type.Money.encode(message.amount, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.range != null && Object.hasOwnProperty.call(message, "range")) + $root.google.cloud.talent.v4.CompensationInfo.CompensationRange.encode(message.range, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.expectedUnitsPerYear != null && Object.hasOwnProperty.call(message, "expectedUnitsPerYear")) + $root.google.protobuf.DoubleValue.encode(message.expectedUnitsPerYear, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CompensationEntry message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CompensationInfo.CompensationEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationEntry + * @static + * @param {google.cloud.talent.v4.CompensationInfo.ICompensationEntry} message CompensationEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompensationEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompensationEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.CompensationInfo.CompensationEntry} CompensationEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompensationEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.CompensationInfo.CompensationEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.unit = reader.int32(); + break; + } + case 3: { + message.amount = $root.google.type.Money.decode(reader, reader.uint32()); + break; + } + case 4: { + message.range = $root.google.cloud.talent.v4.CompensationInfo.CompensationRange.decode(reader, reader.uint32()); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.expectedUnitsPerYear = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompensationEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.CompensationInfo.CompensationEntry} CompensationEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompensationEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompensationEntry message. + * @function verify + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompensationEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.unit != null && message.hasOwnProperty("unit")) + switch (message.unit) { + default: + return "unit: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.amount != null && message.hasOwnProperty("amount")) { + properties.compensationAmount = 1; + { + var error = $root.google.type.Money.verify(message.amount); + if (error) + return "amount." + error; + } + } + if (message.range != null && message.hasOwnProperty("range")) { + if (properties.compensationAmount === 1) + return "compensationAmount: multiple values"; + properties.compensationAmount = 1; + { + var error = $root.google.cloud.talent.v4.CompensationInfo.CompensationRange.verify(message.range); + if (error) + return "range." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.expectedUnitsPerYear != null && message.hasOwnProperty("expectedUnitsPerYear")) { + var error = $root.google.protobuf.DoubleValue.verify(message.expectedUnitsPerYear); + if (error) + return "expectedUnitsPerYear." + error; + } + return null; + }; + + /** + * Creates a CompensationEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.CompensationInfo.CompensationEntry} CompensationEntry + */ + CompensationEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.CompensationInfo.CompensationEntry) + return object; + var message = new $root.google.cloud.talent.v4.CompensationInfo.CompensationEntry(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "COMPENSATION_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "BASE": + case 1: + message.type = 1; + break; + case "BONUS": + case 2: + message.type = 2; + break; + case "SIGNING_BONUS": + case 3: + message.type = 3; + break; + case "EQUITY": + case 4: + message.type = 4; + break; + case "PROFIT_SHARING": + case 5: + message.type = 5; + break; + case "COMMISSIONS": + case 6: + message.type = 6; + break; + case "TIPS": + case 7: + message.type = 7; + break; + case "OTHER_COMPENSATION_TYPE": + case 8: + message.type = 8; + break; + } + switch (object.unit) { + default: + if (typeof object.unit === "number") { + message.unit = object.unit; + break; + } + break; + case "COMPENSATION_UNIT_UNSPECIFIED": + case 0: + message.unit = 0; + break; + case "HOURLY": + case 1: + message.unit = 1; + break; + case "DAILY": + case 2: + message.unit = 2; + break; + case "WEEKLY": + case 3: + message.unit = 3; + break; + case "MONTHLY": + case 4: + message.unit = 4; + break; + case "YEARLY": + case 5: + message.unit = 5; + break; + case "ONE_TIME": + case 6: + message.unit = 6; + break; + case "OTHER_COMPENSATION_UNIT": + case 7: + message.unit = 7; + break; + } + if (object.amount != null) { + if (typeof object.amount !== "object") + throw TypeError(".google.cloud.talent.v4.CompensationInfo.CompensationEntry.amount: object expected"); + message.amount = $root.google.type.Money.fromObject(object.amount); + } + if (object.range != null) { + if (typeof object.range !== "object") + throw TypeError(".google.cloud.talent.v4.CompensationInfo.CompensationEntry.range: object expected"); + message.range = $root.google.cloud.talent.v4.CompensationInfo.CompensationRange.fromObject(object.range); + } + if (object.description != null) + message.description = String(object.description); + if (object.expectedUnitsPerYear != null) { + if (typeof object.expectedUnitsPerYear !== "object") + throw TypeError(".google.cloud.talent.v4.CompensationInfo.CompensationEntry.expectedUnitsPerYear: object expected"); + message.expectedUnitsPerYear = $root.google.protobuf.DoubleValue.fromObject(object.expectedUnitsPerYear); + } + return message; + }; + + /** + * Creates a plain object from a CompensationEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationEntry + * @static + * @param {google.cloud.talent.v4.CompensationInfo.CompensationEntry} message CompensationEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompensationEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "COMPENSATION_TYPE_UNSPECIFIED" : 0; + object.unit = options.enums === String ? "COMPENSATION_UNIT_UNSPECIFIED" : 0; + object.description = ""; + object.expectedUnitsPerYear = null; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.talent.v4.CompensationInfo.CompensationType[message.type] === undefined ? message.type : $root.google.cloud.talent.v4.CompensationInfo.CompensationType[message.type] : message.type; + if (message.unit != null && message.hasOwnProperty("unit")) + object.unit = options.enums === String ? $root.google.cloud.talent.v4.CompensationInfo.CompensationUnit[message.unit] === undefined ? message.unit : $root.google.cloud.talent.v4.CompensationInfo.CompensationUnit[message.unit] : message.unit; + if (message.amount != null && message.hasOwnProperty("amount")) { + object.amount = $root.google.type.Money.toObject(message.amount, options); + if (options.oneofs) + object.compensationAmount = "amount"; + } + if (message.range != null && message.hasOwnProperty("range")) { + object.range = $root.google.cloud.talent.v4.CompensationInfo.CompensationRange.toObject(message.range, options); + if (options.oneofs) + object.compensationAmount = "range"; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.expectedUnitsPerYear != null && message.hasOwnProperty("expectedUnitsPerYear")) + object.expectedUnitsPerYear = $root.google.protobuf.DoubleValue.toObject(message.expectedUnitsPerYear, options); + return object; + }; + + /** + * Converts this CompensationEntry to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationEntry + * @instance + * @returns {Object.} JSON object + */ + CompensationEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompensationEntry + * @function getTypeUrl + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompensationEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.CompensationInfo.CompensationEntry"; + }; + + return CompensationEntry; + })(); + + /** + * CompensationType enum. + * @name google.cloud.talent.v4.CompensationInfo.CompensationType + * @enum {number} + * @property {number} COMPENSATION_TYPE_UNSPECIFIED=0 COMPENSATION_TYPE_UNSPECIFIED value + * @property {number} BASE=1 BASE value + * @property {number} BONUS=2 BONUS value + * @property {number} SIGNING_BONUS=3 SIGNING_BONUS value + * @property {number} EQUITY=4 EQUITY value + * @property {number} PROFIT_SHARING=5 PROFIT_SHARING value + * @property {number} COMMISSIONS=6 COMMISSIONS value + * @property {number} TIPS=7 TIPS value + * @property {number} OTHER_COMPENSATION_TYPE=8 OTHER_COMPENSATION_TYPE value + */ + CompensationInfo.CompensationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPENSATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASE"] = 1; + values[valuesById[2] = "BONUS"] = 2; + values[valuesById[3] = "SIGNING_BONUS"] = 3; + values[valuesById[4] = "EQUITY"] = 4; + values[valuesById[5] = "PROFIT_SHARING"] = 5; + values[valuesById[6] = "COMMISSIONS"] = 6; + values[valuesById[7] = "TIPS"] = 7; + values[valuesById[8] = "OTHER_COMPENSATION_TYPE"] = 8; + return values; + })(); + + /** + * CompensationUnit enum. + * @name google.cloud.talent.v4.CompensationInfo.CompensationUnit + * @enum {number} + * @property {number} COMPENSATION_UNIT_UNSPECIFIED=0 COMPENSATION_UNIT_UNSPECIFIED value + * @property {number} HOURLY=1 HOURLY value + * @property {number} DAILY=2 DAILY value + * @property {number} WEEKLY=3 WEEKLY value + * @property {number} MONTHLY=4 MONTHLY value + * @property {number} YEARLY=5 YEARLY value + * @property {number} ONE_TIME=6 ONE_TIME value + * @property {number} OTHER_COMPENSATION_UNIT=7 OTHER_COMPENSATION_UNIT value + */ + CompensationInfo.CompensationUnit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPENSATION_UNIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "HOURLY"] = 1; + values[valuesById[2] = "DAILY"] = 2; + values[valuesById[3] = "WEEKLY"] = 3; + values[valuesById[4] = "MONTHLY"] = 4; + values[valuesById[5] = "YEARLY"] = 5; + values[valuesById[6] = "ONE_TIME"] = 6; + values[valuesById[7] = "OTHER_COMPENSATION_UNIT"] = 7; + return values; + })(); + + CompensationInfo.CompensationRange = (function() { + + /** + * Properties of a CompensationRange. + * @memberof google.cloud.talent.v4.CompensationInfo + * @interface ICompensationRange + * @property {google.type.IMoney|null} [maxCompensation] CompensationRange maxCompensation + * @property {google.type.IMoney|null} [minCompensation] CompensationRange minCompensation + */ + + /** + * Constructs a new CompensationRange. + * @memberof google.cloud.talent.v4.CompensationInfo + * @classdesc Represents a CompensationRange. + * @implements ICompensationRange + * @constructor + * @param {google.cloud.talent.v4.CompensationInfo.ICompensationRange=} [properties] Properties to set + */ + function CompensationRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompensationRange maxCompensation. + * @member {google.type.IMoney|null|undefined} maxCompensation + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationRange + * @instance + */ + CompensationRange.prototype.maxCompensation = null; + + /** + * CompensationRange minCompensation. + * @member {google.type.IMoney|null|undefined} minCompensation + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationRange + * @instance + */ + CompensationRange.prototype.minCompensation = null; + + /** + * Creates a new CompensationRange instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationRange + * @static + * @param {google.cloud.talent.v4.CompensationInfo.ICompensationRange=} [properties] Properties to set + * @returns {google.cloud.talent.v4.CompensationInfo.CompensationRange} CompensationRange instance + */ + CompensationRange.create = function create(properties) { + return new CompensationRange(properties); + }; + + /** + * Encodes the specified CompensationRange message. Does not implicitly {@link google.cloud.talent.v4.CompensationInfo.CompensationRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationRange + * @static + * @param {google.cloud.talent.v4.CompensationInfo.ICompensationRange} message CompensationRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompensationRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minCompensation != null && Object.hasOwnProperty.call(message, "minCompensation")) + $root.google.type.Money.encode(message.minCompensation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxCompensation != null && Object.hasOwnProperty.call(message, "maxCompensation")) + $root.google.type.Money.encode(message.maxCompensation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CompensationRange message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CompensationInfo.CompensationRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationRange + * @static + * @param {google.cloud.talent.v4.CompensationInfo.ICompensationRange} message CompensationRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompensationRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompensationRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.CompensationInfo.CompensationRange} CompensationRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompensationRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.CompensationInfo.CompensationRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.maxCompensation = $root.google.type.Money.decode(reader, reader.uint32()); + break; + } + case 1: { + message.minCompensation = $root.google.type.Money.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompensationRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.CompensationInfo.CompensationRange} CompensationRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompensationRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompensationRange message. + * @function verify + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompensationRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxCompensation != null && message.hasOwnProperty("maxCompensation")) { + var error = $root.google.type.Money.verify(message.maxCompensation); + if (error) + return "maxCompensation." + error; + } + if (message.minCompensation != null && message.hasOwnProperty("minCompensation")) { + var error = $root.google.type.Money.verify(message.minCompensation); + if (error) + return "minCompensation." + error; + } + return null; + }; + + /** + * Creates a CompensationRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.CompensationInfo.CompensationRange} CompensationRange + */ + CompensationRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.CompensationInfo.CompensationRange) + return object; + var message = new $root.google.cloud.talent.v4.CompensationInfo.CompensationRange(); + if (object.maxCompensation != null) { + if (typeof object.maxCompensation !== "object") + throw TypeError(".google.cloud.talent.v4.CompensationInfo.CompensationRange.maxCompensation: object expected"); + message.maxCompensation = $root.google.type.Money.fromObject(object.maxCompensation); + } + if (object.minCompensation != null) { + if (typeof object.minCompensation !== "object") + throw TypeError(".google.cloud.talent.v4.CompensationInfo.CompensationRange.minCompensation: object expected"); + message.minCompensation = $root.google.type.Money.fromObject(object.minCompensation); + } + return message; + }; + + /** + * Creates a plain object from a CompensationRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationRange + * @static + * @param {google.cloud.talent.v4.CompensationInfo.CompensationRange} message CompensationRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompensationRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minCompensation = null; + object.maxCompensation = null; + } + if (message.minCompensation != null && message.hasOwnProperty("minCompensation")) + object.minCompensation = $root.google.type.Money.toObject(message.minCompensation, options); + if (message.maxCompensation != null && message.hasOwnProperty("maxCompensation")) + object.maxCompensation = $root.google.type.Money.toObject(message.maxCompensation, options); + return object; + }; + + /** + * Converts this CompensationRange to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationRange + * @instance + * @returns {Object.} JSON object + */ + CompensationRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompensationRange + * @function getTypeUrl + * @memberof google.cloud.talent.v4.CompensationInfo.CompensationRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompensationRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.CompensationInfo.CompensationRange"; + }; + + return CompensationRange; + })(); + + return CompensationInfo; + })(); + + v4.BatchOperationMetadata = (function() { + + /** + * Properties of a BatchOperationMetadata. + * @memberof google.cloud.talent.v4 + * @interface IBatchOperationMetadata + * @property {google.cloud.talent.v4.BatchOperationMetadata.State|null} [state] BatchOperationMetadata state + * @property {string|null} [stateDescription] BatchOperationMetadata stateDescription + * @property {number|null} [successCount] BatchOperationMetadata successCount + * @property {number|null} [failureCount] BatchOperationMetadata failureCount + * @property {number|null} [totalCount] BatchOperationMetadata totalCount + * @property {google.protobuf.ITimestamp|null} [createTime] BatchOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] BatchOperationMetadata updateTime + * @property {google.protobuf.ITimestamp|null} [endTime] BatchOperationMetadata endTime + */ + + /** + * Constructs a new BatchOperationMetadata. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a BatchOperationMetadata. + * @implements IBatchOperationMetadata + * @constructor + * @param {google.cloud.talent.v4.IBatchOperationMetadata=} [properties] Properties to set + */ + function BatchOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchOperationMetadata state. + * @member {google.cloud.talent.v4.BatchOperationMetadata.State} state + * @memberof google.cloud.talent.v4.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.state = 0; + + /** + * BatchOperationMetadata stateDescription. + * @member {string} stateDescription + * @memberof google.cloud.talent.v4.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.stateDescription = ""; + + /** + * BatchOperationMetadata successCount. + * @member {number} successCount + * @memberof google.cloud.talent.v4.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.successCount = 0; + + /** + * BatchOperationMetadata failureCount. + * @member {number} failureCount + * @memberof google.cloud.talent.v4.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.failureCount = 0; + + /** + * BatchOperationMetadata totalCount. + * @member {number} totalCount + * @memberof google.cloud.talent.v4.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.totalCount = 0; + + /** + * BatchOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.talent.v4.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.createTime = null; + + /** + * BatchOperationMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.talent.v4.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.updateTime = null; + + /** + * BatchOperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.talent.v4.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.endTime = null; + + /** + * Creates a new BatchOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.BatchOperationMetadata + * @static + * @param {google.cloud.talent.v4.IBatchOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.talent.v4.BatchOperationMetadata} BatchOperationMetadata instance + */ + BatchOperationMetadata.create = function create(properties) { + return new BatchOperationMetadata(properties); + }; + + /** + * Encodes the specified BatchOperationMetadata message. Does not implicitly {@link google.cloud.talent.v4.BatchOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.BatchOperationMetadata + * @static + * @param {google.cloud.talent.v4.IBatchOperationMetadata} message BatchOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.stateDescription != null && Object.hasOwnProperty.call(message, "stateDescription")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateDescription); + if (message.successCount != null && Object.hasOwnProperty.call(message, "successCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.successCount); + if (message.failureCount != null && Object.hasOwnProperty.call(message, "failureCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.failureCount); + if (message.totalCount != null && Object.hasOwnProperty.call(message, "totalCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.totalCount); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.talent.v4.BatchOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.BatchOperationMetadata + * @static + * @param {google.cloud.talent.v4.IBatchOperationMetadata} message BatchOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.BatchOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.BatchOperationMetadata} BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.BatchOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.stateDescription = reader.string(); + break; + } + case 3: { + message.successCount = reader.int32(); + break; + } + case 4: { + message.failureCount = reader.int32(); + break; + } + case 5: { + message.totalCount = reader.int32(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.BatchOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.BatchOperationMetadata} BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchOperationMetadata message. + * @function verify + * @memberof google.cloud.talent.v4.BatchOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.stateDescription != null && message.hasOwnProperty("stateDescription")) + if (!$util.isString(message.stateDescription)) + return "stateDescription: string expected"; + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (!$util.isInteger(message.successCount)) + return "successCount: integer expected"; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (!$util.isInteger(message.failureCount)) + return "failureCount: integer expected"; + if (message.totalCount != null && message.hasOwnProperty("totalCount")) + if (!$util.isInteger(message.totalCount)) + return "totalCount: 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.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a BatchOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.BatchOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.BatchOperationMetadata} BatchOperationMetadata + */ + BatchOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.BatchOperationMetadata) + return object; + var message = new $root.google.cloud.talent.v4.BatchOperationMetadata(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "INITIALIZING": + case 1: + message.state = 1; + break; + case "PROCESSING": + case 2: + message.state = 2; + break; + case "SUCCEEDED": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + case "CANCELLING": + case 5: + message.state = 5; + break; + case "CANCELLED": + case 6: + message.state = 6; + break; + } + if (object.stateDescription != null) + message.stateDescription = String(object.stateDescription); + if (object.successCount != null) + message.successCount = object.successCount | 0; + if (object.failureCount != null) + message.failureCount = object.failureCount | 0; + if (object.totalCount != null) + message.totalCount = object.totalCount | 0; + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.talent.v4.BatchOperationMetadata.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.talent.v4.BatchOperationMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.talent.v4.BatchOperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a BatchOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.BatchOperationMetadata + * @static + * @param {google.cloud.talent.v4.BatchOperationMetadata} message BatchOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateDescription = ""; + object.successCount = 0; + object.failureCount = 0; + object.totalCount = 0; + object.createTime = null; + object.updateTime = null; + object.endTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.talent.v4.BatchOperationMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.talent.v4.BatchOperationMetadata.State[message.state] : message.state; + if (message.stateDescription != null && message.hasOwnProperty("stateDescription")) + object.stateDescription = message.stateDescription; + if (message.successCount != null && message.hasOwnProperty("successCount")) + object.successCount = message.successCount; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + object.failureCount = message.failureCount; + if (message.totalCount != null && message.hasOwnProperty("totalCount")) + object.totalCount = message.totalCount; + 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.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this BatchOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.BatchOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.talent.v4.BatchOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.BatchOperationMetadata"; + }; + + /** + * State enum. + * @name google.cloud.talent.v4.BatchOperationMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} INITIALIZING=1 INITIALIZING value + * @property {number} PROCESSING=2 PROCESSING value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + * @property {number} CANCELLING=5 CANCELLING value + * @property {number} CANCELLED=6 CANCELLED value + */ + BatchOperationMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INITIALIZING"] = 1; + values[valuesById[2] = "PROCESSING"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "CANCELLING"] = 5; + values[valuesById[6] = "CANCELLED"] = 6; + return values; + })(); + + return BatchOperationMetadata; + })(); + + v4.Company = (function() { + + /** + * Properties of a Company. + * @memberof google.cloud.talent.v4 + * @interface ICompany + * @property {string|null} [name] Company name + * @property {string|null} [displayName] Company displayName + * @property {string|null} [externalId] Company externalId + * @property {google.cloud.talent.v4.CompanySize|null} [size] Company size + * @property {string|null} [headquartersAddress] Company headquartersAddress + * @property {boolean|null} [hiringAgency] Company hiringAgency + * @property {string|null} [eeoText] Company eeoText + * @property {string|null} [websiteUri] Company websiteUri + * @property {string|null} [careerSiteUri] Company careerSiteUri + * @property {string|null} [imageUri] Company imageUri + * @property {Array.|null} [keywordSearchableJobCustomAttributes] Company keywordSearchableJobCustomAttributes + * @property {google.cloud.talent.v4.Company.IDerivedInfo|null} [derivedInfo] Company derivedInfo + * @property {boolean|null} [suspended] Company suspended + */ + + /** + * Constructs a new Company. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a Company. + * @implements ICompany + * @constructor + * @param {google.cloud.talent.v4.ICompany=} [properties] Properties to set + */ + function Company(properties) { + this.keywordSearchableJobCustomAttributes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Company name. + * @member {string} name + * @memberof google.cloud.talent.v4.Company + * @instance + */ + Company.prototype.name = ""; + + /** + * Company displayName. + * @member {string} displayName + * @memberof google.cloud.talent.v4.Company + * @instance + */ + Company.prototype.displayName = ""; + + /** + * Company externalId. + * @member {string} externalId + * @memberof google.cloud.talent.v4.Company + * @instance + */ + Company.prototype.externalId = ""; + + /** + * Company size. + * @member {google.cloud.talent.v4.CompanySize} size + * @memberof google.cloud.talent.v4.Company + * @instance + */ + Company.prototype.size = 0; + + /** + * Company headquartersAddress. + * @member {string} headquartersAddress + * @memberof google.cloud.talent.v4.Company + * @instance + */ + Company.prototype.headquartersAddress = ""; + + /** + * Company hiringAgency. + * @member {boolean} hiringAgency + * @memberof google.cloud.talent.v4.Company + * @instance + */ + Company.prototype.hiringAgency = false; + + /** + * Company eeoText. + * @member {string} eeoText + * @memberof google.cloud.talent.v4.Company + * @instance + */ + Company.prototype.eeoText = ""; + + /** + * Company websiteUri. + * @member {string} websiteUri + * @memberof google.cloud.talent.v4.Company + * @instance + */ + Company.prototype.websiteUri = ""; + + /** + * Company careerSiteUri. + * @member {string} careerSiteUri + * @memberof google.cloud.talent.v4.Company + * @instance + */ + Company.prototype.careerSiteUri = ""; + + /** + * Company imageUri. + * @member {string} imageUri + * @memberof google.cloud.talent.v4.Company + * @instance + */ + Company.prototype.imageUri = ""; + + /** + * Company keywordSearchableJobCustomAttributes. + * @member {Array.} keywordSearchableJobCustomAttributes + * @memberof google.cloud.talent.v4.Company + * @instance + */ + Company.prototype.keywordSearchableJobCustomAttributes = $util.emptyArray; + + /** + * Company derivedInfo. + * @member {google.cloud.talent.v4.Company.IDerivedInfo|null|undefined} derivedInfo + * @memberof google.cloud.talent.v4.Company + * @instance + */ + Company.prototype.derivedInfo = null; + + /** + * Company suspended. + * @member {boolean} suspended + * @memberof google.cloud.talent.v4.Company + * @instance + */ + Company.prototype.suspended = false; + + /** + * Creates a new Company instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.Company + * @static + * @param {google.cloud.talent.v4.ICompany=} [properties] Properties to set + * @returns {google.cloud.talent.v4.Company} Company instance + */ + Company.create = function create(properties) { + return new Company(properties); + }; + + /** + * Encodes the specified Company message. Does not implicitly {@link google.cloud.talent.v4.Company.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.Company + * @static + * @param {google.cloud.talent.v4.ICompany} message Company message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Company.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.externalId != null && Object.hasOwnProperty.call(message, "externalId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalId); + if (message.size != null && Object.hasOwnProperty.call(message, "size")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.size); + if (message.headquartersAddress != null && Object.hasOwnProperty.call(message, "headquartersAddress")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.headquartersAddress); + if (message.hiringAgency != null && Object.hasOwnProperty.call(message, "hiringAgency")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.hiringAgency); + if (message.eeoText != null && Object.hasOwnProperty.call(message, "eeoText")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.eeoText); + if (message.websiteUri != null && Object.hasOwnProperty.call(message, "websiteUri")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.websiteUri); + if (message.careerSiteUri != null && Object.hasOwnProperty.call(message, "careerSiteUri")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.careerSiteUri); + if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.imageUri); + if (message.keywordSearchableJobCustomAttributes != null && message.keywordSearchableJobCustomAttributes.length) + for (var i = 0; i < message.keywordSearchableJobCustomAttributes.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.keywordSearchableJobCustomAttributes[i]); + if (message.derivedInfo != null && Object.hasOwnProperty.call(message, "derivedInfo")) + $root.google.cloud.talent.v4.Company.DerivedInfo.encode(message.derivedInfo, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.suspended != null && Object.hasOwnProperty.call(message, "suspended")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.suspended); + return writer; + }; + + /** + * Encodes the specified Company message, length delimited. Does not implicitly {@link google.cloud.talent.v4.Company.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.Company + * @static + * @param {google.cloud.talent.v4.ICompany} message Company message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Company.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Company message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.Company + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.Company} Company + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Company.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.Company(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.externalId = reader.string(); + break; + } + case 4: { + message.size = reader.int32(); + break; + } + case 5: { + message.headquartersAddress = reader.string(); + break; + } + case 6: { + message.hiringAgency = reader.bool(); + break; + } + case 7: { + message.eeoText = reader.string(); + break; + } + case 8: { + message.websiteUri = reader.string(); + break; + } + case 9: { + message.careerSiteUri = reader.string(); + break; + } + case 10: { + message.imageUri = reader.string(); + break; + } + case 11: { + if (!(message.keywordSearchableJobCustomAttributes && message.keywordSearchableJobCustomAttributes.length)) + message.keywordSearchableJobCustomAttributes = []; + message.keywordSearchableJobCustomAttributes.push(reader.string()); + break; + } + case 12: { + message.derivedInfo = $root.google.cloud.talent.v4.Company.DerivedInfo.decode(reader, reader.uint32()); + break; + } + case 13: { + message.suspended = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Company message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.Company + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.Company} Company + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Company.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Company message. + * @function verify + * @memberof google.cloud.talent.v4.Company + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Company.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.externalId != null && message.hasOwnProperty("externalId")) + if (!$util.isString(message.externalId)) + return "externalId: string expected"; + if (message.size != null && message.hasOwnProperty("size")) + switch (message.size) { + default: + return "size: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.headquartersAddress != null && message.hasOwnProperty("headquartersAddress")) + if (!$util.isString(message.headquartersAddress)) + return "headquartersAddress: string expected"; + if (message.hiringAgency != null && message.hasOwnProperty("hiringAgency")) + if (typeof message.hiringAgency !== "boolean") + return "hiringAgency: boolean expected"; + if (message.eeoText != null && message.hasOwnProperty("eeoText")) + if (!$util.isString(message.eeoText)) + return "eeoText: string expected"; + if (message.websiteUri != null && message.hasOwnProperty("websiteUri")) + if (!$util.isString(message.websiteUri)) + return "websiteUri: string expected"; + if (message.careerSiteUri != null && message.hasOwnProperty("careerSiteUri")) + if (!$util.isString(message.careerSiteUri)) + return "careerSiteUri: string expected"; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + if (message.keywordSearchableJobCustomAttributes != null && message.hasOwnProperty("keywordSearchableJobCustomAttributes")) { + if (!Array.isArray(message.keywordSearchableJobCustomAttributes)) + return "keywordSearchableJobCustomAttributes: array expected"; + for (var i = 0; i < message.keywordSearchableJobCustomAttributes.length; ++i) + if (!$util.isString(message.keywordSearchableJobCustomAttributes[i])) + return "keywordSearchableJobCustomAttributes: string[] expected"; + } + if (message.derivedInfo != null && message.hasOwnProperty("derivedInfo")) { + var error = $root.google.cloud.talent.v4.Company.DerivedInfo.verify(message.derivedInfo); + if (error) + return "derivedInfo." + error; + } + if (message.suspended != null && message.hasOwnProperty("suspended")) + if (typeof message.suspended !== "boolean") + return "suspended: boolean expected"; + return null; + }; + + /** + * Creates a Company message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.Company + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.Company} Company + */ + Company.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.Company) + return object; + var message = new $root.google.cloud.talent.v4.Company(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.externalId != null) + message.externalId = String(object.externalId); + switch (object.size) { + default: + if (typeof object.size === "number") { + message.size = object.size; + break; + } + break; + case "COMPANY_SIZE_UNSPECIFIED": + case 0: + message.size = 0; + break; + case "MINI": + case 1: + message.size = 1; + break; + case "SMALL": + case 2: + message.size = 2; + break; + case "SMEDIUM": + case 3: + message.size = 3; + break; + case "MEDIUM": + case 4: + message.size = 4; + break; + case "BIG": + case 5: + message.size = 5; + break; + case "BIGGER": + case 6: + message.size = 6; + break; + case "GIANT": + case 7: + message.size = 7; + break; + } + if (object.headquartersAddress != null) + message.headquartersAddress = String(object.headquartersAddress); + if (object.hiringAgency != null) + message.hiringAgency = Boolean(object.hiringAgency); + if (object.eeoText != null) + message.eeoText = String(object.eeoText); + if (object.websiteUri != null) + message.websiteUri = String(object.websiteUri); + if (object.careerSiteUri != null) + message.careerSiteUri = String(object.careerSiteUri); + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + if (object.keywordSearchableJobCustomAttributes) { + if (!Array.isArray(object.keywordSearchableJobCustomAttributes)) + throw TypeError(".google.cloud.talent.v4.Company.keywordSearchableJobCustomAttributes: array expected"); + message.keywordSearchableJobCustomAttributes = []; + for (var i = 0; i < object.keywordSearchableJobCustomAttributes.length; ++i) + message.keywordSearchableJobCustomAttributes[i] = String(object.keywordSearchableJobCustomAttributes[i]); + } + if (object.derivedInfo != null) { + if (typeof object.derivedInfo !== "object") + throw TypeError(".google.cloud.talent.v4.Company.derivedInfo: object expected"); + message.derivedInfo = $root.google.cloud.talent.v4.Company.DerivedInfo.fromObject(object.derivedInfo); + } + if (object.suspended != null) + message.suspended = Boolean(object.suspended); + return message; + }; + + /** + * Creates a plain object from a Company message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.Company + * @static + * @param {google.cloud.talent.v4.Company} message Company + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Company.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keywordSearchableJobCustomAttributes = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.externalId = ""; + object.size = options.enums === String ? "COMPANY_SIZE_UNSPECIFIED" : 0; + object.headquartersAddress = ""; + object.hiringAgency = false; + object.eeoText = ""; + object.websiteUri = ""; + object.careerSiteUri = ""; + object.imageUri = ""; + object.derivedInfo = null; + object.suspended = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.externalId != null && message.hasOwnProperty("externalId")) + object.externalId = message.externalId; + if (message.size != null && message.hasOwnProperty("size")) + object.size = options.enums === String ? $root.google.cloud.talent.v4.CompanySize[message.size] === undefined ? message.size : $root.google.cloud.talent.v4.CompanySize[message.size] : message.size; + if (message.headquartersAddress != null && message.hasOwnProperty("headquartersAddress")) + object.headquartersAddress = message.headquartersAddress; + if (message.hiringAgency != null && message.hasOwnProperty("hiringAgency")) + object.hiringAgency = message.hiringAgency; + if (message.eeoText != null && message.hasOwnProperty("eeoText")) + object.eeoText = message.eeoText; + if (message.websiteUri != null && message.hasOwnProperty("websiteUri")) + object.websiteUri = message.websiteUri; + if (message.careerSiteUri != null && message.hasOwnProperty("careerSiteUri")) + object.careerSiteUri = message.careerSiteUri; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + if (message.keywordSearchableJobCustomAttributes && message.keywordSearchableJobCustomAttributes.length) { + object.keywordSearchableJobCustomAttributes = []; + for (var j = 0; j < message.keywordSearchableJobCustomAttributes.length; ++j) + object.keywordSearchableJobCustomAttributes[j] = message.keywordSearchableJobCustomAttributes[j]; + } + if (message.derivedInfo != null && message.hasOwnProperty("derivedInfo")) + object.derivedInfo = $root.google.cloud.talent.v4.Company.DerivedInfo.toObject(message.derivedInfo, options); + if (message.suspended != null && message.hasOwnProperty("suspended")) + object.suspended = message.suspended; + return object; + }; + + /** + * Converts this Company to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.Company + * @instance + * @returns {Object.} JSON object + */ + Company.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Company + * @function getTypeUrl + * @memberof google.cloud.talent.v4.Company + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Company.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.Company"; + }; + + Company.DerivedInfo = (function() { + + /** + * Properties of a DerivedInfo. + * @memberof google.cloud.talent.v4.Company + * @interface IDerivedInfo + * @property {google.cloud.talent.v4.ILocation|null} [headquartersLocation] DerivedInfo headquartersLocation + */ + + /** + * Constructs a new DerivedInfo. + * @memberof google.cloud.talent.v4.Company + * @classdesc Represents a DerivedInfo. + * @implements IDerivedInfo + * @constructor + * @param {google.cloud.talent.v4.Company.IDerivedInfo=} [properties] Properties to set + */ + function DerivedInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DerivedInfo headquartersLocation. + * @member {google.cloud.talent.v4.ILocation|null|undefined} headquartersLocation + * @memberof google.cloud.talent.v4.Company.DerivedInfo + * @instance + */ + DerivedInfo.prototype.headquartersLocation = null; + + /** + * Creates a new DerivedInfo instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.Company.DerivedInfo + * @static + * @param {google.cloud.talent.v4.Company.IDerivedInfo=} [properties] Properties to set + * @returns {google.cloud.talent.v4.Company.DerivedInfo} DerivedInfo instance + */ + DerivedInfo.create = function create(properties) { + return new DerivedInfo(properties); + }; + + /** + * Encodes the specified DerivedInfo message. Does not implicitly {@link google.cloud.talent.v4.Company.DerivedInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.Company.DerivedInfo + * @static + * @param {google.cloud.talent.v4.Company.IDerivedInfo} message DerivedInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DerivedInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.headquartersLocation != null && Object.hasOwnProperty.call(message, "headquartersLocation")) + $root.google.cloud.talent.v4.Location.encode(message.headquartersLocation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DerivedInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4.Company.DerivedInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.Company.DerivedInfo + * @static + * @param {google.cloud.talent.v4.Company.IDerivedInfo} message DerivedInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DerivedInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DerivedInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.Company.DerivedInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.Company.DerivedInfo} DerivedInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DerivedInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.Company.DerivedInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.headquartersLocation = $root.google.cloud.talent.v4.Location.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DerivedInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.Company.DerivedInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.Company.DerivedInfo} DerivedInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DerivedInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DerivedInfo message. + * @function verify + * @memberof google.cloud.talent.v4.Company.DerivedInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DerivedInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.headquartersLocation != null && message.hasOwnProperty("headquartersLocation")) { + var error = $root.google.cloud.talent.v4.Location.verify(message.headquartersLocation); + if (error) + return "headquartersLocation." + error; + } + return null; + }; + + /** + * Creates a DerivedInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.Company.DerivedInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.Company.DerivedInfo} DerivedInfo + */ + DerivedInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.Company.DerivedInfo) + return object; + var message = new $root.google.cloud.talent.v4.Company.DerivedInfo(); + if (object.headquartersLocation != null) { + if (typeof object.headquartersLocation !== "object") + throw TypeError(".google.cloud.talent.v4.Company.DerivedInfo.headquartersLocation: object expected"); + message.headquartersLocation = $root.google.cloud.talent.v4.Location.fromObject(object.headquartersLocation); + } + return message; + }; + + /** + * Creates a plain object from a DerivedInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.Company.DerivedInfo + * @static + * @param {google.cloud.talent.v4.Company.DerivedInfo} message DerivedInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DerivedInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.headquartersLocation = null; + if (message.headquartersLocation != null && message.hasOwnProperty("headquartersLocation")) + object.headquartersLocation = $root.google.cloud.talent.v4.Location.toObject(message.headquartersLocation, options); + return object; + }; + + /** + * Converts this DerivedInfo to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.Company.DerivedInfo + * @instance + * @returns {Object.} JSON object + */ + DerivedInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DerivedInfo + * @function getTypeUrl + * @memberof google.cloud.talent.v4.Company.DerivedInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DerivedInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.Company.DerivedInfo"; + }; + + return DerivedInfo; + })(); + + return Company; + })(); + + v4.CompanyService = (function() { + + /** + * Constructs a new CompanyService service. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a CompanyService + * @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 CompanyService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CompanyService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CompanyService; + + /** + * Creates new CompanyService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.talent.v4.CompanyService + * @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 {CompanyService} RPC service. Useful where requests and/or responses are streamed. + */ + CompanyService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.talent.v4.CompanyService|createCompany}. + * @memberof google.cloud.talent.v4.CompanyService + * @typedef CreateCompanyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4.Company} [response] Company + */ + + /** + * Calls CreateCompany. + * @function createCompany + * @memberof google.cloud.talent.v4.CompanyService + * @instance + * @param {google.cloud.talent.v4.ICreateCompanyRequest} request CreateCompanyRequest message or plain object + * @param {google.cloud.talent.v4.CompanyService.CreateCompanyCallback} callback Node-style callback called with the error, if any, and Company + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CompanyService.prototype.createCompany = function createCompany(request, callback) { + return this.rpcCall(createCompany, $root.google.cloud.talent.v4.CreateCompanyRequest, $root.google.cloud.talent.v4.Company, request, callback); + }, "name", { value: "CreateCompany" }); + + /** + * Calls CreateCompany. + * @function createCompany + * @memberof google.cloud.talent.v4.CompanyService + * @instance + * @param {google.cloud.talent.v4.ICreateCompanyRequest} request CreateCompanyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4.CompanyService|getCompany}. + * @memberof google.cloud.talent.v4.CompanyService + * @typedef GetCompanyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4.Company} [response] Company + */ + + /** + * Calls GetCompany. + * @function getCompany + * @memberof google.cloud.talent.v4.CompanyService + * @instance + * @param {google.cloud.talent.v4.IGetCompanyRequest} request GetCompanyRequest message or plain object + * @param {google.cloud.talent.v4.CompanyService.GetCompanyCallback} callback Node-style callback called with the error, if any, and Company + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CompanyService.prototype.getCompany = function getCompany(request, callback) { + return this.rpcCall(getCompany, $root.google.cloud.talent.v4.GetCompanyRequest, $root.google.cloud.talent.v4.Company, request, callback); + }, "name", { value: "GetCompany" }); + + /** + * Calls GetCompany. + * @function getCompany + * @memberof google.cloud.talent.v4.CompanyService + * @instance + * @param {google.cloud.talent.v4.IGetCompanyRequest} request GetCompanyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4.CompanyService|updateCompany}. + * @memberof google.cloud.talent.v4.CompanyService + * @typedef UpdateCompanyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4.Company} [response] Company + */ + + /** + * Calls UpdateCompany. + * @function updateCompany + * @memberof google.cloud.talent.v4.CompanyService + * @instance + * @param {google.cloud.talent.v4.IUpdateCompanyRequest} request UpdateCompanyRequest message or plain object + * @param {google.cloud.talent.v4.CompanyService.UpdateCompanyCallback} callback Node-style callback called with the error, if any, and Company + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CompanyService.prototype.updateCompany = function updateCompany(request, callback) { + return this.rpcCall(updateCompany, $root.google.cloud.talent.v4.UpdateCompanyRequest, $root.google.cloud.talent.v4.Company, request, callback); + }, "name", { value: "UpdateCompany" }); + + /** + * Calls UpdateCompany. + * @function updateCompany + * @memberof google.cloud.talent.v4.CompanyService + * @instance + * @param {google.cloud.talent.v4.IUpdateCompanyRequest} request UpdateCompanyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4.CompanyService|deleteCompany}. + * @memberof google.cloud.talent.v4.CompanyService + * @typedef DeleteCompanyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteCompany. + * @function deleteCompany + * @memberof google.cloud.talent.v4.CompanyService + * @instance + * @param {google.cloud.talent.v4.IDeleteCompanyRequest} request DeleteCompanyRequest message or plain object + * @param {google.cloud.talent.v4.CompanyService.DeleteCompanyCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CompanyService.prototype.deleteCompany = function deleteCompany(request, callback) { + return this.rpcCall(deleteCompany, $root.google.cloud.talent.v4.DeleteCompanyRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteCompany" }); + + /** + * Calls DeleteCompany. + * @function deleteCompany + * @memberof google.cloud.talent.v4.CompanyService + * @instance + * @param {google.cloud.talent.v4.IDeleteCompanyRequest} request DeleteCompanyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4.CompanyService|listCompanies}. + * @memberof google.cloud.talent.v4.CompanyService + * @typedef ListCompaniesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4.ListCompaniesResponse} [response] ListCompaniesResponse + */ + + /** + * Calls ListCompanies. + * @function listCompanies + * @memberof google.cloud.talent.v4.CompanyService + * @instance + * @param {google.cloud.talent.v4.IListCompaniesRequest} request ListCompaniesRequest message or plain object + * @param {google.cloud.talent.v4.CompanyService.ListCompaniesCallback} callback Node-style callback called with the error, if any, and ListCompaniesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CompanyService.prototype.listCompanies = function listCompanies(request, callback) { + return this.rpcCall(listCompanies, $root.google.cloud.talent.v4.ListCompaniesRequest, $root.google.cloud.talent.v4.ListCompaniesResponse, request, callback); + }, "name", { value: "ListCompanies" }); + + /** + * Calls ListCompanies. + * @function listCompanies + * @memberof google.cloud.talent.v4.CompanyService + * @instance + * @param {google.cloud.talent.v4.IListCompaniesRequest} request ListCompaniesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CompanyService; + })(); + + v4.CreateCompanyRequest = (function() { + + /** + * Properties of a CreateCompanyRequest. + * @memberof google.cloud.talent.v4 + * @interface ICreateCompanyRequest + * @property {string|null} [parent] CreateCompanyRequest parent + * @property {google.cloud.talent.v4.ICompany|null} [company] CreateCompanyRequest company + */ + + /** + * Constructs a new CreateCompanyRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a CreateCompanyRequest. + * @implements ICreateCompanyRequest + * @constructor + * @param {google.cloud.talent.v4.ICreateCompanyRequest=} [properties] Properties to set + */ + function CreateCompanyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCompanyRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4.CreateCompanyRequest + * @instance + */ + CreateCompanyRequest.prototype.parent = ""; + + /** + * CreateCompanyRequest company. + * @member {google.cloud.talent.v4.ICompany|null|undefined} company + * @memberof google.cloud.talent.v4.CreateCompanyRequest + * @instance + */ + CreateCompanyRequest.prototype.company = null; + + /** + * Creates a new CreateCompanyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.CreateCompanyRequest + * @static + * @param {google.cloud.talent.v4.ICreateCompanyRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.CreateCompanyRequest} CreateCompanyRequest instance + */ + CreateCompanyRequest.create = function create(properties) { + return new CreateCompanyRequest(properties); + }; + + /** + * Encodes the specified CreateCompanyRequest message. Does not implicitly {@link google.cloud.talent.v4.CreateCompanyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.CreateCompanyRequest + * @static + * @param {google.cloud.talent.v4.ICreateCompanyRequest} message CreateCompanyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCompanyRequest.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.company != null && Object.hasOwnProperty.call(message, "company")) + $root.google.cloud.talent.v4.Company.encode(message.company, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCompanyRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CreateCompanyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.CreateCompanyRequest + * @static + * @param {google.cloud.talent.v4.ICreateCompanyRequest} message CreateCompanyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCompanyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCompanyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.CreateCompanyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.CreateCompanyRequest} CreateCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCompanyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.CreateCompanyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.company = $root.google.cloud.talent.v4.Company.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCompanyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.CreateCompanyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.CreateCompanyRequest} CreateCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCompanyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCompanyRequest message. + * @function verify + * @memberof google.cloud.talent.v4.CreateCompanyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCompanyRequest.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.company != null && message.hasOwnProperty("company")) { + var error = $root.google.cloud.talent.v4.Company.verify(message.company); + if (error) + return "company." + error; + } + return null; + }; + + /** + * Creates a CreateCompanyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.CreateCompanyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.CreateCompanyRequest} CreateCompanyRequest + */ + CreateCompanyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.CreateCompanyRequest) + return object; + var message = new $root.google.cloud.talent.v4.CreateCompanyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.company != null) { + if (typeof object.company !== "object") + throw TypeError(".google.cloud.talent.v4.CreateCompanyRequest.company: object expected"); + message.company = $root.google.cloud.talent.v4.Company.fromObject(object.company); + } + return message; + }; + + /** + * Creates a plain object from a CreateCompanyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.CreateCompanyRequest + * @static + * @param {google.cloud.talent.v4.CreateCompanyRequest} message CreateCompanyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCompanyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.company = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.company != null && message.hasOwnProperty("company")) + object.company = $root.google.cloud.talent.v4.Company.toObject(message.company, options); + return object; + }; + + /** + * Converts this CreateCompanyRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.CreateCompanyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCompanyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCompanyRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.CreateCompanyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCompanyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.CreateCompanyRequest"; + }; + + return CreateCompanyRequest; + })(); + + v4.GetCompanyRequest = (function() { + + /** + * Properties of a GetCompanyRequest. + * @memberof google.cloud.talent.v4 + * @interface IGetCompanyRequest + * @property {string|null} [name] GetCompanyRequest name + */ + + /** + * Constructs a new GetCompanyRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a GetCompanyRequest. + * @implements IGetCompanyRequest + * @constructor + * @param {google.cloud.talent.v4.IGetCompanyRequest=} [properties] Properties to set + */ + function GetCompanyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCompanyRequest name. + * @member {string} name + * @memberof google.cloud.talent.v4.GetCompanyRequest + * @instance + */ + GetCompanyRequest.prototype.name = ""; + + /** + * Creates a new GetCompanyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.GetCompanyRequest + * @static + * @param {google.cloud.talent.v4.IGetCompanyRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.GetCompanyRequest} GetCompanyRequest instance + */ + GetCompanyRequest.create = function create(properties) { + return new GetCompanyRequest(properties); + }; + + /** + * Encodes the specified GetCompanyRequest message. Does not implicitly {@link google.cloud.talent.v4.GetCompanyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.GetCompanyRequest + * @static + * @param {google.cloud.talent.v4.IGetCompanyRequest} message GetCompanyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCompanyRequest.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 GetCompanyRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.GetCompanyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.GetCompanyRequest + * @static + * @param {google.cloud.talent.v4.IGetCompanyRequest} message GetCompanyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCompanyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCompanyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.GetCompanyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.GetCompanyRequest} GetCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCompanyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.GetCompanyRequest(); + 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 GetCompanyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.GetCompanyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.GetCompanyRequest} GetCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCompanyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCompanyRequest message. + * @function verify + * @memberof google.cloud.talent.v4.GetCompanyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCompanyRequest.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 GetCompanyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.GetCompanyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.GetCompanyRequest} GetCompanyRequest + */ + GetCompanyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.GetCompanyRequest) + return object; + var message = new $root.google.cloud.talent.v4.GetCompanyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCompanyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.GetCompanyRequest + * @static + * @param {google.cloud.talent.v4.GetCompanyRequest} message GetCompanyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCompanyRequest.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 GetCompanyRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.GetCompanyRequest + * @instance + * @returns {Object.} JSON object + */ + GetCompanyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCompanyRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.GetCompanyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCompanyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.GetCompanyRequest"; + }; + + return GetCompanyRequest; + })(); + + v4.UpdateCompanyRequest = (function() { + + /** + * Properties of an UpdateCompanyRequest. + * @memberof google.cloud.talent.v4 + * @interface IUpdateCompanyRequest + * @property {google.cloud.talent.v4.ICompany|null} [company] UpdateCompanyRequest company + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCompanyRequest updateMask + */ + + /** + * Constructs a new UpdateCompanyRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents an UpdateCompanyRequest. + * @implements IUpdateCompanyRequest + * @constructor + * @param {google.cloud.talent.v4.IUpdateCompanyRequest=} [properties] Properties to set + */ + function UpdateCompanyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCompanyRequest company. + * @member {google.cloud.talent.v4.ICompany|null|undefined} company + * @memberof google.cloud.talent.v4.UpdateCompanyRequest + * @instance + */ + UpdateCompanyRequest.prototype.company = null; + + /** + * UpdateCompanyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.talent.v4.UpdateCompanyRequest + * @instance + */ + UpdateCompanyRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCompanyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.UpdateCompanyRequest + * @static + * @param {google.cloud.talent.v4.IUpdateCompanyRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.UpdateCompanyRequest} UpdateCompanyRequest instance + */ + UpdateCompanyRequest.create = function create(properties) { + return new UpdateCompanyRequest(properties); + }; + + /** + * Encodes the specified UpdateCompanyRequest message. Does not implicitly {@link google.cloud.talent.v4.UpdateCompanyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.UpdateCompanyRequest + * @static + * @param {google.cloud.talent.v4.IUpdateCompanyRequest} message UpdateCompanyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCompanyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.company != null && Object.hasOwnProperty.call(message, "company")) + $root.google.cloud.talent.v4.Company.encode(message.company, 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 UpdateCompanyRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.UpdateCompanyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.UpdateCompanyRequest + * @static + * @param {google.cloud.talent.v4.IUpdateCompanyRequest} message UpdateCompanyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCompanyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCompanyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.UpdateCompanyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.UpdateCompanyRequest} UpdateCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCompanyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.UpdateCompanyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.company = $root.google.cloud.talent.v4.Company.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 UpdateCompanyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.UpdateCompanyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.UpdateCompanyRequest} UpdateCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCompanyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCompanyRequest message. + * @function verify + * @memberof google.cloud.talent.v4.UpdateCompanyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCompanyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.company != null && message.hasOwnProperty("company")) { + var error = $root.google.cloud.talent.v4.Company.verify(message.company); + if (error) + return "company." + 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 UpdateCompanyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.UpdateCompanyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.UpdateCompanyRequest} UpdateCompanyRequest + */ + UpdateCompanyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.UpdateCompanyRequest) + return object; + var message = new $root.google.cloud.talent.v4.UpdateCompanyRequest(); + if (object.company != null) { + if (typeof object.company !== "object") + throw TypeError(".google.cloud.talent.v4.UpdateCompanyRequest.company: object expected"); + message.company = $root.google.cloud.talent.v4.Company.fromObject(object.company); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.talent.v4.UpdateCompanyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCompanyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.UpdateCompanyRequest + * @static + * @param {google.cloud.talent.v4.UpdateCompanyRequest} message UpdateCompanyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCompanyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.company = null; + object.updateMask = null; + } + if (message.company != null && message.hasOwnProperty("company")) + object.company = $root.google.cloud.talent.v4.Company.toObject(message.company, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCompanyRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.UpdateCompanyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCompanyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCompanyRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.UpdateCompanyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCompanyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.UpdateCompanyRequest"; + }; + + return UpdateCompanyRequest; + })(); + + v4.DeleteCompanyRequest = (function() { + + /** + * Properties of a DeleteCompanyRequest. + * @memberof google.cloud.talent.v4 + * @interface IDeleteCompanyRequest + * @property {string|null} [name] DeleteCompanyRequest name + */ + + /** + * Constructs a new DeleteCompanyRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a DeleteCompanyRequest. + * @implements IDeleteCompanyRequest + * @constructor + * @param {google.cloud.talent.v4.IDeleteCompanyRequest=} [properties] Properties to set + */ + function DeleteCompanyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteCompanyRequest name. + * @member {string} name + * @memberof google.cloud.talent.v4.DeleteCompanyRequest + * @instance + */ + DeleteCompanyRequest.prototype.name = ""; + + /** + * Creates a new DeleteCompanyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.DeleteCompanyRequest + * @static + * @param {google.cloud.talent.v4.IDeleteCompanyRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.DeleteCompanyRequest} DeleteCompanyRequest instance + */ + DeleteCompanyRequest.create = function create(properties) { + return new DeleteCompanyRequest(properties); + }; + + /** + * Encodes the specified DeleteCompanyRequest message. Does not implicitly {@link google.cloud.talent.v4.DeleteCompanyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.DeleteCompanyRequest + * @static + * @param {google.cloud.talent.v4.IDeleteCompanyRequest} message DeleteCompanyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCompanyRequest.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 DeleteCompanyRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.DeleteCompanyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.DeleteCompanyRequest + * @static + * @param {google.cloud.talent.v4.IDeleteCompanyRequest} message DeleteCompanyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCompanyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCompanyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.DeleteCompanyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.DeleteCompanyRequest} DeleteCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCompanyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.DeleteCompanyRequest(); + 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 DeleteCompanyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.DeleteCompanyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.DeleteCompanyRequest} DeleteCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCompanyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCompanyRequest message. + * @function verify + * @memberof google.cloud.talent.v4.DeleteCompanyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCompanyRequest.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 DeleteCompanyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.DeleteCompanyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.DeleteCompanyRequest} DeleteCompanyRequest + */ + DeleteCompanyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.DeleteCompanyRequest) + return object; + var message = new $root.google.cloud.talent.v4.DeleteCompanyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteCompanyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.DeleteCompanyRequest + * @static + * @param {google.cloud.talent.v4.DeleteCompanyRequest} message DeleteCompanyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCompanyRequest.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 DeleteCompanyRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.DeleteCompanyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCompanyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCompanyRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.DeleteCompanyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCompanyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.DeleteCompanyRequest"; + }; + + return DeleteCompanyRequest; + })(); + + v4.ListCompaniesRequest = (function() { + + /** + * Properties of a ListCompaniesRequest. + * @memberof google.cloud.talent.v4 + * @interface IListCompaniesRequest + * @property {string|null} [parent] ListCompaniesRequest parent + * @property {string|null} [pageToken] ListCompaniesRequest pageToken + * @property {number|null} [pageSize] ListCompaniesRequest pageSize + * @property {boolean|null} [requireOpenJobs] ListCompaniesRequest requireOpenJobs + */ + + /** + * Constructs a new ListCompaniesRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a ListCompaniesRequest. + * @implements IListCompaniesRequest + * @constructor + * @param {google.cloud.talent.v4.IListCompaniesRequest=} [properties] Properties to set + */ + function ListCompaniesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCompaniesRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4.ListCompaniesRequest + * @instance + */ + ListCompaniesRequest.prototype.parent = ""; + + /** + * ListCompaniesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.talent.v4.ListCompaniesRequest + * @instance + */ + ListCompaniesRequest.prototype.pageToken = ""; + + /** + * ListCompaniesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.talent.v4.ListCompaniesRequest + * @instance + */ + ListCompaniesRequest.prototype.pageSize = 0; + + /** + * ListCompaniesRequest requireOpenJobs. + * @member {boolean} requireOpenJobs + * @memberof google.cloud.talent.v4.ListCompaniesRequest + * @instance + */ + ListCompaniesRequest.prototype.requireOpenJobs = false; + + /** + * Creates a new ListCompaniesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.ListCompaniesRequest + * @static + * @param {google.cloud.talent.v4.IListCompaniesRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.ListCompaniesRequest} ListCompaniesRequest instance + */ + ListCompaniesRequest.create = function create(properties) { + return new ListCompaniesRequest(properties); + }; + + /** + * Encodes the specified ListCompaniesRequest message. Does not implicitly {@link google.cloud.talent.v4.ListCompaniesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.ListCompaniesRequest + * @static + * @param {google.cloud.talent.v4.IListCompaniesRequest} message ListCompaniesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCompaniesRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.requireOpenJobs != null && Object.hasOwnProperty.call(message, "requireOpenJobs")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.requireOpenJobs); + return writer; + }; + + /** + * Encodes the specified ListCompaniesRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.ListCompaniesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.ListCompaniesRequest + * @static + * @param {google.cloud.talent.v4.IListCompaniesRequest} message ListCompaniesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCompaniesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCompaniesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.ListCompaniesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.ListCompaniesRequest} ListCompaniesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCompaniesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.ListCompaniesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.requireOpenJobs = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCompaniesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.ListCompaniesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.ListCompaniesRequest} ListCompaniesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCompaniesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCompaniesRequest message. + * @function verify + * @memberof google.cloud.talent.v4.ListCompaniesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCompaniesRequest.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.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.requireOpenJobs != null && message.hasOwnProperty("requireOpenJobs")) + if (typeof message.requireOpenJobs !== "boolean") + return "requireOpenJobs: boolean expected"; + return null; + }; + + /** + * Creates a ListCompaniesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.ListCompaniesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.ListCompaniesRequest} ListCompaniesRequest + */ + ListCompaniesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.ListCompaniesRequest) + return object; + var message = new $root.google.cloud.talent.v4.ListCompaniesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.requireOpenJobs != null) + message.requireOpenJobs = Boolean(object.requireOpenJobs); + return message; + }; + + /** + * Creates a plain object from a ListCompaniesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.ListCompaniesRequest + * @static + * @param {google.cloud.talent.v4.ListCompaniesRequest} message ListCompaniesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCompaniesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + object.requireOpenJobs = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.requireOpenJobs != null && message.hasOwnProperty("requireOpenJobs")) + object.requireOpenJobs = message.requireOpenJobs; + return object; + }; + + /** + * Converts this ListCompaniesRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.ListCompaniesRequest + * @instance + * @returns {Object.} JSON object + */ + ListCompaniesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCompaniesRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.ListCompaniesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCompaniesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.ListCompaniesRequest"; + }; + + return ListCompaniesRequest; + })(); + + v4.ListCompaniesResponse = (function() { + + /** + * Properties of a ListCompaniesResponse. + * @memberof google.cloud.talent.v4 + * @interface IListCompaniesResponse + * @property {Array.|null} [companies] ListCompaniesResponse companies + * @property {string|null} [nextPageToken] ListCompaniesResponse nextPageToken + * @property {google.cloud.talent.v4.IResponseMetadata|null} [metadata] ListCompaniesResponse metadata + */ + + /** + * Constructs a new ListCompaniesResponse. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a ListCompaniesResponse. + * @implements IListCompaniesResponse + * @constructor + * @param {google.cloud.talent.v4.IListCompaniesResponse=} [properties] Properties to set + */ + function ListCompaniesResponse(properties) { + this.companies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCompaniesResponse companies. + * @member {Array.} companies + * @memberof google.cloud.talent.v4.ListCompaniesResponse + * @instance + */ + ListCompaniesResponse.prototype.companies = $util.emptyArray; + + /** + * ListCompaniesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.talent.v4.ListCompaniesResponse + * @instance + */ + ListCompaniesResponse.prototype.nextPageToken = ""; + + /** + * ListCompaniesResponse metadata. + * @member {google.cloud.talent.v4.IResponseMetadata|null|undefined} metadata + * @memberof google.cloud.talent.v4.ListCompaniesResponse + * @instance + */ + ListCompaniesResponse.prototype.metadata = null; + + /** + * Creates a new ListCompaniesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.ListCompaniesResponse + * @static + * @param {google.cloud.talent.v4.IListCompaniesResponse=} [properties] Properties to set + * @returns {google.cloud.talent.v4.ListCompaniesResponse} ListCompaniesResponse instance + */ + ListCompaniesResponse.create = function create(properties) { + return new ListCompaniesResponse(properties); + }; + + /** + * Encodes the specified ListCompaniesResponse message. Does not implicitly {@link google.cloud.talent.v4.ListCompaniesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.ListCompaniesResponse + * @static + * @param {google.cloud.talent.v4.IListCompaniesResponse} message ListCompaniesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCompaniesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.companies != null && message.companies.length) + for (var i = 0; i < message.companies.length; ++i) + $root.google.cloud.talent.v4.Company.encode(message.companies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.talent.v4.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListCompaniesResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4.ListCompaniesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.ListCompaniesResponse + * @static + * @param {google.cloud.talent.v4.IListCompaniesResponse} message ListCompaniesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCompaniesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCompaniesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.ListCompaniesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.ListCompaniesResponse} ListCompaniesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCompaniesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.ListCompaniesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.companies && message.companies.length)) + message.companies = []; + message.companies.push($root.google.cloud.talent.v4.Company.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.metadata = $root.google.cloud.talent.v4.ResponseMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCompaniesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.ListCompaniesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.ListCompaniesResponse} ListCompaniesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCompaniesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCompaniesResponse message. + * @function verify + * @memberof google.cloud.talent.v4.ListCompaniesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCompaniesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.companies != null && message.hasOwnProperty("companies")) { + if (!Array.isArray(message.companies)) + return "companies: array expected"; + for (var i = 0; i < message.companies.length; ++i) { + var error = $root.google.cloud.talent.v4.Company.verify(message.companies[i]); + if (error) + return "companies." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.talent.v4.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a ListCompaniesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.ListCompaniesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.ListCompaniesResponse} ListCompaniesResponse + */ + ListCompaniesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.ListCompaniesResponse) + return object; + var message = new $root.google.cloud.talent.v4.ListCompaniesResponse(); + if (object.companies) { + if (!Array.isArray(object.companies)) + throw TypeError(".google.cloud.talent.v4.ListCompaniesResponse.companies: array expected"); + message.companies = []; + for (var i = 0; i < object.companies.length; ++i) { + if (typeof object.companies[i] !== "object") + throw TypeError(".google.cloud.talent.v4.ListCompaniesResponse.companies: object expected"); + message.companies[i] = $root.google.cloud.talent.v4.Company.fromObject(object.companies[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.talent.v4.ListCompaniesResponse.metadata: object expected"); + message.metadata = $root.google.cloud.talent.v4.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a ListCompaniesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.ListCompaniesResponse + * @static + * @param {google.cloud.talent.v4.ListCompaniesResponse} message ListCompaniesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCompaniesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.companies = []; + if (options.defaults) { + object.nextPageToken = ""; + object.metadata = null; + } + if (message.companies && message.companies.length) { + object.companies = []; + for (var j = 0; j < message.companies.length; ++j) + object.companies[j] = $root.google.cloud.talent.v4.Company.toObject(message.companies[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.talent.v4.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this ListCompaniesResponse to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.ListCompaniesResponse + * @instance + * @returns {Object.} JSON object + */ + ListCompaniesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCompaniesResponse + * @function getTypeUrl + * @memberof google.cloud.talent.v4.ListCompaniesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCompaniesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.ListCompaniesResponse"; + }; + + return ListCompaniesResponse; + })(); + + v4.Completion = (function() { + + /** + * Constructs a new Completion service. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a Completion + * @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 Completion(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Completion.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Completion; + + /** + * Creates new Completion service using the specified rpc implementation. + * @function create + * @memberof google.cloud.talent.v4.Completion + * @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 {Completion} RPC service. Useful where requests and/or responses are streamed. + */ + Completion.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.talent.v4.Completion|completeQuery}. + * @memberof google.cloud.talent.v4.Completion + * @typedef CompleteQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4.CompleteQueryResponse} [response] CompleteQueryResponse + */ + + /** + * Calls CompleteQuery. + * @function completeQuery + * @memberof google.cloud.talent.v4.Completion + * @instance + * @param {google.cloud.talent.v4.ICompleteQueryRequest} request CompleteQueryRequest message or plain object + * @param {google.cloud.talent.v4.Completion.CompleteQueryCallback} callback Node-style callback called with the error, if any, and CompleteQueryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Completion.prototype.completeQuery = function completeQuery(request, callback) { + return this.rpcCall(completeQuery, $root.google.cloud.talent.v4.CompleteQueryRequest, $root.google.cloud.talent.v4.CompleteQueryResponse, request, callback); + }, "name", { value: "CompleteQuery" }); + + /** + * Calls CompleteQuery. + * @function completeQuery + * @memberof google.cloud.talent.v4.Completion + * @instance + * @param {google.cloud.talent.v4.ICompleteQueryRequest} request CompleteQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Completion; + })(); + + v4.CompleteQueryRequest = (function() { + + /** + * Properties of a CompleteQueryRequest. + * @memberof google.cloud.talent.v4 + * @interface ICompleteQueryRequest + * @property {string|null} [tenant] CompleteQueryRequest tenant + * @property {string|null} [query] CompleteQueryRequest query + * @property {Array.|null} [languageCodes] CompleteQueryRequest languageCodes + * @property {number|null} [pageSize] CompleteQueryRequest pageSize + * @property {string|null} [company] CompleteQueryRequest company + * @property {google.cloud.talent.v4.CompleteQueryRequest.CompletionScope|null} [scope] CompleteQueryRequest scope + * @property {google.cloud.talent.v4.CompleteQueryRequest.CompletionType|null} [type] CompleteQueryRequest type + */ + + /** + * Constructs a new CompleteQueryRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a CompleteQueryRequest. + * @implements ICompleteQueryRequest + * @constructor + * @param {google.cloud.talent.v4.ICompleteQueryRequest=} [properties] Properties to set + */ + function CompleteQueryRequest(properties) { + this.languageCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompleteQueryRequest tenant. + * @member {string} tenant + * @memberof google.cloud.talent.v4.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.tenant = ""; + + /** + * CompleteQueryRequest query. + * @member {string} query + * @memberof google.cloud.talent.v4.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.query = ""; + + /** + * CompleteQueryRequest languageCodes. + * @member {Array.} languageCodes + * @memberof google.cloud.talent.v4.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.languageCodes = $util.emptyArray; + + /** + * CompleteQueryRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.talent.v4.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.pageSize = 0; + + /** + * CompleteQueryRequest company. + * @member {string} company + * @memberof google.cloud.talent.v4.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.company = ""; + + /** + * CompleteQueryRequest scope. + * @member {google.cloud.talent.v4.CompleteQueryRequest.CompletionScope} scope + * @memberof google.cloud.talent.v4.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.scope = 0; + + /** + * CompleteQueryRequest type. + * @member {google.cloud.talent.v4.CompleteQueryRequest.CompletionType} type + * @memberof google.cloud.talent.v4.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.type = 0; + + /** + * Creates a new CompleteQueryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.CompleteQueryRequest + * @static + * @param {google.cloud.talent.v4.ICompleteQueryRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.CompleteQueryRequest} CompleteQueryRequest instance + */ + CompleteQueryRequest.create = function create(properties) { + return new CompleteQueryRequest(properties); + }; + + /** + * Encodes the specified CompleteQueryRequest message. Does not implicitly {@link google.cloud.talent.v4.CompleteQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.CompleteQueryRequest + * @static + * @param {google.cloud.talent.v4.ICompleteQueryRequest} message CompleteQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tenant != null && Object.hasOwnProperty.call(message, "tenant")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tenant); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.languageCodes != null && message.languageCodes.length) + for (var i = 0; i < message.languageCodes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCodes[i]); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.company != null && Object.hasOwnProperty.call(message, "company")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.company); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.scope); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.type); + return writer; + }; + + /** + * Encodes the specified CompleteQueryRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CompleteQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.CompleteQueryRequest + * @static + * @param {google.cloud.talent.v4.ICompleteQueryRequest} message CompleteQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompleteQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.CompleteQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.CompleteQueryRequest} CompleteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteQueryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.CompleteQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tenant = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 3: { + if (!(message.languageCodes && message.languageCodes.length)) + message.languageCodes = []; + message.languageCodes.push(reader.string()); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.company = reader.string(); + break; + } + case 6: { + message.scope = reader.int32(); + break; + } + case 7: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompleteQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.CompleteQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.CompleteQueryRequest} CompleteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompleteQueryRequest message. + * @function verify + * @memberof google.cloud.talent.v4.CompleteQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompleteQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tenant != null && message.hasOwnProperty("tenant")) + if (!$util.isString(message.tenant)) + return "tenant: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.languageCodes != null && message.hasOwnProperty("languageCodes")) { + if (!Array.isArray(message.languageCodes)) + return "languageCodes: array expected"; + for (var i = 0; i < message.languageCodes.length; ++i) + if (!$util.isString(message.languageCodes[i])) + return "languageCodes: string[] expected"; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.company != null && message.hasOwnProperty("company")) + if (!$util.isString(message.company)) + return "company: string expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + switch (message.scope) { + default: + return "scope: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a CompleteQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.CompleteQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.CompleteQueryRequest} CompleteQueryRequest + */ + CompleteQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.CompleteQueryRequest) + return object; + var message = new $root.google.cloud.talent.v4.CompleteQueryRequest(); + if (object.tenant != null) + message.tenant = String(object.tenant); + if (object.query != null) + message.query = String(object.query); + if (object.languageCodes) { + if (!Array.isArray(object.languageCodes)) + throw TypeError(".google.cloud.talent.v4.CompleteQueryRequest.languageCodes: array expected"); + message.languageCodes = []; + for (var i = 0; i < object.languageCodes.length; ++i) + message.languageCodes[i] = String(object.languageCodes[i]); + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.company != null) + message.company = String(object.company); + switch (object.scope) { + default: + if (typeof object.scope === "number") { + message.scope = object.scope; + break; + } + break; + case "COMPLETION_SCOPE_UNSPECIFIED": + case 0: + message.scope = 0; + break; + case "TENANT": + case 1: + message.scope = 1; + break; + case "PUBLIC": + case 2: + message.scope = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "COMPLETION_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "JOB_TITLE": + case 1: + message.type = 1; + break; + case "COMPANY_NAME": + case 2: + message.type = 2; + break; + case "COMBINED": + case 3: + message.type = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a CompleteQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.CompleteQueryRequest + * @static + * @param {google.cloud.talent.v4.CompleteQueryRequest} message CompleteQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompleteQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languageCodes = []; + if (options.defaults) { + object.tenant = ""; + object.query = ""; + object.pageSize = 0; + object.company = ""; + object.scope = options.enums === String ? "COMPLETION_SCOPE_UNSPECIFIED" : 0; + object.type = options.enums === String ? "COMPLETION_TYPE_UNSPECIFIED" : 0; + } + if (message.tenant != null && message.hasOwnProperty("tenant")) + object.tenant = message.tenant; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.languageCodes && message.languageCodes.length) { + object.languageCodes = []; + for (var j = 0; j < message.languageCodes.length; ++j) + object.languageCodes[j] = message.languageCodes[j]; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.company != null && message.hasOwnProperty("company")) + object.company = message.company; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = options.enums === String ? $root.google.cloud.talent.v4.CompleteQueryRequest.CompletionScope[message.scope] === undefined ? message.scope : $root.google.cloud.talent.v4.CompleteQueryRequest.CompletionScope[message.scope] : message.scope; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.talent.v4.CompleteQueryRequest.CompletionType[message.type] === undefined ? message.type : $root.google.cloud.talent.v4.CompleteQueryRequest.CompletionType[message.type] : message.type; + return object; + }; + + /** + * Converts this CompleteQueryRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.CompleteQueryRequest + * @instance + * @returns {Object.} JSON object + */ + CompleteQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompleteQueryRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.CompleteQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompleteQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.CompleteQueryRequest"; + }; + + /** + * CompletionScope enum. + * @name google.cloud.talent.v4.CompleteQueryRequest.CompletionScope + * @enum {number} + * @property {number} COMPLETION_SCOPE_UNSPECIFIED=0 COMPLETION_SCOPE_UNSPECIFIED value + * @property {number} TENANT=1 TENANT value + * @property {number} PUBLIC=2 PUBLIC value + */ + CompleteQueryRequest.CompletionScope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPLETION_SCOPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TENANT"] = 1; + values[valuesById[2] = "PUBLIC"] = 2; + return values; + })(); + + /** + * CompletionType enum. + * @name google.cloud.talent.v4.CompleteQueryRequest.CompletionType + * @enum {number} + * @property {number} COMPLETION_TYPE_UNSPECIFIED=0 COMPLETION_TYPE_UNSPECIFIED value + * @property {number} JOB_TITLE=1 JOB_TITLE value + * @property {number} COMPANY_NAME=2 COMPANY_NAME value + * @property {number} COMBINED=3 COMBINED value + */ + CompleteQueryRequest.CompletionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPLETION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "JOB_TITLE"] = 1; + values[valuesById[2] = "COMPANY_NAME"] = 2; + values[valuesById[3] = "COMBINED"] = 3; + return values; + })(); + + return CompleteQueryRequest; + })(); + + v4.CompleteQueryResponse = (function() { + + /** + * Properties of a CompleteQueryResponse. + * @memberof google.cloud.talent.v4 + * @interface ICompleteQueryResponse + * @property {Array.|null} [completionResults] CompleteQueryResponse completionResults + * @property {google.cloud.talent.v4.IResponseMetadata|null} [metadata] CompleteQueryResponse metadata + */ + + /** + * Constructs a new CompleteQueryResponse. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a CompleteQueryResponse. + * @implements ICompleteQueryResponse + * @constructor + * @param {google.cloud.talent.v4.ICompleteQueryResponse=} [properties] Properties to set + */ + function CompleteQueryResponse(properties) { + this.completionResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompleteQueryResponse completionResults. + * @member {Array.} completionResults + * @memberof google.cloud.talent.v4.CompleteQueryResponse + * @instance + */ + CompleteQueryResponse.prototype.completionResults = $util.emptyArray; + + /** + * CompleteQueryResponse metadata. + * @member {google.cloud.talent.v4.IResponseMetadata|null|undefined} metadata + * @memberof google.cloud.talent.v4.CompleteQueryResponse + * @instance + */ + CompleteQueryResponse.prototype.metadata = null; + + /** + * Creates a new CompleteQueryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.CompleteQueryResponse + * @static + * @param {google.cloud.talent.v4.ICompleteQueryResponse=} [properties] Properties to set + * @returns {google.cloud.talent.v4.CompleteQueryResponse} CompleteQueryResponse instance + */ + CompleteQueryResponse.create = function create(properties) { + return new CompleteQueryResponse(properties); + }; + + /** + * Encodes the specified CompleteQueryResponse message. Does not implicitly {@link google.cloud.talent.v4.CompleteQueryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.CompleteQueryResponse + * @static + * @param {google.cloud.talent.v4.ICompleteQueryResponse} message CompleteQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.completionResults != null && message.completionResults.length) + for (var i = 0; i < message.completionResults.length; ++i) + $root.google.cloud.talent.v4.CompleteQueryResponse.CompletionResult.encode(message.completionResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.talent.v4.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CompleteQueryResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CompleteQueryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.CompleteQueryResponse + * @static + * @param {google.cloud.talent.v4.ICompleteQueryResponse} message CompleteQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompleteQueryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.CompleteQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.CompleteQueryResponse} CompleteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteQueryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.CompleteQueryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.completionResults && message.completionResults.length)) + message.completionResults = []; + message.completionResults.push($root.google.cloud.talent.v4.CompleteQueryResponse.CompletionResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.metadata = $root.google.cloud.talent.v4.ResponseMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompleteQueryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.CompleteQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.CompleteQueryResponse} CompleteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteQueryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompleteQueryResponse message. + * @function verify + * @memberof google.cloud.talent.v4.CompleteQueryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompleteQueryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.completionResults != null && message.hasOwnProperty("completionResults")) { + if (!Array.isArray(message.completionResults)) + return "completionResults: array expected"; + for (var i = 0; i < message.completionResults.length; ++i) { + var error = $root.google.cloud.talent.v4.CompleteQueryResponse.CompletionResult.verify(message.completionResults[i]); + if (error) + return "completionResults." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.talent.v4.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a CompleteQueryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.CompleteQueryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.CompleteQueryResponse} CompleteQueryResponse + */ + CompleteQueryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.CompleteQueryResponse) + return object; + var message = new $root.google.cloud.talent.v4.CompleteQueryResponse(); + if (object.completionResults) { + if (!Array.isArray(object.completionResults)) + throw TypeError(".google.cloud.talent.v4.CompleteQueryResponse.completionResults: array expected"); + message.completionResults = []; + for (var i = 0; i < object.completionResults.length; ++i) { + if (typeof object.completionResults[i] !== "object") + throw TypeError(".google.cloud.talent.v4.CompleteQueryResponse.completionResults: object expected"); + message.completionResults[i] = $root.google.cloud.talent.v4.CompleteQueryResponse.CompletionResult.fromObject(object.completionResults[i]); + } + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.talent.v4.CompleteQueryResponse.metadata: object expected"); + message.metadata = $root.google.cloud.talent.v4.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a CompleteQueryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.CompleteQueryResponse + * @static + * @param {google.cloud.talent.v4.CompleteQueryResponse} message CompleteQueryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompleteQueryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.completionResults = []; + if (options.defaults) + object.metadata = null; + if (message.completionResults && message.completionResults.length) { + object.completionResults = []; + for (var j = 0; j < message.completionResults.length; ++j) + object.completionResults[j] = $root.google.cloud.talent.v4.CompleteQueryResponse.CompletionResult.toObject(message.completionResults[j], options); + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.talent.v4.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this CompleteQueryResponse to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.CompleteQueryResponse + * @instance + * @returns {Object.} JSON object + */ + CompleteQueryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompleteQueryResponse + * @function getTypeUrl + * @memberof google.cloud.talent.v4.CompleteQueryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompleteQueryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.CompleteQueryResponse"; + }; + + CompleteQueryResponse.CompletionResult = (function() { + + /** + * Properties of a CompletionResult. + * @memberof google.cloud.talent.v4.CompleteQueryResponse + * @interface ICompletionResult + * @property {string|null} [suggestion] CompletionResult suggestion + * @property {google.cloud.talent.v4.CompleteQueryRequest.CompletionType|null} [type] CompletionResult type + * @property {string|null} [imageUri] CompletionResult imageUri + */ + + /** + * Constructs a new CompletionResult. + * @memberof google.cloud.talent.v4.CompleteQueryResponse + * @classdesc Represents a CompletionResult. + * @implements ICompletionResult + * @constructor + * @param {google.cloud.talent.v4.CompleteQueryResponse.ICompletionResult=} [properties] Properties to set + */ + function CompletionResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompletionResult suggestion. + * @member {string} suggestion + * @memberof google.cloud.talent.v4.CompleteQueryResponse.CompletionResult + * @instance + */ + CompletionResult.prototype.suggestion = ""; + + /** + * CompletionResult type. + * @member {google.cloud.talent.v4.CompleteQueryRequest.CompletionType} type + * @memberof google.cloud.talent.v4.CompleteQueryResponse.CompletionResult + * @instance + */ + CompletionResult.prototype.type = 0; + + /** + * CompletionResult imageUri. + * @member {string} imageUri + * @memberof google.cloud.talent.v4.CompleteQueryResponse.CompletionResult + * @instance + */ + CompletionResult.prototype.imageUri = ""; + + /** + * Creates a new CompletionResult instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.CompleteQueryResponse.CompletionResult + * @static + * @param {google.cloud.talent.v4.CompleteQueryResponse.ICompletionResult=} [properties] Properties to set + * @returns {google.cloud.talent.v4.CompleteQueryResponse.CompletionResult} CompletionResult instance + */ + CompletionResult.create = function create(properties) { + return new CompletionResult(properties); + }; + + /** + * Encodes the specified CompletionResult message. Does not implicitly {@link google.cloud.talent.v4.CompleteQueryResponse.CompletionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.CompleteQueryResponse.CompletionResult + * @static + * @param {google.cloud.talent.v4.CompleteQueryResponse.ICompletionResult} message CompletionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompletionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.suggestion != null && Object.hasOwnProperty.call(message, "suggestion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.suggestion); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.imageUri); + return writer; + }; + + /** + * Encodes the specified CompletionResult message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CompleteQueryResponse.CompletionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.CompleteQueryResponse.CompletionResult + * @static + * @param {google.cloud.talent.v4.CompleteQueryResponse.ICompletionResult} message CompletionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompletionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompletionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.CompleteQueryResponse.CompletionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.CompleteQueryResponse.CompletionResult} CompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompletionResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.CompleteQueryResponse.CompletionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.suggestion = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + message.imageUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompletionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.CompleteQueryResponse.CompletionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.CompleteQueryResponse.CompletionResult} CompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompletionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompletionResult message. + * @function verify + * @memberof google.cloud.talent.v4.CompleteQueryResponse.CompletionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompletionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.suggestion != null && message.hasOwnProperty("suggestion")) + if (!$util.isString(message.suggestion)) + return "suggestion: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + return null; + }; + + /** + * Creates a CompletionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.CompleteQueryResponse.CompletionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.CompleteQueryResponse.CompletionResult} CompletionResult + */ + CompletionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.CompleteQueryResponse.CompletionResult) + return object; + var message = new $root.google.cloud.talent.v4.CompleteQueryResponse.CompletionResult(); + if (object.suggestion != null) + message.suggestion = String(object.suggestion); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "COMPLETION_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "JOB_TITLE": + case 1: + message.type = 1; + break; + case "COMPANY_NAME": + case 2: + message.type = 2; + break; + case "COMBINED": + case 3: + message.type = 3; + break; + } + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + return message; + }; + + /** + * Creates a plain object from a CompletionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.CompleteQueryResponse.CompletionResult + * @static + * @param {google.cloud.talent.v4.CompleteQueryResponse.CompletionResult} message CompletionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompletionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.suggestion = ""; + object.type = options.enums === String ? "COMPLETION_TYPE_UNSPECIFIED" : 0; + object.imageUri = ""; + } + if (message.suggestion != null && message.hasOwnProperty("suggestion")) + object.suggestion = message.suggestion; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.talent.v4.CompleteQueryRequest.CompletionType[message.type] === undefined ? message.type : $root.google.cloud.talent.v4.CompleteQueryRequest.CompletionType[message.type] : message.type; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + return object; + }; + + /** + * Converts this CompletionResult to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.CompleteQueryResponse.CompletionResult + * @instance + * @returns {Object.} JSON object + */ + CompletionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompletionResult + * @function getTypeUrl + * @memberof google.cloud.talent.v4.CompleteQueryResponse.CompletionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompletionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.CompleteQueryResponse.CompletionResult"; + }; + + return CompletionResult; + })(); + + return CompleteQueryResponse; + })(); + + v4.ClientEvent = (function() { + + /** + * Properties of a ClientEvent. + * @memberof google.cloud.talent.v4 + * @interface IClientEvent + * @property {string|null} [requestId] ClientEvent requestId + * @property {string|null} [eventId] ClientEvent eventId + * @property {google.protobuf.ITimestamp|null} [createTime] ClientEvent createTime + * @property {google.cloud.talent.v4.IJobEvent|null} [jobEvent] ClientEvent jobEvent + * @property {string|null} [eventNotes] ClientEvent eventNotes + */ + + /** + * Constructs a new ClientEvent. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a ClientEvent. + * @implements IClientEvent + * @constructor + * @param {google.cloud.talent.v4.IClientEvent=} [properties] Properties to set + */ + function ClientEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientEvent requestId. + * @member {string} requestId + * @memberof google.cloud.talent.v4.ClientEvent + * @instance + */ + ClientEvent.prototype.requestId = ""; + + /** + * ClientEvent eventId. + * @member {string} eventId + * @memberof google.cloud.talent.v4.ClientEvent + * @instance + */ + ClientEvent.prototype.eventId = ""; + + /** + * ClientEvent createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.talent.v4.ClientEvent + * @instance + */ + ClientEvent.prototype.createTime = null; + + /** + * ClientEvent jobEvent. + * @member {google.cloud.talent.v4.IJobEvent|null|undefined} jobEvent + * @memberof google.cloud.talent.v4.ClientEvent + * @instance + */ + ClientEvent.prototype.jobEvent = null; + + /** + * ClientEvent eventNotes. + * @member {string} eventNotes + * @memberof google.cloud.talent.v4.ClientEvent + * @instance + */ + ClientEvent.prototype.eventNotes = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ClientEvent event. + * @member {"jobEvent"|undefined} event + * @memberof google.cloud.talent.v4.ClientEvent + * @instance + */ + Object.defineProperty(ClientEvent.prototype, "event", { + get: $util.oneOfGetter($oneOfFields = ["jobEvent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ClientEvent instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.ClientEvent + * @static + * @param {google.cloud.talent.v4.IClientEvent=} [properties] Properties to set + * @returns {google.cloud.talent.v4.ClientEvent} ClientEvent instance + */ + ClientEvent.create = function create(properties) { + return new ClientEvent(properties); + }; + + /** + * Encodes the specified ClientEvent message. Does not implicitly {@link google.cloud.talent.v4.ClientEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.ClientEvent + * @static + * @param {google.cloud.talent.v4.IClientEvent} message ClientEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.requestId); + if (message.eventId != null && Object.hasOwnProperty.call(message, "eventId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.eventId); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.jobEvent != null && Object.hasOwnProperty.call(message, "jobEvent")) + $root.google.cloud.talent.v4.JobEvent.encode(message.jobEvent, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.eventNotes != null && Object.hasOwnProperty.call(message, "eventNotes")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.eventNotes); + return writer; + }; + + /** + * Encodes the specified ClientEvent message, length delimited. Does not implicitly {@link google.cloud.talent.v4.ClientEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.ClientEvent + * @static + * @param {google.cloud.talent.v4.IClientEvent} message ClientEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.ClientEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.ClientEvent} ClientEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.ClientEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.requestId = reader.string(); + break; + } + case 2: { + message.eventId = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.jobEvent = $root.google.cloud.talent.v4.JobEvent.decode(reader, reader.uint32()); + break; + } + case 9: { + message.eventNotes = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.ClientEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.ClientEvent} ClientEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientEvent message. + * @function verify + * @memberof google.cloud.talent.v4.ClientEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.eventId != null && message.hasOwnProperty("eventId")) + if (!$util.isString(message.eventId)) + return "eventId: 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.jobEvent != null && message.hasOwnProperty("jobEvent")) { + properties.event = 1; + { + var error = $root.google.cloud.talent.v4.JobEvent.verify(message.jobEvent); + if (error) + return "jobEvent." + error; + } + } + if (message.eventNotes != null && message.hasOwnProperty("eventNotes")) + if (!$util.isString(message.eventNotes)) + return "eventNotes: string expected"; + return null; + }; + + /** + * Creates a ClientEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.ClientEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.ClientEvent} ClientEvent + */ + ClientEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.ClientEvent) + return object; + var message = new $root.google.cloud.talent.v4.ClientEvent(); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.eventId != null) + message.eventId = String(object.eventId); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.talent.v4.ClientEvent.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.jobEvent != null) { + if (typeof object.jobEvent !== "object") + throw TypeError(".google.cloud.talent.v4.ClientEvent.jobEvent: object expected"); + message.jobEvent = $root.google.cloud.talent.v4.JobEvent.fromObject(object.jobEvent); + } + if (object.eventNotes != null) + message.eventNotes = String(object.eventNotes); + return message; + }; + + /** + * Creates a plain object from a ClientEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.ClientEvent + * @static + * @param {google.cloud.talent.v4.ClientEvent} message ClientEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.requestId = ""; + object.eventId = ""; + object.createTime = null; + object.eventNotes = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.eventId != null && message.hasOwnProperty("eventId")) + object.eventId = message.eventId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.jobEvent != null && message.hasOwnProperty("jobEvent")) { + object.jobEvent = $root.google.cloud.talent.v4.JobEvent.toObject(message.jobEvent, options); + if (options.oneofs) + object.event = "jobEvent"; + } + if (message.eventNotes != null && message.hasOwnProperty("eventNotes")) + object.eventNotes = message.eventNotes; + return object; + }; + + /** + * Converts this ClientEvent to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.ClientEvent + * @instance + * @returns {Object.} JSON object + */ + ClientEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientEvent + * @function getTypeUrl + * @memberof google.cloud.talent.v4.ClientEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.ClientEvent"; + }; + + return ClientEvent; + })(); + + v4.JobEvent = (function() { + + /** + * Properties of a JobEvent. + * @memberof google.cloud.talent.v4 + * @interface IJobEvent + * @property {google.cloud.talent.v4.JobEvent.JobEventType|null} [type] JobEvent type + * @property {Array.|null} [jobs] JobEvent jobs + */ + + /** + * Constructs a new JobEvent. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a JobEvent. + * @implements IJobEvent + * @constructor + * @param {google.cloud.talent.v4.IJobEvent=} [properties] Properties to set + */ + function JobEvent(properties) { + this.jobs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobEvent type. + * @member {google.cloud.talent.v4.JobEvent.JobEventType} type + * @memberof google.cloud.talent.v4.JobEvent + * @instance + */ + JobEvent.prototype.type = 0; + + /** + * JobEvent jobs. + * @member {Array.} jobs + * @memberof google.cloud.talent.v4.JobEvent + * @instance + */ + JobEvent.prototype.jobs = $util.emptyArray; + + /** + * Creates a new JobEvent instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.JobEvent + * @static + * @param {google.cloud.talent.v4.IJobEvent=} [properties] Properties to set + * @returns {google.cloud.talent.v4.JobEvent} JobEvent instance + */ + JobEvent.create = function create(properties) { + return new JobEvent(properties); + }; + + /** + * Encodes the specified JobEvent message. Does not implicitly {@link google.cloud.talent.v4.JobEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.JobEvent + * @static + * @param {google.cloud.talent.v4.IJobEvent} message JobEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobs[i]); + return writer; + }; + + /** + * Encodes the specified JobEvent message, length delimited. Does not implicitly {@link google.cloud.talent.v4.JobEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.JobEvent + * @static + * @param {google.cloud.talent.v4.IJobEvent} message JobEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.JobEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.JobEvent} JobEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.JobEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.JobEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.JobEvent} JobEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobEvent message. + * @function verify + * @memberof google.cloud.talent.v4.JobEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + 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: + break; + } + if (message.jobs != null && message.hasOwnProperty("jobs")) { + if (!Array.isArray(message.jobs)) + return "jobs: array expected"; + for (var i = 0; i < message.jobs.length; ++i) + if (!$util.isString(message.jobs[i])) + return "jobs: string[] expected"; + } + return null; + }; + + /** + * Creates a JobEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.JobEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.JobEvent} JobEvent + */ + JobEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.JobEvent) + return object; + var message = new $root.google.cloud.talent.v4.JobEvent(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "JOB_EVENT_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "IMPRESSION": + case 1: + message.type = 1; + break; + case "VIEW": + case 2: + message.type = 2; + break; + case "VIEW_REDIRECT": + case 3: + message.type = 3; + break; + case "APPLICATION_START": + case 4: + message.type = 4; + break; + case "APPLICATION_FINISH": + case 5: + message.type = 5; + break; + case "APPLICATION_QUICK_SUBMISSION": + case 6: + message.type = 6; + break; + case "APPLICATION_REDIRECT": + case 7: + message.type = 7; + break; + case "APPLICATION_START_FROM_SEARCH": + case 8: + message.type = 8; + break; + case "APPLICATION_REDIRECT_FROM_SEARCH": + case 9: + message.type = 9; + break; + case "APPLICATION_COMPANY_SUBMIT": + case 10: + message.type = 10; + break; + case "BOOKMARK": + case 11: + message.type = 11; + break; + case "NOTIFICATION": + case 12: + message.type = 12; + break; + case "HIRED": + case 13: + message.type = 13; + break; + case "SENT_CV": + case 14: + message.type = 14; + break; + case "INTERVIEW_GRANTED": + case 15: + message.type = 15; + break; + } + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.talent.v4.JobEvent.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) + message.jobs[i] = String(object.jobs[i]); + } + return message; + }; + + /** + * Creates a plain object from a JobEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.JobEvent + * @static + * @param {google.cloud.talent.v4.JobEvent} message JobEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jobs = []; + if (options.defaults) + object.type = options.enums === String ? "JOB_EVENT_TYPE_UNSPECIFIED" : 0; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.talent.v4.JobEvent.JobEventType[message.type] === undefined ? message.type : $root.google.cloud.talent.v4.JobEvent.JobEventType[message.type] : message.type; + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = message.jobs[j]; + } + return object; + }; + + /** + * Converts this JobEvent to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.JobEvent + * @instance + * @returns {Object.} JSON object + */ + JobEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobEvent + * @function getTypeUrl + * @memberof google.cloud.talent.v4.JobEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.JobEvent"; + }; + + /** + * JobEventType enum. + * @name google.cloud.talent.v4.JobEvent.JobEventType + * @enum {number} + * @property {number} JOB_EVENT_TYPE_UNSPECIFIED=0 JOB_EVENT_TYPE_UNSPECIFIED value + * @property {number} IMPRESSION=1 IMPRESSION value + * @property {number} VIEW=2 VIEW value + * @property {number} VIEW_REDIRECT=3 VIEW_REDIRECT value + * @property {number} APPLICATION_START=4 APPLICATION_START value + * @property {number} APPLICATION_FINISH=5 APPLICATION_FINISH value + * @property {number} APPLICATION_QUICK_SUBMISSION=6 APPLICATION_QUICK_SUBMISSION value + * @property {number} APPLICATION_REDIRECT=7 APPLICATION_REDIRECT value + * @property {number} APPLICATION_START_FROM_SEARCH=8 APPLICATION_START_FROM_SEARCH value + * @property {number} APPLICATION_REDIRECT_FROM_SEARCH=9 APPLICATION_REDIRECT_FROM_SEARCH value + * @property {number} APPLICATION_COMPANY_SUBMIT=10 APPLICATION_COMPANY_SUBMIT value + * @property {number} BOOKMARK=11 BOOKMARK value + * @property {number} NOTIFICATION=12 NOTIFICATION value + * @property {number} HIRED=13 HIRED value + * @property {number} SENT_CV=14 SENT_CV value + * @property {number} INTERVIEW_GRANTED=15 INTERVIEW_GRANTED value + */ + JobEvent.JobEventType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_EVENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IMPRESSION"] = 1; + values[valuesById[2] = "VIEW"] = 2; + values[valuesById[3] = "VIEW_REDIRECT"] = 3; + values[valuesById[4] = "APPLICATION_START"] = 4; + values[valuesById[5] = "APPLICATION_FINISH"] = 5; + values[valuesById[6] = "APPLICATION_QUICK_SUBMISSION"] = 6; + values[valuesById[7] = "APPLICATION_REDIRECT"] = 7; + values[valuesById[8] = "APPLICATION_START_FROM_SEARCH"] = 8; + values[valuesById[9] = "APPLICATION_REDIRECT_FROM_SEARCH"] = 9; + values[valuesById[10] = "APPLICATION_COMPANY_SUBMIT"] = 10; + values[valuesById[11] = "BOOKMARK"] = 11; + values[valuesById[12] = "NOTIFICATION"] = 12; + values[valuesById[13] = "HIRED"] = 13; + values[valuesById[14] = "SENT_CV"] = 14; + values[valuesById[15] = "INTERVIEW_GRANTED"] = 15; + return values; + })(); + + return JobEvent; + })(); + + v4.EventService = (function() { + + /** + * Constructs a new EventService service. + * @memberof google.cloud.talent.v4 + * @classdesc Represents an EventService + * @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 EventService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (EventService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = EventService; + + /** + * Creates new EventService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.talent.v4.EventService + * @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 {EventService} RPC service. Useful where requests and/or responses are streamed. + */ + EventService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.talent.v4.EventService|createClientEvent}. + * @memberof google.cloud.talent.v4.EventService + * @typedef CreateClientEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4.ClientEvent} [response] ClientEvent + */ + + /** + * Calls CreateClientEvent. + * @function createClientEvent + * @memberof google.cloud.talent.v4.EventService + * @instance + * @param {google.cloud.talent.v4.ICreateClientEventRequest} request CreateClientEventRequest message or plain object + * @param {google.cloud.talent.v4.EventService.CreateClientEventCallback} callback Node-style callback called with the error, if any, and ClientEvent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EventService.prototype.createClientEvent = function createClientEvent(request, callback) { + return this.rpcCall(createClientEvent, $root.google.cloud.talent.v4.CreateClientEventRequest, $root.google.cloud.talent.v4.ClientEvent, request, callback); + }, "name", { value: "CreateClientEvent" }); + + /** + * Calls CreateClientEvent. + * @function createClientEvent + * @memberof google.cloud.talent.v4.EventService + * @instance + * @param {google.cloud.talent.v4.ICreateClientEventRequest} request CreateClientEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return EventService; + })(); + + v4.CreateClientEventRequest = (function() { + + /** + * Properties of a CreateClientEventRequest. + * @memberof google.cloud.talent.v4 + * @interface ICreateClientEventRequest + * @property {string|null} [parent] CreateClientEventRequest parent + * @property {google.cloud.talent.v4.IClientEvent|null} [clientEvent] CreateClientEventRequest clientEvent + */ + + /** + * Constructs a new CreateClientEventRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a CreateClientEventRequest. + * @implements ICreateClientEventRequest + * @constructor + * @param {google.cloud.talent.v4.ICreateClientEventRequest=} [properties] Properties to set + */ + function CreateClientEventRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateClientEventRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4.CreateClientEventRequest + * @instance + */ + CreateClientEventRequest.prototype.parent = ""; + + /** + * CreateClientEventRequest clientEvent. + * @member {google.cloud.talent.v4.IClientEvent|null|undefined} clientEvent + * @memberof google.cloud.talent.v4.CreateClientEventRequest + * @instance + */ + CreateClientEventRequest.prototype.clientEvent = null; + + /** + * Creates a new CreateClientEventRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.CreateClientEventRequest + * @static + * @param {google.cloud.talent.v4.ICreateClientEventRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.CreateClientEventRequest} CreateClientEventRequest instance + */ + CreateClientEventRequest.create = function create(properties) { + return new CreateClientEventRequest(properties); + }; + + /** + * Encodes the specified CreateClientEventRequest message. Does not implicitly {@link google.cloud.talent.v4.CreateClientEventRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.CreateClientEventRequest + * @static + * @param {google.cloud.talent.v4.ICreateClientEventRequest} message CreateClientEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClientEventRequest.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.clientEvent != null && Object.hasOwnProperty.call(message, "clientEvent")) + $root.google.cloud.talent.v4.ClientEvent.encode(message.clientEvent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateClientEventRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CreateClientEventRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.CreateClientEventRequest + * @static + * @param {google.cloud.talent.v4.ICreateClientEventRequest} message CreateClientEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClientEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateClientEventRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.CreateClientEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.CreateClientEventRequest} CreateClientEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClientEventRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.CreateClientEventRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clientEvent = $root.google.cloud.talent.v4.ClientEvent.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateClientEventRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.CreateClientEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.CreateClientEventRequest} CreateClientEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClientEventRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateClientEventRequest message. + * @function verify + * @memberof google.cloud.talent.v4.CreateClientEventRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateClientEventRequest.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.clientEvent != null && message.hasOwnProperty("clientEvent")) { + var error = $root.google.cloud.talent.v4.ClientEvent.verify(message.clientEvent); + if (error) + return "clientEvent." + error; + } + return null; + }; + + /** + * Creates a CreateClientEventRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.CreateClientEventRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.CreateClientEventRequest} CreateClientEventRequest + */ + CreateClientEventRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.CreateClientEventRequest) + return object; + var message = new $root.google.cloud.talent.v4.CreateClientEventRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.clientEvent != null) { + if (typeof object.clientEvent !== "object") + throw TypeError(".google.cloud.talent.v4.CreateClientEventRequest.clientEvent: object expected"); + message.clientEvent = $root.google.cloud.talent.v4.ClientEvent.fromObject(object.clientEvent); + } + return message; + }; + + /** + * Creates a plain object from a CreateClientEventRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.CreateClientEventRequest + * @static + * @param {google.cloud.talent.v4.CreateClientEventRequest} message CreateClientEventRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateClientEventRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clientEvent = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clientEvent != null && message.hasOwnProperty("clientEvent")) + object.clientEvent = $root.google.cloud.talent.v4.ClientEvent.toObject(message.clientEvent, options); + return object; + }; + + /** + * Converts this CreateClientEventRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.CreateClientEventRequest + * @instance + * @returns {Object.} JSON object + */ + CreateClientEventRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateClientEventRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.CreateClientEventRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateClientEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.CreateClientEventRequest"; + }; + + return CreateClientEventRequest; + })(); + + v4.JobQuery = (function() { + + /** + * Properties of a JobQuery. + * @memberof google.cloud.talent.v4 + * @interface IJobQuery + * @property {string|null} [query] JobQuery query + * @property {string|null} [queryLanguageCode] JobQuery queryLanguageCode + * @property {Array.|null} [companies] JobQuery companies + * @property {Array.|null} [locationFilters] JobQuery locationFilters + * @property {Array.|null} [jobCategories] JobQuery jobCategories + * @property {google.cloud.talent.v4.ICommuteFilter|null} [commuteFilter] JobQuery commuteFilter + * @property {Array.|null} [companyDisplayNames] JobQuery companyDisplayNames + * @property {google.cloud.talent.v4.ICompensationFilter|null} [compensationFilter] JobQuery compensationFilter + * @property {string|null} [customAttributeFilter] JobQuery customAttributeFilter + * @property {boolean|null} [disableSpellCheck] JobQuery disableSpellCheck + * @property {Array.|null} [employmentTypes] JobQuery employmentTypes + * @property {Array.|null} [languageCodes] JobQuery languageCodes + * @property {google.cloud.talent.v4.ITimestampRange|null} [publishTimeRange] JobQuery publishTimeRange + * @property {Array.|null} [excludedJobs] JobQuery excludedJobs + */ + + /** + * Constructs a new JobQuery. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a JobQuery. + * @implements IJobQuery + * @constructor + * @param {google.cloud.talent.v4.IJobQuery=} [properties] Properties to set + */ + function JobQuery(properties) { + this.companies = []; + this.locationFilters = []; + this.jobCategories = []; + this.companyDisplayNames = []; + this.employmentTypes = []; + this.languageCodes = []; + this.excludedJobs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobQuery query. + * @member {string} query + * @memberof google.cloud.talent.v4.JobQuery + * @instance + */ + JobQuery.prototype.query = ""; + + /** + * JobQuery queryLanguageCode. + * @member {string} queryLanguageCode + * @memberof google.cloud.talent.v4.JobQuery + * @instance + */ + JobQuery.prototype.queryLanguageCode = ""; + + /** + * JobQuery companies. + * @member {Array.} companies + * @memberof google.cloud.talent.v4.JobQuery + * @instance + */ + JobQuery.prototype.companies = $util.emptyArray; + + /** + * JobQuery locationFilters. + * @member {Array.} locationFilters + * @memberof google.cloud.talent.v4.JobQuery + * @instance + */ + JobQuery.prototype.locationFilters = $util.emptyArray; + + /** + * JobQuery jobCategories. + * @member {Array.} jobCategories + * @memberof google.cloud.talent.v4.JobQuery + * @instance + */ + JobQuery.prototype.jobCategories = $util.emptyArray; + + /** + * JobQuery commuteFilter. + * @member {google.cloud.talent.v4.ICommuteFilter|null|undefined} commuteFilter + * @memberof google.cloud.talent.v4.JobQuery + * @instance + */ + JobQuery.prototype.commuteFilter = null; + + /** + * JobQuery companyDisplayNames. + * @member {Array.} companyDisplayNames + * @memberof google.cloud.talent.v4.JobQuery + * @instance + */ + JobQuery.prototype.companyDisplayNames = $util.emptyArray; + + /** + * JobQuery compensationFilter. + * @member {google.cloud.talent.v4.ICompensationFilter|null|undefined} compensationFilter + * @memberof google.cloud.talent.v4.JobQuery + * @instance + */ + JobQuery.prototype.compensationFilter = null; + + /** + * JobQuery customAttributeFilter. + * @member {string} customAttributeFilter + * @memberof google.cloud.talent.v4.JobQuery + * @instance + */ + JobQuery.prototype.customAttributeFilter = ""; + + /** + * JobQuery disableSpellCheck. + * @member {boolean} disableSpellCheck + * @memberof google.cloud.talent.v4.JobQuery + * @instance + */ + JobQuery.prototype.disableSpellCheck = false; + + /** + * JobQuery employmentTypes. + * @member {Array.} employmentTypes + * @memberof google.cloud.talent.v4.JobQuery + * @instance + */ + JobQuery.prototype.employmentTypes = $util.emptyArray; + + /** + * JobQuery languageCodes. + * @member {Array.} languageCodes + * @memberof google.cloud.talent.v4.JobQuery + * @instance + */ + JobQuery.prototype.languageCodes = $util.emptyArray; + + /** + * JobQuery publishTimeRange. + * @member {google.cloud.talent.v4.ITimestampRange|null|undefined} publishTimeRange + * @memberof google.cloud.talent.v4.JobQuery + * @instance + */ + JobQuery.prototype.publishTimeRange = null; + + /** + * JobQuery excludedJobs. + * @member {Array.} excludedJobs + * @memberof google.cloud.talent.v4.JobQuery + * @instance + */ + JobQuery.prototype.excludedJobs = $util.emptyArray; + + /** + * Creates a new JobQuery instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.JobQuery + * @static + * @param {google.cloud.talent.v4.IJobQuery=} [properties] Properties to set + * @returns {google.cloud.talent.v4.JobQuery} JobQuery instance + */ + JobQuery.create = function create(properties) { + return new JobQuery(properties); + }; + + /** + * Encodes the specified JobQuery message. Does not implicitly {@link google.cloud.talent.v4.JobQuery.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.JobQuery + * @static + * @param {google.cloud.talent.v4.IJobQuery} message JobQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); + if (message.companies != null && message.companies.length) + for (var i = 0; i < message.companies.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.companies[i]); + if (message.locationFilters != null && message.locationFilters.length) + for (var i = 0; i < message.locationFilters.length; ++i) + $root.google.cloud.talent.v4.LocationFilter.encode(message.locationFilters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.jobCategories != null && message.jobCategories.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.jobCategories.length; ++i) + writer.int32(message.jobCategories[i]); + writer.ldelim(); + } + if (message.commuteFilter != null && Object.hasOwnProperty.call(message, "commuteFilter")) + $root.google.cloud.talent.v4.CommuteFilter.encode(message.commuteFilter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.companyDisplayNames != null && message.companyDisplayNames.length) + for (var i = 0; i < message.companyDisplayNames.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.companyDisplayNames[i]); + if (message.compensationFilter != null && Object.hasOwnProperty.call(message, "compensationFilter")) + $root.google.cloud.talent.v4.CompensationFilter.encode(message.compensationFilter, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.customAttributeFilter != null && Object.hasOwnProperty.call(message, "customAttributeFilter")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.customAttributeFilter); + if (message.disableSpellCheck != null && Object.hasOwnProperty.call(message, "disableSpellCheck")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.disableSpellCheck); + if (message.employmentTypes != null && message.employmentTypes.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.employmentTypes.length; ++i) + writer.int32(message.employmentTypes[i]); + writer.ldelim(); + } + if (message.languageCodes != null && message.languageCodes.length) + for (var i = 0; i < message.languageCodes.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.languageCodes[i]); + if (message.publishTimeRange != null && Object.hasOwnProperty.call(message, "publishTimeRange")) + $root.google.cloud.talent.v4.TimestampRange.encode(message.publishTimeRange, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.excludedJobs != null && message.excludedJobs.length) + for (var i = 0; i < message.excludedJobs.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.excludedJobs[i]); + if (message.queryLanguageCode != null && Object.hasOwnProperty.call(message, "queryLanguageCode")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.queryLanguageCode); + return writer; + }; + + /** + * Encodes the specified JobQuery message, length delimited. Does not implicitly {@link google.cloud.talent.v4.JobQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.JobQuery + * @static + * @param {google.cloud.talent.v4.IJobQuery} message JobQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobQuery message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.JobQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.JobQuery} JobQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobQuery.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.JobQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.query = reader.string(); + break; + } + case 14: { + message.queryLanguageCode = reader.string(); + break; + } + case 2: { + if (!(message.companies && message.companies.length)) + message.companies = []; + message.companies.push(reader.string()); + break; + } + case 3: { + if (!(message.locationFilters && message.locationFilters.length)) + message.locationFilters = []; + message.locationFilters.push($root.google.cloud.talent.v4.LocationFilter.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.jobCategories && message.jobCategories.length)) + message.jobCategories = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.jobCategories.push(reader.int32()); + } else + message.jobCategories.push(reader.int32()); + break; + } + case 5: { + message.commuteFilter = $root.google.cloud.talent.v4.CommuteFilter.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.companyDisplayNames && message.companyDisplayNames.length)) + message.companyDisplayNames = []; + message.companyDisplayNames.push(reader.string()); + break; + } + case 7: { + message.compensationFilter = $root.google.cloud.talent.v4.CompensationFilter.decode(reader, reader.uint32()); + break; + } + case 8: { + message.customAttributeFilter = reader.string(); + break; + } + case 9: { + message.disableSpellCheck = reader.bool(); + break; + } + case 10: { + if (!(message.employmentTypes && message.employmentTypes.length)) + message.employmentTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.employmentTypes.push(reader.int32()); + } else + message.employmentTypes.push(reader.int32()); + break; + } + case 11: { + if (!(message.languageCodes && message.languageCodes.length)) + message.languageCodes = []; + message.languageCodes.push(reader.string()); + break; + } + case 12: { + message.publishTimeRange = $root.google.cloud.talent.v4.TimestampRange.decode(reader, reader.uint32()); + break; + } + case 13: { + if (!(message.excludedJobs && message.excludedJobs.length)) + message.excludedJobs = []; + message.excludedJobs.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.JobQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.JobQuery} JobQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobQuery message. + * @function verify + * @memberof google.cloud.talent.v4.JobQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobQuery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.queryLanguageCode != null && message.hasOwnProperty("queryLanguageCode")) + if (!$util.isString(message.queryLanguageCode)) + return "queryLanguageCode: string expected"; + if (message.companies != null && message.hasOwnProperty("companies")) { + if (!Array.isArray(message.companies)) + return "companies: array expected"; + for (var i = 0; i < message.companies.length; ++i) + if (!$util.isString(message.companies[i])) + return "companies: string[] expected"; + } + if (message.locationFilters != null && message.hasOwnProperty("locationFilters")) { + if (!Array.isArray(message.locationFilters)) + return "locationFilters: array expected"; + for (var i = 0; i < message.locationFilters.length; ++i) { + var error = $root.google.cloud.talent.v4.LocationFilter.verify(message.locationFilters[i]); + if (error) + return "locationFilters." + error; + } + } + if (message.jobCategories != null && message.hasOwnProperty("jobCategories")) { + if (!Array.isArray(message.jobCategories)) + return "jobCategories: array expected"; + for (var i = 0; i < message.jobCategories.length; ++i) + switch (message.jobCategories[i]) { + default: + return "jobCategories: enum value[] expected"; + case 0: + 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: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + break; + } + } + if (message.commuteFilter != null && message.hasOwnProperty("commuteFilter")) { + var error = $root.google.cloud.talent.v4.CommuteFilter.verify(message.commuteFilter); + if (error) + return "commuteFilter." + error; + } + if (message.companyDisplayNames != null && message.hasOwnProperty("companyDisplayNames")) { + if (!Array.isArray(message.companyDisplayNames)) + return "companyDisplayNames: array expected"; + for (var i = 0; i < message.companyDisplayNames.length; ++i) + if (!$util.isString(message.companyDisplayNames[i])) + return "companyDisplayNames: string[] expected"; + } + if (message.compensationFilter != null && message.hasOwnProperty("compensationFilter")) { + var error = $root.google.cloud.talent.v4.CompensationFilter.verify(message.compensationFilter); + if (error) + return "compensationFilter." + error; + } + if (message.customAttributeFilter != null && message.hasOwnProperty("customAttributeFilter")) + if (!$util.isString(message.customAttributeFilter)) + return "customAttributeFilter: string expected"; + if (message.disableSpellCheck != null && message.hasOwnProperty("disableSpellCheck")) + if (typeof message.disableSpellCheck !== "boolean") + return "disableSpellCheck: boolean expected"; + if (message.employmentTypes != null && message.hasOwnProperty("employmentTypes")) { + if (!Array.isArray(message.employmentTypes)) + return "employmentTypes: array expected"; + for (var i = 0; i < message.employmentTypes.length; ++i) + switch (message.employmentTypes[i]) { + default: + return "employmentTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + } + } + if (message.languageCodes != null && message.hasOwnProperty("languageCodes")) { + if (!Array.isArray(message.languageCodes)) + return "languageCodes: array expected"; + for (var i = 0; i < message.languageCodes.length; ++i) + if (!$util.isString(message.languageCodes[i])) + return "languageCodes: string[] expected"; + } + if (message.publishTimeRange != null && message.hasOwnProperty("publishTimeRange")) { + var error = $root.google.cloud.talent.v4.TimestampRange.verify(message.publishTimeRange); + if (error) + return "publishTimeRange." + error; + } + if (message.excludedJobs != null && message.hasOwnProperty("excludedJobs")) { + if (!Array.isArray(message.excludedJobs)) + return "excludedJobs: array expected"; + for (var i = 0; i < message.excludedJobs.length; ++i) + if (!$util.isString(message.excludedJobs[i])) + return "excludedJobs: string[] expected"; + } + return null; + }; + + /** + * Creates a JobQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.JobQuery + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.JobQuery} JobQuery + */ + JobQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.JobQuery) + return object; + var message = new $root.google.cloud.talent.v4.JobQuery(); + if (object.query != null) + message.query = String(object.query); + if (object.queryLanguageCode != null) + message.queryLanguageCode = String(object.queryLanguageCode); + if (object.companies) { + if (!Array.isArray(object.companies)) + throw TypeError(".google.cloud.talent.v4.JobQuery.companies: array expected"); + message.companies = []; + for (var i = 0; i < object.companies.length; ++i) + message.companies[i] = String(object.companies[i]); + } + if (object.locationFilters) { + if (!Array.isArray(object.locationFilters)) + throw TypeError(".google.cloud.talent.v4.JobQuery.locationFilters: array expected"); + message.locationFilters = []; + for (var i = 0; i < object.locationFilters.length; ++i) { + if (typeof object.locationFilters[i] !== "object") + throw TypeError(".google.cloud.talent.v4.JobQuery.locationFilters: object expected"); + message.locationFilters[i] = $root.google.cloud.talent.v4.LocationFilter.fromObject(object.locationFilters[i]); + } + } + if (object.jobCategories) { + if (!Array.isArray(object.jobCategories)) + throw TypeError(".google.cloud.talent.v4.JobQuery.jobCategories: array expected"); + message.jobCategories = []; + for (var i = 0; i < object.jobCategories.length; ++i) + switch (object.jobCategories[i]) { + default: + if (typeof object.jobCategories[i] === "number") { + message.jobCategories[i] = object.jobCategories[i]; + break; + } + case "JOB_CATEGORY_UNSPECIFIED": + case 0: + message.jobCategories[i] = 0; + break; + case "ACCOUNTING_AND_FINANCE": + case 1: + message.jobCategories[i] = 1; + break; + case "ADMINISTRATIVE_AND_OFFICE": + case 2: + message.jobCategories[i] = 2; + break; + case "ADVERTISING_AND_MARKETING": + case 3: + message.jobCategories[i] = 3; + break; + case "ANIMAL_CARE": + case 4: + message.jobCategories[i] = 4; + break; + case "ART_FASHION_AND_DESIGN": + case 5: + message.jobCategories[i] = 5; + break; + case "BUSINESS_OPERATIONS": + case 6: + message.jobCategories[i] = 6; + break; + case "CLEANING_AND_FACILITIES": + case 7: + message.jobCategories[i] = 7; + break; + case "COMPUTER_AND_IT": + case 8: + message.jobCategories[i] = 8; + break; + case "CONSTRUCTION": + case 9: + message.jobCategories[i] = 9; + break; + case "CUSTOMER_SERVICE": + case 10: + message.jobCategories[i] = 10; + break; + case "EDUCATION": + case 11: + message.jobCategories[i] = 11; + break; + case "ENTERTAINMENT_AND_TRAVEL": + case 12: + message.jobCategories[i] = 12; + break; + case "FARMING_AND_OUTDOORS": + case 13: + message.jobCategories[i] = 13; + break; + case "HEALTHCARE": + case 14: + message.jobCategories[i] = 14; + break; + case "HUMAN_RESOURCES": + case 15: + message.jobCategories[i] = 15; + break; + case "INSTALLATION_MAINTENANCE_AND_REPAIR": + case 16: + message.jobCategories[i] = 16; + break; + case "LEGAL": + case 17: + message.jobCategories[i] = 17; + break; + case "MANAGEMENT": + case 18: + message.jobCategories[i] = 18; + break; + case "MANUFACTURING_AND_WAREHOUSE": + case 19: + message.jobCategories[i] = 19; + break; + case "MEDIA_COMMUNICATIONS_AND_WRITING": + case 20: + message.jobCategories[i] = 20; + break; + case "OIL_GAS_AND_MINING": + case 21: + message.jobCategories[i] = 21; + break; + case "PERSONAL_CARE_AND_SERVICES": + case 22: + message.jobCategories[i] = 22; + break; + case "PROTECTIVE_SERVICES": + case 23: + message.jobCategories[i] = 23; + break; + case "REAL_ESTATE": + case 24: + message.jobCategories[i] = 24; + break; + case "RESTAURANT_AND_HOSPITALITY": + case 25: + message.jobCategories[i] = 25; + break; + case "SALES_AND_RETAIL": + case 26: + message.jobCategories[i] = 26; + break; + case "SCIENCE_AND_ENGINEERING": + case 27: + message.jobCategories[i] = 27; + break; + case "SOCIAL_SERVICES_AND_NON_PROFIT": + case 28: + message.jobCategories[i] = 28; + break; + case "SPORTS_FITNESS_AND_RECREATION": + case 29: + message.jobCategories[i] = 29; + break; + case "TRANSPORTATION_AND_LOGISTICS": + case 30: + message.jobCategories[i] = 30; + break; + } + } + if (object.commuteFilter != null) { + if (typeof object.commuteFilter !== "object") + throw TypeError(".google.cloud.talent.v4.JobQuery.commuteFilter: object expected"); + message.commuteFilter = $root.google.cloud.talent.v4.CommuteFilter.fromObject(object.commuteFilter); + } + if (object.companyDisplayNames) { + if (!Array.isArray(object.companyDisplayNames)) + throw TypeError(".google.cloud.talent.v4.JobQuery.companyDisplayNames: array expected"); + message.companyDisplayNames = []; + for (var i = 0; i < object.companyDisplayNames.length; ++i) + message.companyDisplayNames[i] = String(object.companyDisplayNames[i]); + } + if (object.compensationFilter != null) { + if (typeof object.compensationFilter !== "object") + throw TypeError(".google.cloud.talent.v4.JobQuery.compensationFilter: object expected"); + message.compensationFilter = $root.google.cloud.talent.v4.CompensationFilter.fromObject(object.compensationFilter); + } + if (object.customAttributeFilter != null) + message.customAttributeFilter = String(object.customAttributeFilter); + if (object.disableSpellCheck != null) + message.disableSpellCheck = Boolean(object.disableSpellCheck); + if (object.employmentTypes) { + if (!Array.isArray(object.employmentTypes)) + throw TypeError(".google.cloud.talent.v4.JobQuery.employmentTypes: array expected"); + message.employmentTypes = []; + for (var i = 0; i < object.employmentTypes.length; ++i) + switch (object.employmentTypes[i]) { + default: + if (typeof object.employmentTypes[i] === "number") { + message.employmentTypes[i] = object.employmentTypes[i]; + break; + } + case "EMPLOYMENT_TYPE_UNSPECIFIED": + case 0: + message.employmentTypes[i] = 0; + break; + case "FULL_TIME": + case 1: + message.employmentTypes[i] = 1; + break; + case "PART_TIME": + case 2: + message.employmentTypes[i] = 2; + break; + case "CONTRACTOR": + case 3: + message.employmentTypes[i] = 3; + break; + case "CONTRACT_TO_HIRE": + case 4: + message.employmentTypes[i] = 4; + break; + case "TEMPORARY": + case 5: + message.employmentTypes[i] = 5; + break; + case "INTERN": + case 6: + message.employmentTypes[i] = 6; + break; + case "VOLUNTEER": + case 7: + message.employmentTypes[i] = 7; + break; + case "PER_DIEM": + case 8: + message.employmentTypes[i] = 8; + break; + case "FLY_IN_FLY_OUT": + case 9: + message.employmentTypes[i] = 9; + break; + case "OTHER_EMPLOYMENT_TYPE": + case 10: + message.employmentTypes[i] = 10; + break; + } + } + if (object.languageCodes) { + if (!Array.isArray(object.languageCodes)) + throw TypeError(".google.cloud.talent.v4.JobQuery.languageCodes: array expected"); + message.languageCodes = []; + for (var i = 0; i < object.languageCodes.length; ++i) + message.languageCodes[i] = String(object.languageCodes[i]); + } + if (object.publishTimeRange != null) { + if (typeof object.publishTimeRange !== "object") + throw TypeError(".google.cloud.talent.v4.JobQuery.publishTimeRange: object expected"); + message.publishTimeRange = $root.google.cloud.talent.v4.TimestampRange.fromObject(object.publishTimeRange); + } + if (object.excludedJobs) { + if (!Array.isArray(object.excludedJobs)) + throw TypeError(".google.cloud.talent.v4.JobQuery.excludedJobs: array expected"); + message.excludedJobs = []; + for (var i = 0; i < object.excludedJobs.length; ++i) + message.excludedJobs[i] = String(object.excludedJobs[i]); + } + return message; + }; + + /** + * Creates a plain object from a JobQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.JobQuery + * @static + * @param {google.cloud.talent.v4.JobQuery} message JobQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.companies = []; + object.locationFilters = []; + object.jobCategories = []; + object.companyDisplayNames = []; + object.employmentTypes = []; + object.languageCodes = []; + object.excludedJobs = []; + } + if (options.defaults) { + object.query = ""; + object.commuteFilter = null; + object.compensationFilter = null; + object.customAttributeFilter = ""; + object.disableSpellCheck = false; + object.publishTimeRange = null; + object.queryLanguageCode = ""; + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.companies && message.companies.length) { + object.companies = []; + for (var j = 0; j < message.companies.length; ++j) + object.companies[j] = message.companies[j]; + } + if (message.locationFilters && message.locationFilters.length) { + object.locationFilters = []; + for (var j = 0; j < message.locationFilters.length; ++j) + object.locationFilters[j] = $root.google.cloud.talent.v4.LocationFilter.toObject(message.locationFilters[j], options); + } + if (message.jobCategories && message.jobCategories.length) { + object.jobCategories = []; + for (var j = 0; j < message.jobCategories.length; ++j) + object.jobCategories[j] = options.enums === String ? $root.google.cloud.talent.v4.JobCategory[message.jobCategories[j]] === undefined ? message.jobCategories[j] : $root.google.cloud.talent.v4.JobCategory[message.jobCategories[j]] : message.jobCategories[j]; + } + if (message.commuteFilter != null && message.hasOwnProperty("commuteFilter")) + object.commuteFilter = $root.google.cloud.talent.v4.CommuteFilter.toObject(message.commuteFilter, options); + if (message.companyDisplayNames && message.companyDisplayNames.length) { + object.companyDisplayNames = []; + for (var j = 0; j < message.companyDisplayNames.length; ++j) + object.companyDisplayNames[j] = message.companyDisplayNames[j]; + } + if (message.compensationFilter != null && message.hasOwnProperty("compensationFilter")) + object.compensationFilter = $root.google.cloud.talent.v4.CompensationFilter.toObject(message.compensationFilter, options); + if (message.customAttributeFilter != null && message.hasOwnProperty("customAttributeFilter")) + object.customAttributeFilter = message.customAttributeFilter; + if (message.disableSpellCheck != null && message.hasOwnProperty("disableSpellCheck")) + object.disableSpellCheck = message.disableSpellCheck; + if (message.employmentTypes && message.employmentTypes.length) { + object.employmentTypes = []; + for (var j = 0; j < message.employmentTypes.length; ++j) + object.employmentTypes[j] = options.enums === String ? $root.google.cloud.talent.v4.EmploymentType[message.employmentTypes[j]] === undefined ? message.employmentTypes[j] : $root.google.cloud.talent.v4.EmploymentType[message.employmentTypes[j]] : message.employmentTypes[j]; + } + if (message.languageCodes && message.languageCodes.length) { + object.languageCodes = []; + for (var j = 0; j < message.languageCodes.length; ++j) + object.languageCodes[j] = message.languageCodes[j]; + } + if (message.publishTimeRange != null && message.hasOwnProperty("publishTimeRange")) + object.publishTimeRange = $root.google.cloud.talent.v4.TimestampRange.toObject(message.publishTimeRange, options); + if (message.excludedJobs && message.excludedJobs.length) { + object.excludedJobs = []; + for (var j = 0; j < message.excludedJobs.length; ++j) + object.excludedJobs[j] = message.excludedJobs[j]; + } + if (message.queryLanguageCode != null && message.hasOwnProperty("queryLanguageCode")) + object.queryLanguageCode = message.queryLanguageCode; + return object; + }; + + /** + * Converts this JobQuery to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.JobQuery + * @instance + * @returns {Object.} JSON object + */ + JobQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobQuery + * @function getTypeUrl + * @memberof google.cloud.talent.v4.JobQuery + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.JobQuery"; + }; + + return JobQuery; + })(); + + v4.LocationFilter = (function() { + + /** + * Properties of a LocationFilter. + * @memberof google.cloud.talent.v4 + * @interface ILocationFilter + * @property {string|null} [address] LocationFilter address + * @property {string|null} [regionCode] LocationFilter regionCode + * @property {google.type.ILatLng|null} [latLng] LocationFilter latLng + * @property {number|null} [distanceInMiles] LocationFilter distanceInMiles + * @property {google.cloud.talent.v4.LocationFilter.TelecommutePreference|null} [telecommutePreference] LocationFilter telecommutePreference + */ + + /** + * Constructs a new LocationFilter. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a LocationFilter. + * @implements ILocationFilter + * @constructor + * @param {google.cloud.talent.v4.ILocationFilter=} [properties] Properties to set + */ + function LocationFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationFilter address. + * @member {string} address + * @memberof google.cloud.talent.v4.LocationFilter + * @instance + */ + LocationFilter.prototype.address = ""; + + /** + * LocationFilter regionCode. + * @member {string} regionCode + * @memberof google.cloud.talent.v4.LocationFilter + * @instance + */ + LocationFilter.prototype.regionCode = ""; + + /** + * LocationFilter latLng. + * @member {google.type.ILatLng|null|undefined} latLng + * @memberof google.cloud.talent.v4.LocationFilter + * @instance + */ + LocationFilter.prototype.latLng = null; + + /** + * LocationFilter distanceInMiles. + * @member {number} distanceInMiles + * @memberof google.cloud.talent.v4.LocationFilter + * @instance + */ + LocationFilter.prototype.distanceInMiles = 0; + + /** + * LocationFilter telecommutePreference. + * @member {google.cloud.talent.v4.LocationFilter.TelecommutePreference} telecommutePreference + * @memberof google.cloud.talent.v4.LocationFilter + * @instance + */ + LocationFilter.prototype.telecommutePreference = 0; + + /** + * Creates a new LocationFilter instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.LocationFilter + * @static + * @param {google.cloud.talent.v4.ILocationFilter=} [properties] Properties to set + * @returns {google.cloud.talent.v4.LocationFilter} LocationFilter instance + */ + LocationFilter.create = function create(properties) { + return new LocationFilter(properties); + }; + + /** + * Encodes the specified LocationFilter message. Does not implicitly {@link google.cloud.talent.v4.LocationFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.LocationFilter + * @static + * @param {google.cloud.talent.v4.ILocationFilter} message LocationFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.regionCode); + if (message.latLng != null && Object.hasOwnProperty.call(message, "latLng")) + $root.google.type.LatLng.encode(message.latLng, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.distanceInMiles != null && Object.hasOwnProperty.call(message, "distanceInMiles")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.distanceInMiles); + if (message.telecommutePreference != null && Object.hasOwnProperty.call(message, "telecommutePreference")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.telecommutePreference); + return writer; + }; + + /** + * Encodes the specified LocationFilter message, length delimited. Does not implicitly {@link google.cloud.talent.v4.LocationFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.LocationFilter + * @static + * @param {google.cloud.talent.v4.ILocationFilter} message LocationFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.LocationFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.LocationFilter} LocationFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.LocationFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.address = reader.string(); + break; + } + case 2: { + message.regionCode = reader.string(); + break; + } + case 3: { + message.latLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + case 4: { + message.distanceInMiles = reader.double(); + break; + } + case 5: { + message.telecommutePreference = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.LocationFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.LocationFilter} LocationFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationFilter message. + * @function verify + * @memberof google.cloud.talent.v4.LocationFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.latLng != null && message.hasOwnProperty("latLng")) { + var error = $root.google.type.LatLng.verify(message.latLng); + if (error) + return "latLng." + error; + } + if (message.distanceInMiles != null && message.hasOwnProperty("distanceInMiles")) + if (typeof message.distanceInMiles !== "number") + return "distanceInMiles: number expected"; + if (message.telecommutePreference != null && message.hasOwnProperty("telecommutePreference")) + switch (message.telecommutePreference) { + default: + return "telecommutePreference: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a LocationFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.LocationFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.LocationFilter} LocationFilter + */ + LocationFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.LocationFilter) + return object; + var message = new $root.google.cloud.talent.v4.LocationFilter(); + if (object.address != null) + message.address = String(object.address); + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + if (object.latLng != null) { + if (typeof object.latLng !== "object") + throw TypeError(".google.cloud.talent.v4.LocationFilter.latLng: object expected"); + message.latLng = $root.google.type.LatLng.fromObject(object.latLng); + } + if (object.distanceInMiles != null) + message.distanceInMiles = Number(object.distanceInMiles); + switch (object.telecommutePreference) { + default: + if (typeof object.telecommutePreference === "number") { + message.telecommutePreference = object.telecommutePreference; + break; + } + break; + case "TELECOMMUTE_PREFERENCE_UNSPECIFIED": + case 0: + message.telecommutePreference = 0; + break; + case "TELECOMMUTE_EXCLUDED": + case 1: + message.telecommutePreference = 1; + break; + case "TELECOMMUTE_ALLOWED": + case 2: + message.telecommutePreference = 2; + break; + case "TELECOMMUTE_JOBS_EXCLUDED": + case 3: + message.telecommutePreference = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a LocationFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.LocationFilter + * @static + * @param {google.cloud.talent.v4.LocationFilter} message LocationFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.address = ""; + object.regionCode = ""; + object.latLng = null; + object.distanceInMiles = 0; + object.telecommutePreference = options.enums === String ? "TELECOMMUTE_PREFERENCE_UNSPECIFIED" : 0; + } + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.latLng != null && message.hasOwnProperty("latLng")) + object.latLng = $root.google.type.LatLng.toObject(message.latLng, options); + if (message.distanceInMiles != null && message.hasOwnProperty("distanceInMiles")) + object.distanceInMiles = options.json && !isFinite(message.distanceInMiles) ? String(message.distanceInMiles) : message.distanceInMiles; + if (message.telecommutePreference != null && message.hasOwnProperty("telecommutePreference")) + object.telecommutePreference = options.enums === String ? $root.google.cloud.talent.v4.LocationFilter.TelecommutePreference[message.telecommutePreference] === undefined ? message.telecommutePreference : $root.google.cloud.talent.v4.LocationFilter.TelecommutePreference[message.telecommutePreference] : message.telecommutePreference; + return object; + }; + + /** + * Converts this LocationFilter to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.LocationFilter + * @instance + * @returns {Object.} JSON object + */ + LocationFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationFilter + * @function getTypeUrl + * @memberof google.cloud.talent.v4.LocationFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.LocationFilter"; + }; + + /** + * TelecommutePreference enum. + * @name google.cloud.talent.v4.LocationFilter.TelecommutePreference + * @enum {number} + * @property {number} TELECOMMUTE_PREFERENCE_UNSPECIFIED=0 TELECOMMUTE_PREFERENCE_UNSPECIFIED value + * @property {number} TELECOMMUTE_EXCLUDED=1 TELECOMMUTE_EXCLUDED value + * @property {number} TELECOMMUTE_ALLOWED=2 TELECOMMUTE_ALLOWED value + * @property {number} TELECOMMUTE_JOBS_EXCLUDED=3 TELECOMMUTE_JOBS_EXCLUDED value + */ + LocationFilter.TelecommutePreference = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TELECOMMUTE_PREFERENCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TELECOMMUTE_EXCLUDED"] = 1; + values[valuesById[2] = "TELECOMMUTE_ALLOWED"] = 2; + values[valuesById[3] = "TELECOMMUTE_JOBS_EXCLUDED"] = 3; + return values; + })(); + + return LocationFilter; + })(); + + v4.CompensationFilter = (function() { + + /** + * Properties of a CompensationFilter. + * @memberof google.cloud.talent.v4 + * @interface ICompensationFilter + * @property {google.cloud.talent.v4.CompensationFilter.FilterType|null} [type] CompensationFilter type + * @property {Array.|null} [units] CompensationFilter units + * @property {google.cloud.talent.v4.CompensationInfo.ICompensationRange|null} [range] CompensationFilter range + * @property {boolean|null} [includeJobsWithUnspecifiedCompensationRange] CompensationFilter includeJobsWithUnspecifiedCompensationRange + */ + + /** + * Constructs a new CompensationFilter. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a CompensationFilter. + * @implements ICompensationFilter + * @constructor + * @param {google.cloud.talent.v4.ICompensationFilter=} [properties] Properties to set + */ + function CompensationFilter(properties) { + this.units = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompensationFilter type. + * @member {google.cloud.talent.v4.CompensationFilter.FilterType} type + * @memberof google.cloud.talent.v4.CompensationFilter + * @instance + */ + CompensationFilter.prototype.type = 0; + + /** + * CompensationFilter units. + * @member {Array.} units + * @memberof google.cloud.talent.v4.CompensationFilter + * @instance + */ + CompensationFilter.prototype.units = $util.emptyArray; + + /** + * CompensationFilter range. + * @member {google.cloud.talent.v4.CompensationInfo.ICompensationRange|null|undefined} range + * @memberof google.cloud.talent.v4.CompensationFilter + * @instance + */ + CompensationFilter.prototype.range = null; + + /** + * CompensationFilter includeJobsWithUnspecifiedCompensationRange. + * @member {boolean} includeJobsWithUnspecifiedCompensationRange + * @memberof google.cloud.talent.v4.CompensationFilter + * @instance + */ + CompensationFilter.prototype.includeJobsWithUnspecifiedCompensationRange = false; + + /** + * Creates a new CompensationFilter instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.CompensationFilter + * @static + * @param {google.cloud.talent.v4.ICompensationFilter=} [properties] Properties to set + * @returns {google.cloud.talent.v4.CompensationFilter} CompensationFilter instance + */ + CompensationFilter.create = function create(properties) { + return new CompensationFilter(properties); + }; + + /** + * Encodes the specified CompensationFilter message. Does not implicitly {@link google.cloud.talent.v4.CompensationFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.CompensationFilter + * @static + * @param {google.cloud.talent.v4.ICompensationFilter} message CompensationFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompensationFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.units != null && message.units.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.units.length; ++i) + writer.int32(message.units[i]); + writer.ldelim(); + } + if (message.range != null && Object.hasOwnProperty.call(message, "range")) + $root.google.cloud.talent.v4.CompensationInfo.CompensationRange.encode(message.range, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.includeJobsWithUnspecifiedCompensationRange != null && Object.hasOwnProperty.call(message, "includeJobsWithUnspecifiedCompensationRange")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.includeJobsWithUnspecifiedCompensationRange); + return writer; + }; + + /** + * Encodes the specified CompensationFilter message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CompensationFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.CompensationFilter + * @static + * @param {google.cloud.talent.v4.ICompensationFilter} message CompensationFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompensationFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompensationFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.CompensationFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.CompensationFilter} CompensationFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompensationFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.CompensationFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + if (!(message.units && message.units.length)) + message.units = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.units.push(reader.int32()); + } else + message.units.push(reader.int32()); + break; + } + case 3: { + message.range = $root.google.cloud.talent.v4.CompensationInfo.CompensationRange.decode(reader, reader.uint32()); + break; + } + case 4: { + message.includeJobsWithUnspecifiedCompensationRange = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompensationFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.CompensationFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.CompensationFilter} CompensationFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompensationFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompensationFilter message. + * @function verify + * @memberof google.cloud.talent.v4.CompensationFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompensationFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.units != null && message.hasOwnProperty("units")) { + if (!Array.isArray(message.units)) + return "units: array expected"; + for (var i = 0; i < message.units.length; ++i) + switch (message.units[i]) { + default: + return "units: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message.range != null && message.hasOwnProperty("range")) { + var error = $root.google.cloud.talent.v4.CompensationInfo.CompensationRange.verify(message.range); + if (error) + return "range." + error; + } + if (message.includeJobsWithUnspecifiedCompensationRange != null && message.hasOwnProperty("includeJobsWithUnspecifiedCompensationRange")) + if (typeof message.includeJobsWithUnspecifiedCompensationRange !== "boolean") + return "includeJobsWithUnspecifiedCompensationRange: boolean expected"; + return null; + }; + + /** + * Creates a CompensationFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.CompensationFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.CompensationFilter} CompensationFilter + */ + CompensationFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.CompensationFilter) + return object; + var message = new $root.google.cloud.talent.v4.CompensationFilter(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "FILTER_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "UNIT_ONLY": + case 1: + message.type = 1; + break; + case "UNIT_AND_AMOUNT": + case 2: + message.type = 2; + break; + case "ANNUALIZED_BASE_AMOUNT": + case 3: + message.type = 3; + break; + case "ANNUALIZED_TOTAL_AMOUNT": + case 4: + message.type = 4; + break; + } + if (object.units) { + if (!Array.isArray(object.units)) + throw TypeError(".google.cloud.talent.v4.CompensationFilter.units: array expected"); + message.units = []; + for (var i = 0; i < object.units.length; ++i) + switch (object.units[i]) { + default: + if (typeof object.units[i] === "number") { + message.units[i] = object.units[i]; + break; + } + case "COMPENSATION_UNIT_UNSPECIFIED": + case 0: + message.units[i] = 0; + break; + case "HOURLY": + case 1: + message.units[i] = 1; + break; + case "DAILY": + case 2: + message.units[i] = 2; + break; + case "WEEKLY": + case 3: + message.units[i] = 3; + break; + case "MONTHLY": + case 4: + message.units[i] = 4; + break; + case "YEARLY": + case 5: + message.units[i] = 5; + break; + case "ONE_TIME": + case 6: + message.units[i] = 6; + break; + case "OTHER_COMPENSATION_UNIT": + case 7: + message.units[i] = 7; + break; + } + } + if (object.range != null) { + if (typeof object.range !== "object") + throw TypeError(".google.cloud.talent.v4.CompensationFilter.range: object expected"); + message.range = $root.google.cloud.talent.v4.CompensationInfo.CompensationRange.fromObject(object.range); + } + if (object.includeJobsWithUnspecifiedCompensationRange != null) + message.includeJobsWithUnspecifiedCompensationRange = Boolean(object.includeJobsWithUnspecifiedCompensationRange); + return message; + }; + + /** + * Creates a plain object from a CompensationFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.CompensationFilter + * @static + * @param {google.cloud.talent.v4.CompensationFilter} message CompensationFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompensationFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.units = []; + if (options.defaults) { + object.type = options.enums === String ? "FILTER_TYPE_UNSPECIFIED" : 0; + object.range = null; + object.includeJobsWithUnspecifiedCompensationRange = false; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.talent.v4.CompensationFilter.FilterType[message.type] === undefined ? message.type : $root.google.cloud.talent.v4.CompensationFilter.FilterType[message.type] : message.type; + if (message.units && message.units.length) { + object.units = []; + for (var j = 0; j < message.units.length; ++j) + object.units[j] = options.enums === String ? $root.google.cloud.talent.v4.CompensationInfo.CompensationUnit[message.units[j]] === undefined ? message.units[j] : $root.google.cloud.talent.v4.CompensationInfo.CompensationUnit[message.units[j]] : message.units[j]; + } + if (message.range != null && message.hasOwnProperty("range")) + object.range = $root.google.cloud.talent.v4.CompensationInfo.CompensationRange.toObject(message.range, options); + if (message.includeJobsWithUnspecifiedCompensationRange != null && message.hasOwnProperty("includeJobsWithUnspecifiedCompensationRange")) + object.includeJobsWithUnspecifiedCompensationRange = message.includeJobsWithUnspecifiedCompensationRange; + return object; + }; + + /** + * Converts this CompensationFilter to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.CompensationFilter + * @instance + * @returns {Object.} JSON object + */ + CompensationFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompensationFilter + * @function getTypeUrl + * @memberof google.cloud.talent.v4.CompensationFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompensationFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.CompensationFilter"; + }; + + /** + * FilterType enum. + * @name google.cloud.talent.v4.CompensationFilter.FilterType + * @enum {number} + * @property {number} FILTER_TYPE_UNSPECIFIED=0 FILTER_TYPE_UNSPECIFIED value + * @property {number} UNIT_ONLY=1 UNIT_ONLY value + * @property {number} UNIT_AND_AMOUNT=2 UNIT_AND_AMOUNT value + * @property {number} ANNUALIZED_BASE_AMOUNT=3 ANNUALIZED_BASE_AMOUNT value + * @property {number} ANNUALIZED_TOTAL_AMOUNT=4 ANNUALIZED_TOTAL_AMOUNT value + */ + CompensationFilter.FilterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FILTER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNIT_ONLY"] = 1; + values[valuesById[2] = "UNIT_AND_AMOUNT"] = 2; + values[valuesById[3] = "ANNUALIZED_BASE_AMOUNT"] = 3; + values[valuesById[4] = "ANNUALIZED_TOTAL_AMOUNT"] = 4; + return values; + })(); + + return CompensationFilter; + })(); + + v4.CommuteFilter = (function() { + + /** + * Properties of a CommuteFilter. + * @memberof google.cloud.talent.v4 + * @interface ICommuteFilter + * @property {google.cloud.talent.v4.CommuteMethod|null} [commuteMethod] CommuteFilter commuteMethod + * @property {google.type.ILatLng|null} [startCoordinates] CommuteFilter startCoordinates + * @property {google.protobuf.IDuration|null} [travelDuration] CommuteFilter travelDuration + * @property {boolean|null} [allowImpreciseAddresses] CommuteFilter allowImpreciseAddresses + * @property {google.cloud.talent.v4.CommuteFilter.RoadTraffic|null} [roadTraffic] CommuteFilter roadTraffic + * @property {google.type.ITimeOfDay|null} [departureTime] CommuteFilter departureTime + */ + + /** + * Constructs a new CommuteFilter. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a CommuteFilter. + * @implements ICommuteFilter + * @constructor + * @param {google.cloud.talent.v4.ICommuteFilter=} [properties] Properties to set + */ + function CommuteFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommuteFilter commuteMethod. + * @member {google.cloud.talent.v4.CommuteMethod} commuteMethod + * @memberof google.cloud.talent.v4.CommuteFilter + * @instance + */ + CommuteFilter.prototype.commuteMethod = 0; + + /** + * CommuteFilter startCoordinates. + * @member {google.type.ILatLng|null|undefined} startCoordinates + * @memberof google.cloud.talent.v4.CommuteFilter + * @instance + */ + CommuteFilter.prototype.startCoordinates = null; + + /** + * CommuteFilter travelDuration. + * @member {google.protobuf.IDuration|null|undefined} travelDuration + * @memberof google.cloud.talent.v4.CommuteFilter + * @instance + */ + CommuteFilter.prototype.travelDuration = null; + + /** + * CommuteFilter allowImpreciseAddresses. + * @member {boolean} allowImpreciseAddresses + * @memberof google.cloud.talent.v4.CommuteFilter + * @instance + */ + CommuteFilter.prototype.allowImpreciseAddresses = false; + + /** + * CommuteFilter roadTraffic. + * @member {google.cloud.talent.v4.CommuteFilter.RoadTraffic|null|undefined} roadTraffic + * @memberof google.cloud.talent.v4.CommuteFilter + * @instance + */ + CommuteFilter.prototype.roadTraffic = null; + + /** + * CommuteFilter departureTime. + * @member {google.type.ITimeOfDay|null|undefined} departureTime + * @memberof google.cloud.talent.v4.CommuteFilter + * @instance + */ + CommuteFilter.prototype.departureTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CommuteFilter trafficOption. + * @member {"roadTraffic"|"departureTime"|undefined} trafficOption + * @memberof google.cloud.talent.v4.CommuteFilter + * @instance + */ + Object.defineProperty(CommuteFilter.prototype, "trafficOption", { + get: $util.oneOfGetter($oneOfFields = ["roadTraffic", "departureTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CommuteFilter instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.CommuteFilter + * @static + * @param {google.cloud.talent.v4.ICommuteFilter=} [properties] Properties to set + * @returns {google.cloud.talent.v4.CommuteFilter} CommuteFilter instance + */ + CommuteFilter.create = function create(properties) { + return new CommuteFilter(properties); + }; + + /** + * Encodes the specified CommuteFilter message. Does not implicitly {@link google.cloud.talent.v4.CommuteFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.CommuteFilter + * @static + * @param {google.cloud.talent.v4.ICommuteFilter} message CommuteFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommuteFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commuteMethod != null && Object.hasOwnProperty.call(message, "commuteMethod")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.commuteMethod); + if (message.startCoordinates != null && Object.hasOwnProperty.call(message, "startCoordinates")) + $root.google.type.LatLng.encode(message.startCoordinates, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.travelDuration != null && Object.hasOwnProperty.call(message, "travelDuration")) + $root.google.protobuf.Duration.encode(message.travelDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.allowImpreciseAddresses != null && Object.hasOwnProperty.call(message, "allowImpreciseAddresses")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowImpreciseAddresses); + if (message.roadTraffic != null && Object.hasOwnProperty.call(message, "roadTraffic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.roadTraffic); + if (message.departureTime != null && Object.hasOwnProperty.call(message, "departureTime")) + $root.google.type.TimeOfDay.encode(message.departureTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommuteFilter message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CommuteFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.CommuteFilter + * @static + * @param {google.cloud.talent.v4.ICommuteFilter} message CommuteFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommuteFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommuteFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.CommuteFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.CommuteFilter} CommuteFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommuteFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.CommuteFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.commuteMethod = reader.int32(); + break; + } + case 2: { + message.startCoordinates = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + case 3: { + message.travelDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.allowImpreciseAddresses = reader.bool(); + break; + } + case 5: { + message.roadTraffic = reader.int32(); + break; + } + case 6: { + message.departureTime = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommuteFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.CommuteFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.CommuteFilter} CommuteFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommuteFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommuteFilter message. + * @function verify + * @memberof google.cloud.talent.v4.CommuteFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommuteFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.commuteMethod != null && message.hasOwnProperty("commuteMethod")) + switch (message.commuteMethod) { + default: + return "commuteMethod: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.startCoordinates != null && message.hasOwnProperty("startCoordinates")) { + var error = $root.google.type.LatLng.verify(message.startCoordinates); + if (error) + return "startCoordinates." + error; + } + if (message.travelDuration != null && message.hasOwnProperty("travelDuration")) { + var error = $root.google.protobuf.Duration.verify(message.travelDuration); + if (error) + return "travelDuration." + error; + } + if (message.allowImpreciseAddresses != null && message.hasOwnProperty("allowImpreciseAddresses")) + if (typeof message.allowImpreciseAddresses !== "boolean") + return "allowImpreciseAddresses: boolean expected"; + if (message.roadTraffic != null && message.hasOwnProperty("roadTraffic")) { + properties.trafficOption = 1; + switch (message.roadTraffic) { + default: + return "roadTraffic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.departureTime != null && message.hasOwnProperty("departureTime")) { + if (properties.trafficOption === 1) + return "trafficOption: multiple values"; + properties.trafficOption = 1; + { + var error = $root.google.type.TimeOfDay.verify(message.departureTime); + if (error) + return "departureTime." + error; + } + } + return null; + }; + + /** + * Creates a CommuteFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.CommuteFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.CommuteFilter} CommuteFilter + */ + CommuteFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.CommuteFilter) + return object; + var message = new $root.google.cloud.talent.v4.CommuteFilter(); + switch (object.commuteMethod) { + default: + if (typeof object.commuteMethod === "number") { + message.commuteMethod = object.commuteMethod; + break; + } + break; + case "COMMUTE_METHOD_UNSPECIFIED": + case 0: + message.commuteMethod = 0; + break; + case "DRIVING": + case 1: + message.commuteMethod = 1; + break; + case "TRANSIT": + case 2: + message.commuteMethod = 2; + break; + case "WALKING": + case 3: + message.commuteMethod = 3; + break; + case "CYCLING": + case 4: + message.commuteMethod = 4; + break; + case "TRANSIT_ACCESSIBLE": + case 5: + message.commuteMethod = 5; + break; + } + if (object.startCoordinates != null) { + if (typeof object.startCoordinates !== "object") + throw TypeError(".google.cloud.talent.v4.CommuteFilter.startCoordinates: object expected"); + message.startCoordinates = $root.google.type.LatLng.fromObject(object.startCoordinates); + } + if (object.travelDuration != null) { + if (typeof object.travelDuration !== "object") + throw TypeError(".google.cloud.talent.v4.CommuteFilter.travelDuration: object expected"); + message.travelDuration = $root.google.protobuf.Duration.fromObject(object.travelDuration); + } + if (object.allowImpreciseAddresses != null) + message.allowImpreciseAddresses = Boolean(object.allowImpreciseAddresses); + switch (object.roadTraffic) { + default: + if (typeof object.roadTraffic === "number") { + message.roadTraffic = object.roadTraffic; + break; + } + break; + case "ROAD_TRAFFIC_UNSPECIFIED": + case 0: + message.roadTraffic = 0; + break; + case "TRAFFIC_FREE": + case 1: + message.roadTraffic = 1; + break; + case "BUSY_HOUR": + case 2: + message.roadTraffic = 2; + break; + } + if (object.departureTime != null) { + if (typeof object.departureTime !== "object") + throw TypeError(".google.cloud.talent.v4.CommuteFilter.departureTime: object expected"); + message.departureTime = $root.google.type.TimeOfDay.fromObject(object.departureTime); + } + return message; + }; + + /** + * Creates a plain object from a CommuteFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.CommuteFilter + * @static + * @param {google.cloud.talent.v4.CommuteFilter} message CommuteFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommuteFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.commuteMethod = options.enums === String ? "COMMUTE_METHOD_UNSPECIFIED" : 0; + object.startCoordinates = null; + object.travelDuration = null; + object.allowImpreciseAddresses = false; + } + if (message.commuteMethod != null && message.hasOwnProperty("commuteMethod")) + object.commuteMethod = options.enums === String ? $root.google.cloud.talent.v4.CommuteMethod[message.commuteMethod] === undefined ? message.commuteMethod : $root.google.cloud.talent.v4.CommuteMethod[message.commuteMethod] : message.commuteMethod; + if (message.startCoordinates != null && message.hasOwnProperty("startCoordinates")) + object.startCoordinates = $root.google.type.LatLng.toObject(message.startCoordinates, options); + if (message.travelDuration != null && message.hasOwnProperty("travelDuration")) + object.travelDuration = $root.google.protobuf.Duration.toObject(message.travelDuration, options); + if (message.allowImpreciseAddresses != null && message.hasOwnProperty("allowImpreciseAddresses")) + object.allowImpreciseAddresses = message.allowImpreciseAddresses; + if (message.roadTraffic != null && message.hasOwnProperty("roadTraffic")) { + object.roadTraffic = options.enums === String ? $root.google.cloud.talent.v4.CommuteFilter.RoadTraffic[message.roadTraffic] === undefined ? message.roadTraffic : $root.google.cloud.talent.v4.CommuteFilter.RoadTraffic[message.roadTraffic] : message.roadTraffic; + if (options.oneofs) + object.trafficOption = "roadTraffic"; + } + if (message.departureTime != null && message.hasOwnProperty("departureTime")) { + object.departureTime = $root.google.type.TimeOfDay.toObject(message.departureTime, options); + if (options.oneofs) + object.trafficOption = "departureTime"; + } + return object; + }; + + /** + * Converts this CommuteFilter to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.CommuteFilter + * @instance + * @returns {Object.} JSON object + */ + CommuteFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommuteFilter + * @function getTypeUrl + * @memberof google.cloud.talent.v4.CommuteFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommuteFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.CommuteFilter"; + }; + + /** + * RoadTraffic enum. + * @name google.cloud.talent.v4.CommuteFilter.RoadTraffic + * @enum {number} + * @property {number} ROAD_TRAFFIC_UNSPECIFIED=0 ROAD_TRAFFIC_UNSPECIFIED value + * @property {number} TRAFFIC_FREE=1 TRAFFIC_FREE value + * @property {number} BUSY_HOUR=2 BUSY_HOUR value + */ + CommuteFilter.RoadTraffic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROAD_TRAFFIC_UNSPECIFIED"] = 0; + values[valuesById[1] = "TRAFFIC_FREE"] = 1; + values[valuesById[2] = "BUSY_HOUR"] = 2; + return values; + })(); + + return CommuteFilter; + })(); + + v4.HistogramQuery = (function() { + + /** + * Properties of a HistogramQuery. + * @memberof google.cloud.talent.v4 + * @interface IHistogramQuery + * @property {string|null} [histogramQuery] HistogramQuery histogramQuery + */ + + /** + * Constructs a new HistogramQuery. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a HistogramQuery. + * @implements IHistogramQuery + * @constructor + * @param {google.cloud.talent.v4.IHistogramQuery=} [properties] Properties to set + */ + function HistogramQuery(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HistogramQuery histogramQuery. + * @member {string} histogramQuery + * @memberof google.cloud.talent.v4.HistogramQuery + * @instance + */ + HistogramQuery.prototype.histogramQuery = ""; + + /** + * Creates a new HistogramQuery instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.HistogramQuery + * @static + * @param {google.cloud.talent.v4.IHistogramQuery=} [properties] Properties to set + * @returns {google.cloud.talent.v4.HistogramQuery} HistogramQuery instance + */ + HistogramQuery.create = function create(properties) { + return new HistogramQuery(properties); + }; + + /** + * Encodes the specified HistogramQuery message. Does not implicitly {@link google.cloud.talent.v4.HistogramQuery.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.HistogramQuery + * @static + * @param {google.cloud.talent.v4.IHistogramQuery} message HistogramQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.histogramQuery != null && Object.hasOwnProperty.call(message, "histogramQuery")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.histogramQuery); + return writer; + }; + + /** + * Encodes the specified HistogramQuery message, length delimited. Does not implicitly {@link google.cloud.talent.v4.HistogramQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.HistogramQuery + * @static + * @param {google.cloud.talent.v4.IHistogramQuery} message HistogramQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HistogramQuery message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.HistogramQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.HistogramQuery} HistogramQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramQuery.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.HistogramQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.histogramQuery = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HistogramQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.HistogramQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.HistogramQuery} HistogramQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HistogramQuery message. + * @function verify + * @memberof google.cloud.talent.v4.HistogramQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HistogramQuery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.histogramQuery != null && message.hasOwnProperty("histogramQuery")) + if (!$util.isString(message.histogramQuery)) + return "histogramQuery: string expected"; + return null; + }; + + /** + * Creates a HistogramQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.HistogramQuery + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.HistogramQuery} HistogramQuery + */ + HistogramQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.HistogramQuery) + return object; + var message = new $root.google.cloud.talent.v4.HistogramQuery(); + if (object.histogramQuery != null) + message.histogramQuery = String(object.histogramQuery); + return message; + }; + + /** + * Creates a plain object from a HistogramQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.HistogramQuery + * @static + * @param {google.cloud.talent.v4.HistogramQuery} message HistogramQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HistogramQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.histogramQuery = ""; + if (message.histogramQuery != null && message.hasOwnProperty("histogramQuery")) + object.histogramQuery = message.histogramQuery; + return object; + }; + + /** + * Converts this HistogramQuery to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.HistogramQuery + * @instance + * @returns {Object.} JSON object + */ + HistogramQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HistogramQuery + * @function getTypeUrl + * @memberof google.cloud.talent.v4.HistogramQuery + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HistogramQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.HistogramQuery"; + }; + + return HistogramQuery; + })(); + + v4.HistogramQueryResult = (function() { + + /** + * Properties of a HistogramQueryResult. + * @memberof google.cloud.talent.v4 + * @interface IHistogramQueryResult + * @property {string|null} [histogramQuery] HistogramQueryResult histogramQuery + * @property {Object.|null} [histogram] HistogramQueryResult histogram + */ + + /** + * Constructs a new HistogramQueryResult. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a HistogramQueryResult. + * @implements IHistogramQueryResult + * @constructor + * @param {google.cloud.talent.v4.IHistogramQueryResult=} [properties] Properties to set + */ + function HistogramQueryResult(properties) { + this.histogram = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HistogramQueryResult histogramQuery. + * @member {string} histogramQuery + * @memberof google.cloud.talent.v4.HistogramQueryResult + * @instance + */ + HistogramQueryResult.prototype.histogramQuery = ""; + + /** + * HistogramQueryResult histogram. + * @member {Object.} histogram + * @memberof google.cloud.talent.v4.HistogramQueryResult + * @instance + */ + HistogramQueryResult.prototype.histogram = $util.emptyObject; + + /** + * Creates a new HistogramQueryResult instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.HistogramQueryResult + * @static + * @param {google.cloud.talent.v4.IHistogramQueryResult=} [properties] Properties to set + * @returns {google.cloud.talent.v4.HistogramQueryResult} HistogramQueryResult instance + */ + HistogramQueryResult.create = function create(properties) { + return new HistogramQueryResult(properties); + }; + + /** + * Encodes the specified HistogramQueryResult message. Does not implicitly {@link google.cloud.talent.v4.HistogramQueryResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.HistogramQueryResult + * @static + * @param {google.cloud.talent.v4.IHistogramQueryResult} message HistogramQueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramQueryResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.histogramQuery != null && Object.hasOwnProperty.call(message, "histogramQuery")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.histogramQuery); + if (message.histogram != null && Object.hasOwnProperty.call(message, "histogram")) + for (var keys = Object.keys(message.histogram), 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 0 =*/16).int64(message.histogram[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified HistogramQueryResult message, length delimited. Does not implicitly {@link google.cloud.talent.v4.HistogramQueryResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.HistogramQueryResult + * @static + * @param {google.cloud.talent.v4.IHistogramQueryResult} message HistogramQueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramQueryResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HistogramQueryResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.HistogramQueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.HistogramQueryResult} HistogramQueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramQueryResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.HistogramQueryResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.histogramQuery = reader.string(); + break; + } + case 2: { + if (message.histogram === $util.emptyObject) + message.histogram = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.int64(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.histogram[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HistogramQueryResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.HistogramQueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.HistogramQueryResult} HistogramQueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramQueryResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HistogramQueryResult message. + * @function verify + * @memberof google.cloud.talent.v4.HistogramQueryResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HistogramQueryResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.histogramQuery != null && message.hasOwnProperty("histogramQuery")) + if (!$util.isString(message.histogramQuery)) + return "histogramQuery: string expected"; + if (message.histogram != null && message.hasOwnProperty("histogram")) { + if (!$util.isObject(message.histogram)) + return "histogram: object expected"; + var key = Object.keys(message.histogram); + for (var i = 0; i < key.length; ++i) + if (!$util.isInteger(message.histogram[key[i]]) && !(message.histogram[key[i]] && $util.isInteger(message.histogram[key[i]].low) && $util.isInteger(message.histogram[key[i]].high))) + return "histogram: integer|Long{k:string} expected"; + } + return null; + }; + + /** + * Creates a HistogramQueryResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.HistogramQueryResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.HistogramQueryResult} HistogramQueryResult + */ + HistogramQueryResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.HistogramQueryResult) + return object; + var message = new $root.google.cloud.talent.v4.HistogramQueryResult(); + if (object.histogramQuery != null) + message.histogramQuery = String(object.histogramQuery); + if (object.histogram) { + if (typeof object.histogram !== "object") + throw TypeError(".google.cloud.talent.v4.HistogramQueryResult.histogram: object expected"); + message.histogram = {}; + for (var keys = Object.keys(object.histogram), i = 0; i < keys.length; ++i) + if ($util.Long) + (message.histogram[keys[i]] = $util.Long.fromValue(object.histogram[keys[i]])).unsigned = false; + else if (typeof object.histogram[keys[i]] === "string") + message.histogram[keys[i]] = parseInt(object.histogram[keys[i]], 10); + else if (typeof object.histogram[keys[i]] === "number") + message.histogram[keys[i]] = object.histogram[keys[i]]; + else if (typeof object.histogram[keys[i]] === "object") + message.histogram[keys[i]] = new $util.LongBits(object.histogram[keys[i]].low >>> 0, object.histogram[keys[i]].high >>> 0).toNumber(); + } + return message; + }; + + /** + * Creates a plain object from a HistogramQueryResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.HistogramQueryResult + * @static + * @param {google.cloud.talent.v4.HistogramQueryResult} message HistogramQueryResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HistogramQueryResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.histogram = {}; + if (options.defaults) + object.histogramQuery = ""; + if (message.histogramQuery != null && message.hasOwnProperty("histogramQuery")) + object.histogramQuery = message.histogramQuery; + var keys2; + if (message.histogram && (keys2 = Object.keys(message.histogram)).length) { + object.histogram = {}; + for (var j = 0; j < keys2.length; ++j) + if (typeof message.histogram[keys2[j]] === "number") + object.histogram[keys2[j]] = options.longs === String ? String(message.histogram[keys2[j]]) : message.histogram[keys2[j]]; + else + object.histogram[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.histogram[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.histogram[keys2[j]].low >>> 0, message.histogram[keys2[j]].high >>> 0).toNumber() : message.histogram[keys2[j]]; + } + return object; + }; + + /** + * Converts this HistogramQueryResult to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.HistogramQueryResult + * @instance + * @returns {Object.} JSON object + */ + HistogramQueryResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HistogramQueryResult + * @function getTypeUrl + * @memberof google.cloud.talent.v4.HistogramQueryResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HistogramQueryResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.HistogramQueryResult"; + }; + + return HistogramQueryResult; + })(); + + v4.Job = (function() { + + /** + * Properties of a Job. + * @memberof google.cloud.talent.v4 + * @interface IJob + * @property {string|null} [name] Job name + * @property {string|null} [company] Job company + * @property {string|null} [requisitionId] Job requisitionId + * @property {string|null} [title] Job title + * @property {string|null} [description] Job description + * @property {Array.|null} [addresses] Job addresses + * @property {google.cloud.talent.v4.Job.IApplicationInfo|null} [applicationInfo] Job applicationInfo + * @property {Array.|null} [jobBenefits] Job jobBenefits + * @property {google.cloud.talent.v4.ICompensationInfo|null} [compensationInfo] Job compensationInfo + * @property {Object.|null} [customAttributes] Job customAttributes + * @property {Array.|null} [degreeTypes] Job degreeTypes + * @property {string|null} [department] Job department + * @property {Array.|null} [employmentTypes] Job employmentTypes + * @property {string|null} [incentives] Job incentives + * @property {string|null} [languageCode] Job languageCode + * @property {google.cloud.talent.v4.JobLevel|null} [jobLevel] Job jobLevel + * @property {number|null} [promotionValue] Job promotionValue + * @property {string|null} [qualifications] Job qualifications + * @property {string|null} [responsibilities] Job responsibilities + * @property {google.cloud.talent.v4.PostingRegion|null} [postingRegion] Job postingRegion + * @property {google.cloud.talent.v4.Visibility|null} [visibility] Job visibility + * @property {google.protobuf.ITimestamp|null} [jobStartTime] Job jobStartTime + * @property {google.protobuf.ITimestamp|null} [jobEndTime] Job jobEndTime + * @property {google.protobuf.ITimestamp|null} [postingPublishTime] Job postingPublishTime + * @property {google.protobuf.ITimestamp|null} [postingExpireTime] Job postingExpireTime + * @property {google.protobuf.ITimestamp|null} [postingCreateTime] Job postingCreateTime + * @property {google.protobuf.ITimestamp|null} [postingUpdateTime] Job postingUpdateTime + * @property {string|null} [companyDisplayName] Job companyDisplayName + * @property {google.cloud.talent.v4.Job.IDerivedInfo|null} [derivedInfo] Job derivedInfo + * @property {google.cloud.talent.v4.Job.IProcessingOptions|null} [processingOptions] Job processingOptions + */ + + /** + * Constructs a new Job. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a Job. + * @implements IJob + * @constructor + * @param {google.cloud.talent.v4.IJob=} [properties] Properties to set + */ + function Job(properties) { + this.addresses = []; + this.jobBenefits = []; + this.customAttributes = {}; + this.degreeTypes = []; + this.employmentTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Job name. + * @member {string} name + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.name = ""; + + /** + * Job company. + * @member {string} company + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.company = ""; + + /** + * Job requisitionId. + * @member {string} requisitionId + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.requisitionId = ""; + + /** + * Job title. + * @member {string} title + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.title = ""; + + /** + * Job description. + * @member {string} description + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.description = ""; + + /** + * Job addresses. + * @member {Array.} addresses + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.addresses = $util.emptyArray; + + /** + * Job applicationInfo. + * @member {google.cloud.talent.v4.Job.IApplicationInfo|null|undefined} applicationInfo + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.applicationInfo = null; + + /** + * Job jobBenefits. + * @member {Array.} jobBenefits + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.jobBenefits = $util.emptyArray; + + /** + * Job compensationInfo. + * @member {google.cloud.talent.v4.ICompensationInfo|null|undefined} compensationInfo + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.compensationInfo = null; + + /** + * Job customAttributes. + * @member {Object.} customAttributes + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.customAttributes = $util.emptyObject; + + /** + * Job degreeTypes. + * @member {Array.} degreeTypes + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.degreeTypes = $util.emptyArray; + + /** + * Job department. + * @member {string} department + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.department = ""; + + /** + * Job employmentTypes. + * @member {Array.} employmentTypes + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.employmentTypes = $util.emptyArray; + + /** + * Job incentives. + * @member {string} incentives + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.incentives = ""; + + /** + * Job languageCode. + * @member {string} languageCode + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.languageCode = ""; + + /** + * Job jobLevel. + * @member {google.cloud.talent.v4.JobLevel} jobLevel + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.jobLevel = 0; + + /** + * Job promotionValue. + * @member {number} promotionValue + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.promotionValue = 0; + + /** + * Job qualifications. + * @member {string} qualifications + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.qualifications = ""; + + /** + * Job responsibilities. + * @member {string} responsibilities + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.responsibilities = ""; + + /** + * Job postingRegion. + * @member {google.cloud.talent.v4.PostingRegion} postingRegion + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.postingRegion = 0; + + /** + * Job visibility. + * @member {google.cloud.talent.v4.Visibility} visibility + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.visibility = 0; + + /** + * Job jobStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} jobStartTime + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.jobStartTime = null; + + /** + * Job jobEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} jobEndTime + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.jobEndTime = null; + + /** + * Job postingPublishTime. + * @member {google.protobuf.ITimestamp|null|undefined} postingPublishTime + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.postingPublishTime = null; + + /** + * Job postingExpireTime. + * @member {google.protobuf.ITimestamp|null|undefined} postingExpireTime + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.postingExpireTime = null; + + /** + * Job postingCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} postingCreateTime + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.postingCreateTime = null; + + /** + * Job postingUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} postingUpdateTime + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.postingUpdateTime = null; + + /** + * Job companyDisplayName. + * @member {string} companyDisplayName + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.companyDisplayName = ""; + + /** + * Job derivedInfo. + * @member {google.cloud.talent.v4.Job.IDerivedInfo|null|undefined} derivedInfo + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.derivedInfo = null; + + /** + * Job processingOptions. + * @member {google.cloud.talent.v4.Job.IProcessingOptions|null|undefined} processingOptions + * @memberof google.cloud.talent.v4.Job + * @instance + */ + Job.prototype.processingOptions = null; + + /** + * Creates a new Job instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.Job + * @static + * @param {google.cloud.talent.v4.IJob=} [properties] Properties to set + * @returns {google.cloud.talent.v4.Job} Job instance + */ + Job.create = function create(properties) { + return new Job(properties); + }; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.talent.v4.Job.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.Job + * @static + * @param {google.cloud.talent.v4.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.company != null && Object.hasOwnProperty.call(message, "company")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.company); + if (message.requisitionId != null && Object.hasOwnProperty.call(message, "requisitionId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requisitionId); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.addresses != null && message.addresses.length) + for (var i = 0; i < message.addresses.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.addresses[i]); + if (message.applicationInfo != null && Object.hasOwnProperty.call(message, "applicationInfo")) + $root.google.cloud.talent.v4.Job.ApplicationInfo.encode(message.applicationInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.jobBenefits != null && message.jobBenefits.length) { + writer.uint32(/* id 8, wireType 2 =*/66).fork(); + for (var i = 0; i < message.jobBenefits.length; ++i) + writer.int32(message.jobBenefits[i]); + writer.ldelim(); + } + if (message.compensationInfo != null && Object.hasOwnProperty.call(message, "compensationInfo")) + $root.google.cloud.talent.v4.CompensationInfo.encode(message.compensationInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.customAttributes != null && Object.hasOwnProperty.call(message, "customAttributes")) + for (var keys = Object.keys(message.customAttributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.talent.v4.CustomAttribute.encode(message.customAttributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.degreeTypes != null && message.degreeTypes.length) { + writer.uint32(/* id 11, wireType 2 =*/90).fork(); + for (var i = 0; i < message.degreeTypes.length; ++i) + writer.int32(message.degreeTypes[i]); + writer.ldelim(); + } + if (message.department != null && Object.hasOwnProperty.call(message, "department")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.department); + if (message.employmentTypes != null && message.employmentTypes.length) { + writer.uint32(/* id 13, wireType 2 =*/106).fork(); + for (var i = 0; i < message.employmentTypes.length; ++i) + writer.int32(message.employmentTypes[i]); + writer.ldelim(); + } + if (message.incentives != null && Object.hasOwnProperty.call(message, "incentives")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.incentives); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.languageCode); + if (message.jobLevel != null && Object.hasOwnProperty.call(message, "jobLevel")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.jobLevel); + if (message.promotionValue != null && Object.hasOwnProperty.call(message, "promotionValue")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.promotionValue); + if (message.qualifications != null && Object.hasOwnProperty.call(message, "qualifications")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.qualifications); + if (message.responsibilities != null && Object.hasOwnProperty.call(message, "responsibilities")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.responsibilities); + if (message.postingRegion != null && Object.hasOwnProperty.call(message, "postingRegion")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.postingRegion); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.visibility); + if (message.jobStartTime != null && Object.hasOwnProperty.call(message, "jobStartTime")) + $root.google.protobuf.Timestamp.encode(message.jobStartTime, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.jobEndTime != null && Object.hasOwnProperty.call(message, "jobEndTime")) + $root.google.protobuf.Timestamp.encode(message.jobEndTime, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.postingPublishTime != null && Object.hasOwnProperty.call(message, "postingPublishTime")) + $root.google.protobuf.Timestamp.encode(message.postingPublishTime, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.postingExpireTime != null && Object.hasOwnProperty.call(message, "postingExpireTime")) + $root.google.protobuf.Timestamp.encode(message.postingExpireTime, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.postingCreateTime != null && Object.hasOwnProperty.call(message, "postingCreateTime")) + $root.google.protobuf.Timestamp.encode(message.postingCreateTime, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.postingUpdateTime != null && Object.hasOwnProperty.call(message, "postingUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.postingUpdateTime, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.companyDisplayName != null && Object.hasOwnProperty.call(message, "companyDisplayName")) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.companyDisplayName); + if (message.derivedInfo != null && Object.hasOwnProperty.call(message, "derivedInfo")) + $root.google.cloud.talent.v4.Job.DerivedInfo.encode(message.derivedInfo, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.processingOptions != null && Object.hasOwnProperty.call(message, "processingOptions")) + $root.google.cloud.talent.v4.Job.ProcessingOptions.encode(message.processingOptions, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.talent.v4.Job.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.Job + * @static + * @param {google.cloud.talent.v4.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Job message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.Job(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.company = reader.string(); + break; + } + case 3: { + message.requisitionId = reader.string(); + break; + } + case 4: { + message.title = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + if (!(message.addresses && message.addresses.length)) + message.addresses = []; + message.addresses.push(reader.string()); + break; + } + case 7: { + message.applicationInfo = $root.google.cloud.talent.v4.Job.ApplicationInfo.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.jobBenefits && message.jobBenefits.length)) + message.jobBenefits = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.jobBenefits.push(reader.int32()); + } else + message.jobBenefits.push(reader.int32()); + break; + } + case 9: { + message.compensationInfo = $root.google.cloud.talent.v4.CompensationInfo.decode(reader, reader.uint32()); + break; + } + case 10: { + if (message.customAttributes === $util.emptyObject) + message.customAttributes = {}; + 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.talent.v4.CustomAttribute.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.customAttributes[key] = value; + break; + } + case 11: { + if (!(message.degreeTypes && message.degreeTypes.length)) + message.degreeTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.degreeTypes.push(reader.int32()); + } else + message.degreeTypes.push(reader.int32()); + break; + } + case 12: { + message.department = reader.string(); + break; + } + case 13: { + if (!(message.employmentTypes && message.employmentTypes.length)) + message.employmentTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.employmentTypes.push(reader.int32()); + } else + message.employmentTypes.push(reader.int32()); + break; + } + case 14: { + message.incentives = reader.string(); + break; + } + case 15: { + message.languageCode = reader.string(); + break; + } + case 16: { + message.jobLevel = reader.int32(); + break; + } + case 17: { + message.promotionValue = reader.int32(); + break; + } + case 18: { + message.qualifications = reader.string(); + break; + } + case 19: { + message.responsibilities = reader.string(); + break; + } + case 20: { + message.postingRegion = reader.int32(); + break; + } + case 21: { + message.visibility = reader.int32(); + break; + } + case 22: { + message.jobStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 23: { + message.jobEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 24: { + message.postingPublishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 25: { + message.postingExpireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 26: { + message.postingCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 27: { + message.postingUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 28: { + message.companyDisplayName = reader.string(); + break; + } + case 29: { + message.derivedInfo = $root.google.cloud.talent.v4.Job.DerivedInfo.decode(reader, reader.uint32()); + break; + } + case 30: { + message.processingOptions = $root.google.cloud.talent.v4.Job.ProcessingOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Job message. + * @function verify + * @memberof google.cloud.talent.v4.Job + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Job.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.company != null && message.hasOwnProperty("company")) + if (!$util.isString(message.company)) + return "company: string expected"; + if (message.requisitionId != null && message.hasOwnProperty("requisitionId")) + if (!$util.isString(message.requisitionId)) + return "requisitionId: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.addresses != null && message.hasOwnProperty("addresses")) { + if (!Array.isArray(message.addresses)) + return "addresses: array expected"; + for (var i = 0; i < message.addresses.length; ++i) + if (!$util.isString(message.addresses[i])) + return "addresses: string[] expected"; + } + if (message.applicationInfo != null && message.hasOwnProperty("applicationInfo")) { + var error = $root.google.cloud.talent.v4.Job.ApplicationInfo.verify(message.applicationInfo); + if (error) + return "applicationInfo." + error; + } + if (message.jobBenefits != null && message.hasOwnProperty("jobBenefits")) { + if (!Array.isArray(message.jobBenefits)) + return "jobBenefits: array expected"; + for (var i = 0; i < message.jobBenefits.length; ++i) + switch (message.jobBenefits[i]) { + default: + return "jobBenefits: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + break; + } + } + if (message.compensationInfo != null && message.hasOwnProperty("compensationInfo")) { + var error = $root.google.cloud.talent.v4.CompensationInfo.verify(message.compensationInfo); + if (error) + return "compensationInfo." + error; + } + if (message.customAttributes != null && message.hasOwnProperty("customAttributes")) { + if (!$util.isObject(message.customAttributes)) + return "customAttributes: object expected"; + var key = Object.keys(message.customAttributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.talent.v4.CustomAttribute.verify(message.customAttributes[key[i]]); + if (error) + return "customAttributes." + error; + } + } + if (message.degreeTypes != null && message.hasOwnProperty("degreeTypes")) { + if (!Array.isArray(message.degreeTypes)) + return "degreeTypes: array expected"; + for (var i = 0; i < message.degreeTypes.length; ++i) + switch (message.degreeTypes[i]) { + default: + return "degreeTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message.department != null && message.hasOwnProperty("department")) + if (!$util.isString(message.department)) + return "department: string expected"; + if (message.employmentTypes != null && message.hasOwnProperty("employmentTypes")) { + if (!Array.isArray(message.employmentTypes)) + return "employmentTypes: array expected"; + for (var i = 0; i < message.employmentTypes.length; ++i) + switch (message.employmentTypes[i]) { + default: + return "employmentTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + } + } + if (message.incentives != null && message.hasOwnProperty("incentives")) + if (!$util.isString(message.incentives)) + return "incentives: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.jobLevel != null && message.hasOwnProperty("jobLevel")) + switch (message.jobLevel) { + default: + return "jobLevel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.promotionValue != null && message.hasOwnProperty("promotionValue")) + if (!$util.isInteger(message.promotionValue)) + return "promotionValue: integer expected"; + if (message.qualifications != null && message.hasOwnProperty("qualifications")) + if (!$util.isString(message.qualifications)) + return "qualifications: string expected"; + if (message.responsibilities != null && message.hasOwnProperty("responsibilities")) + if (!$util.isString(message.responsibilities)) + return "responsibilities: string expected"; + if (message.postingRegion != null && message.hasOwnProperty("postingRegion")) + switch (message.postingRegion) { + default: + return "postingRegion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.jobStartTime != null && message.hasOwnProperty("jobStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.jobStartTime); + if (error) + return "jobStartTime." + error; + } + if (message.jobEndTime != null && message.hasOwnProperty("jobEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.jobEndTime); + if (error) + return "jobEndTime." + error; + } + if (message.postingPublishTime != null && message.hasOwnProperty("postingPublishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.postingPublishTime); + if (error) + return "postingPublishTime." + error; + } + if (message.postingExpireTime != null && message.hasOwnProperty("postingExpireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.postingExpireTime); + if (error) + return "postingExpireTime." + error; + } + if (message.postingCreateTime != null && message.hasOwnProperty("postingCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.postingCreateTime); + if (error) + return "postingCreateTime." + error; + } + if (message.postingUpdateTime != null && message.hasOwnProperty("postingUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.postingUpdateTime); + if (error) + return "postingUpdateTime." + error; + } + if (message.companyDisplayName != null && message.hasOwnProperty("companyDisplayName")) + if (!$util.isString(message.companyDisplayName)) + return "companyDisplayName: string expected"; + if (message.derivedInfo != null && message.hasOwnProperty("derivedInfo")) { + var error = $root.google.cloud.talent.v4.Job.DerivedInfo.verify(message.derivedInfo); + if (error) + return "derivedInfo." + error; + } + if (message.processingOptions != null && message.hasOwnProperty("processingOptions")) { + var error = $root.google.cloud.talent.v4.Job.ProcessingOptions.verify(message.processingOptions); + if (error) + return "processingOptions." + error; + } + return null; + }; + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.Job + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.Job} Job + */ + Job.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.Job) + return object; + var message = new $root.google.cloud.talent.v4.Job(); + if (object.name != null) + message.name = String(object.name); + if (object.company != null) + message.company = String(object.company); + if (object.requisitionId != null) + message.requisitionId = String(object.requisitionId); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.addresses) { + if (!Array.isArray(object.addresses)) + throw TypeError(".google.cloud.talent.v4.Job.addresses: array expected"); + message.addresses = []; + for (var i = 0; i < object.addresses.length; ++i) + message.addresses[i] = String(object.addresses[i]); + } + if (object.applicationInfo != null) { + if (typeof object.applicationInfo !== "object") + throw TypeError(".google.cloud.talent.v4.Job.applicationInfo: object expected"); + message.applicationInfo = $root.google.cloud.talent.v4.Job.ApplicationInfo.fromObject(object.applicationInfo); + } + if (object.jobBenefits) { + if (!Array.isArray(object.jobBenefits)) + throw TypeError(".google.cloud.talent.v4.Job.jobBenefits: array expected"); + message.jobBenefits = []; + for (var i = 0; i < object.jobBenefits.length; ++i) + switch (object.jobBenefits[i]) { + default: + if (typeof object.jobBenefits[i] === "number") { + message.jobBenefits[i] = object.jobBenefits[i]; + break; + } + case "JOB_BENEFIT_UNSPECIFIED": + case 0: + message.jobBenefits[i] = 0; + break; + case "CHILD_CARE": + case 1: + message.jobBenefits[i] = 1; + break; + case "DENTAL": + case 2: + message.jobBenefits[i] = 2; + break; + case "DOMESTIC_PARTNER": + case 3: + message.jobBenefits[i] = 3; + break; + case "FLEXIBLE_HOURS": + case 4: + message.jobBenefits[i] = 4; + break; + case "MEDICAL": + case 5: + message.jobBenefits[i] = 5; + break; + case "LIFE_INSURANCE": + case 6: + message.jobBenefits[i] = 6; + break; + case "PARENTAL_LEAVE": + case 7: + message.jobBenefits[i] = 7; + break; + case "RETIREMENT_PLAN": + case 8: + message.jobBenefits[i] = 8; + break; + case "SICK_DAYS": + case 9: + message.jobBenefits[i] = 9; + break; + case "VACATION": + case 10: + message.jobBenefits[i] = 10; + break; + case "VISION": + case 11: + message.jobBenefits[i] = 11; + break; + } + } + if (object.compensationInfo != null) { + if (typeof object.compensationInfo !== "object") + throw TypeError(".google.cloud.talent.v4.Job.compensationInfo: object expected"); + message.compensationInfo = $root.google.cloud.talent.v4.CompensationInfo.fromObject(object.compensationInfo); + } + if (object.customAttributes) { + if (typeof object.customAttributes !== "object") + throw TypeError(".google.cloud.talent.v4.Job.customAttributes: object expected"); + message.customAttributes = {}; + for (var keys = Object.keys(object.customAttributes), i = 0; i < keys.length; ++i) { + if (typeof object.customAttributes[keys[i]] !== "object") + throw TypeError(".google.cloud.talent.v4.Job.customAttributes: object expected"); + message.customAttributes[keys[i]] = $root.google.cloud.talent.v4.CustomAttribute.fromObject(object.customAttributes[keys[i]]); + } + } + if (object.degreeTypes) { + if (!Array.isArray(object.degreeTypes)) + throw TypeError(".google.cloud.talent.v4.Job.degreeTypes: array expected"); + message.degreeTypes = []; + for (var i = 0; i < object.degreeTypes.length; ++i) + switch (object.degreeTypes[i]) { + default: + if (typeof object.degreeTypes[i] === "number") { + message.degreeTypes[i] = object.degreeTypes[i]; + break; + } + case "DEGREE_TYPE_UNSPECIFIED": + case 0: + message.degreeTypes[i] = 0; + break; + case "PRIMARY_EDUCATION": + case 1: + message.degreeTypes[i] = 1; + break; + case "LOWER_SECONDARY_EDUCATION": + case 2: + message.degreeTypes[i] = 2; + break; + case "UPPER_SECONDARY_EDUCATION": + case 3: + message.degreeTypes[i] = 3; + break; + case "ADULT_REMEDIAL_EDUCATION": + case 4: + message.degreeTypes[i] = 4; + break; + case "ASSOCIATES_OR_EQUIVALENT": + case 5: + message.degreeTypes[i] = 5; + break; + case "BACHELORS_OR_EQUIVALENT": + case 6: + message.degreeTypes[i] = 6; + break; + case "MASTERS_OR_EQUIVALENT": + case 7: + message.degreeTypes[i] = 7; + break; + case "DOCTORAL_OR_EQUIVALENT": + case 8: + message.degreeTypes[i] = 8; + break; + } + } + if (object.department != null) + message.department = String(object.department); + if (object.employmentTypes) { + if (!Array.isArray(object.employmentTypes)) + throw TypeError(".google.cloud.talent.v4.Job.employmentTypes: array expected"); + message.employmentTypes = []; + for (var i = 0; i < object.employmentTypes.length; ++i) + switch (object.employmentTypes[i]) { + default: + if (typeof object.employmentTypes[i] === "number") { + message.employmentTypes[i] = object.employmentTypes[i]; + break; + } + case "EMPLOYMENT_TYPE_UNSPECIFIED": + case 0: + message.employmentTypes[i] = 0; + break; + case "FULL_TIME": + case 1: + message.employmentTypes[i] = 1; + break; + case "PART_TIME": + case 2: + message.employmentTypes[i] = 2; + break; + case "CONTRACTOR": + case 3: + message.employmentTypes[i] = 3; + break; + case "CONTRACT_TO_HIRE": + case 4: + message.employmentTypes[i] = 4; + break; + case "TEMPORARY": + case 5: + message.employmentTypes[i] = 5; + break; + case "INTERN": + case 6: + message.employmentTypes[i] = 6; + break; + case "VOLUNTEER": + case 7: + message.employmentTypes[i] = 7; + break; + case "PER_DIEM": + case 8: + message.employmentTypes[i] = 8; + break; + case "FLY_IN_FLY_OUT": + case 9: + message.employmentTypes[i] = 9; + break; + case "OTHER_EMPLOYMENT_TYPE": + case 10: + message.employmentTypes[i] = 10; + break; + } + } + if (object.incentives != null) + message.incentives = String(object.incentives); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + switch (object.jobLevel) { + default: + if (typeof object.jobLevel === "number") { + message.jobLevel = object.jobLevel; + break; + } + break; + case "JOB_LEVEL_UNSPECIFIED": + case 0: + message.jobLevel = 0; + break; + case "ENTRY_LEVEL": + case 1: + message.jobLevel = 1; + break; + case "EXPERIENCED": + case 2: + message.jobLevel = 2; + break; + case "MANAGER": + case 3: + message.jobLevel = 3; + break; + case "DIRECTOR": + case 4: + message.jobLevel = 4; + break; + case "EXECUTIVE": + case 5: + message.jobLevel = 5; + break; + } + if (object.promotionValue != null) + message.promotionValue = object.promotionValue | 0; + if (object.qualifications != null) + message.qualifications = String(object.qualifications); + if (object.responsibilities != null) + message.responsibilities = String(object.responsibilities); + switch (object.postingRegion) { + default: + if (typeof object.postingRegion === "number") { + message.postingRegion = object.postingRegion; + break; + } + break; + case "POSTING_REGION_UNSPECIFIED": + case 0: + message.postingRegion = 0; + break; + case "ADMINISTRATIVE_AREA": + case 1: + message.postingRegion = 1; + break; + case "NATION": + case 2: + message.postingRegion = 2; + break; + case "TELECOMMUTE": + case 3: + message.postingRegion = 3; + break; + } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSPECIFIED": + case 0: + message.visibility = 0; + break; + case "ACCOUNT_ONLY": + case 1: + message.visibility = 1; + break; + case "SHARED_WITH_GOOGLE": + case 2: + message.visibility = 2; + break; + case "SHARED_WITH_PUBLIC": + case 3: + message.visibility = 3; + break; + } + if (object.jobStartTime != null) { + if (typeof object.jobStartTime !== "object") + throw TypeError(".google.cloud.talent.v4.Job.jobStartTime: object expected"); + message.jobStartTime = $root.google.protobuf.Timestamp.fromObject(object.jobStartTime); + } + if (object.jobEndTime != null) { + if (typeof object.jobEndTime !== "object") + throw TypeError(".google.cloud.talent.v4.Job.jobEndTime: object expected"); + message.jobEndTime = $root.google.protobuf.Timestamp.fromObject(object.jobEndTime); + } + if (object.postingPublishTime != null) { + if (typeof object.postingPublishTime !== "object") + throw TypeError(".google.cloud.talent.v4.Job.postingPublishTime: object expected"); + message.postingPublishTime = $root.google.protobuf.Timestamp.fromObject(object.postingPublishTime); + } + if (object.postingExpireTime != null) { + if (typeof object.postingExpireTime !== "object") + throw TypeError(".google.cloud.talent.v4.Job.postingExpireTime: object expected"); + message.postingExpireTime = $root.google.protobuf.Timestamp.fromObject(object.postingExpireTime); + } + if (object.postingCreateTime != null) { + if (typeof object.postingCreateTime !== "object") + throw TypeError(".google.cloud.talent.v4.Job.postingCreateTime: object expected"); + message.postingCreateTime = $root.google.protobuf.Timestamp.fromObject(object.postingCreateTime); + } + if (object.postingUpdateTime != null) { + if (typeof object.postingUpdateTime !== "object") + throw TypeError(".google.cloud.talent.v4.Job.postingUpdateTime: object expected"); + message.postingUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.postingUpdateTime); + } + if (object.companyDisplayName != null) + message.companyDisplayName = String(object.companyDisplayName); + if (object.derivedInfo != null) { + if (typeof object.derivedInfo !== "object") + throw TypeError(".google.cloud.talent.v4.Job.derivedInfo: object expected"); + message.derivedInfo = $root.google.cloud.talent.v4.Job.DerivedInfo.fromObject(object.derivedInfo); + } + if (object.processingOptions != null) { + if (typeof object.processingOptions !== "object") + throw TypeError(".google.cloud.talent.v4.Job.processingOptions: object expected"); + message.processingOptions = $root.google.cloud.talent.v4.Job.ProcessingOptions.fromObject(object.processingOptions); + } + return message; + }; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.Job + * @static + * @param {google.cloud.talent.v4.Job} message Job + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Job.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.addresses = []; + object.jobBenefits = []; + object.degreeTypes = []; + object.employmentTypes = []; + } + if (options.objects || options.defaults) + object.customAttributes = {}; + if (options.defaults) { + object.name = ""; + object.company = ""; + object.requisitionId = ""; + object.title = ""; + object.description = ""; + object.applicationInfo = null; + object.compensationInfo = null; + object.department = ""; + object.incentives = ""; + object.languageCode = ""; + object.jobLevel = options.enums === String ? "JOB_LEVEL_UNSPECIFIED" : 0; + object.promotionValue = 0; + object.qualifications = ""; + object.responsibilities = ""; + object.postingRegion = options.enums === String ? "POSTING_REGION_UNSPECIFIED" : 0; + object.visibility = options.enums === String ? "VISIBILITY_UNSPECIFIED" : 0; + object.jobStartTime = null; + object.jobEndTime = null; + object.postingPublishTime = null; + object.postingExpireTime = null; + object.postingCreateTime = null; + object.postingUpdateTime = null; + object.companyDisplayName = ""; + object.derivedInfo = null; + object.processingOptions = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.company != null && message.hasOwnProperty("company")) + object.company = message.company; + if (message.requisitionId != null && message.hasOwnProperty("requisitionId")) + object.requisitionId = message.requisitionId; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.addresses && message.addresses.length) { + object.addresses = []; + for (var j = 0; j < message.addresses.length; ++j) + object.addresses[j] = message.addresses[j]; + } + if (message.applicationInfo != null && message.hasOwnProperty("applicationInfo")) + object.applicationInfo = $root.google.cloud.talent.v4.Job.ApplicationInfo.toObject(message.applicationInfo, options); + if (message.jobBenefits && message.jobBenefits.length) { + object.jobBenefits = []; + for (var j = 0; j < message.jobBenefits.length; ++j) + object.jobBenefits[j] = options.enums === String ? $root.google.cloud.talent.v4.JobBenefit[message.jobBenefits[j]] === undefined ? message.jobBenefits[j] : $root.google.cloud.talent.v4.JobBenefit[message.jobBenefits[j]] : message.jobBenefits[j]; + } + if (message.compensationInfo != null && message.hasOwnProperty("compensationInfo")) + object.compensationInfo = $root.google.cloud.talent.v4.CompensationInfo.toObject(message.compensationInfo, options); + var keys2; + if (message.customAttributes && (keys2 = Object.keys(message.customAttributes)).length) { + object.customAttributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.customAttributes[keys2[j]] = $root.google.cloud.talent.v4.CustomAttribute.toObject(message.customAttributes[keys2[j]], options); + } + if (message.degreeTypes && message.degreeTypes.length) { + object.degreeTypes = []; + for (var j = 0; j < message.degreeTypes.length; ++j) + object.degreeTypes[j] = options.enums === String ? $root.google.cloud.talent.v4.DegreeType[message.degreeTypes[j]] === undefined ? message.degreeTypes[j] : $root.google.cloud.talent.v4.DegreeType[message.degreeTypes[j]] : message.degreeTypes[j]; + } + if (message.department != null && message.hasOwnProperty("department")) + object.department = message.department; + if (message.employmentTypes && message.employmentTypes.length) { + object.employmentTypes = []; + for (var j = 0; j < message.employmentTypes.length; ++j) + object.employmentTypes[j] = options.enums === String ? $root.google.cloud.talent.v4.EmploymentType[message.employmentTypes[j]] === undefined ? message.employmentTypes[j] : $root.google.cloud.talent.v4.EmploymentType[message.employmentTypes[j]] : message.employmentTypes[j]; + } + if (message.incentives != null && message.hasOwnProperty("incentives")) + object.incentives = message.incentives; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.jobLevel != null && message.hasOwnProperty("jobLevel")) + object.jobLevel = options.enums === String ? $root.google.cloud.talent.v4.JobLevel[message.jobLevel] === undefined ? message.jobLevel : $root.google.cloud.talent.v4.JobLevel[message.jobLevel] : message.jobLevel; + if (message.promotionValue != null && message.hasOwnProperty("promotionValue")) + object.promotionValue = message.promotionValue; + if (message.qualifications != null && message.hasOwnProperty("qualifications")) + object.qualifications = message.qualifications; + if (message.responsibilities != null && message.hasOwnProperty("responsibilities")) + object.responsibilities = message.responsibilities; + if (message.postingRegion != null && message.hasOwnProperty("postingRegion")) + object.postingRegion = options.enums === String ? $root.google.cloud.talent.v4.PostingRegion[message.postingRegion] === undefined ? message.postingRegion : $root.google.cloud.talent.v4.PostingRegion[message.postingRegion] : message.postingRegion; + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.cloud.talent.v4.Visibility[message.visibility] === undefined ? message.visibility : $root.google.cloud.talent.v4.Visibility[message.visibility] : message.visibility; + if (message.jobStartTime != null && message.hasOwnProperty("jobStartTime")) + object.jobStartTime = $root.google.protobuf.Timestamp.toObject(message.jobStartTime, options); + if (message.jobEndTime != null && message.hasOwnProperty("jobEndTime")) + object.jobEndTime = $root.google.protobuf.Timestamp.toObject(message.jobEndTime, options); + if (message.postingPublishTime != null && message.hasOwnProperty("postingPublishTime")) + object.postingPublishTime = $root.google.protobuf.Timestamp.toObject(message.postingPublishTime, options); + if (message.postingExpireTime != null && message.hasOwnProperty("postingExpireTime")) + object.postingExpireTime = $root.google.protobuf.Timestamp.toObject(message.postingExpireTime, options); + if (message.postingCreateTime != null && message.hasOwnProperty("postingCreateTime")) + object.postingCreateTime = $root.google.protobuf.Timestamp.toObject(message.postingCreateTime, options); + if (message.postingUpdateTime != null && message.hasOwnProperty("postingUpdateTime")) + object.postingUpdateTime = $root.google.protobuf.Timestamp.toObject(message.postingUpdateTime, options); + if (message.companyDisplayName != null && message.hasOwnProperty("companyDisplayName")) + object.companyDisplayName = message.companyDisplayName; + if (message.derivedInfo != null && message.hasOwnProperty("derivedInfo")) + object.derivedInfo = $root.google.cloud.talent.v4.Job.DerivedInfo.toObject(message.derivedInfo, options); + if (message.processingOptions != null && message.hasOwnProperty("processingOptions")) + object.processingOptions = $root.google.cloud.talent.v4.Job.ProcessingOptions.toObject(message.processingOptions, options); + return object; + }; + + /** + * Converts this Job to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.Job + * @instance + * @returns {Object.} JSON object + */ + Job.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Job + * @function getTypeUrl + * @memberof google.cloud.talent.v4.Job + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.Job"; + }; + + Job.ApplicationInfo = (function() { + + /** + * Properties of an ApplicationInfo. + * @memberof google.cloud.talent.v4.Job + * @interface IApplicationInfo + * @property {Array.|null} [emails] ApplicationInfo emails + * @property {string|null} [instruction] ApplicationInfo instruction + * @property {Array.|null} [uris] ApplicationInfo uris + */ + + /** + * Constructs a new ApplicationInfo. + * @memberof google.cloud.talent.v4.Job + * @classdesc Represents an ApplicationInfo. + * @implements IApplicationInfo + * @constructor + * @param {google.cloud.talent.v4.Job.IApplicationInfo=} [properties] Properties to set + */ + function ApplicationInfo(properties) { + this.emails = []; + this.uris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApplicationInfo emails. + * @member {Array.} emails + * @memberof google.cloud.talent.v4.Job.ApplicationInfo + * @instance + */ + ApplicationInfo.prototype.emails = $util.emptyArray; + + /** + * ApplicationInfo instruction. + * @member {string} instruction + * @memberof google.cloud.talent.v4.Job.ApplicationInfo + * @instance + */ + ApplicationInfo.prototype.instruction = ""; + + /** + * ApplicationInfo uris. + * @member {Array.} uris + * @memberof google.cloud.talent.v4.Job.ApplicationInfo + * @instance + */ + ApplicationInfo.prototype.uris = $util.emptyArray; + + /** + * Creates a new ApplicationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.Job.ApplicationInfo + * @static + * @param {google.cloud.talent.v4.Job.IApplicationInfo=} [properties] Properties to set + * @returns {google.cloud.talent.v4.Job.ApplicationInfo} ApplicationInfo instance + */ + ApplicationInfo.create = function create(properties) { + return new ApplicationInfo(properties); + }; + + /** + * Encodes the specified ApplicationInfo message. Does not implicitly {@link google.cloud.talent.v4.Job.ApplicationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.Job.ApplicationInfo + * @static + * @param {google.cloud.talent.v4.Job.IApplicationInfo} message ApplicationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplicationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.emails != null && message.emails.length) + for (var i = 0; i < message.emails.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.emails[i]); + if (message.instruction != null && Object.hasOwnProperty.call(message, "instruction")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instruction); + if (message.uris != null && message.uris.length) + for (var i = 0; i < message.uris.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uris[i]); + return writer; + }; + + /** + * Encodes the specified ApplicationInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4.Job.ApplicationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.Job.ApplicationInfo + * @static + * @param {google.cloud.talent.v4.Job.IApplicationInfo} message ApplicationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplicationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApplicationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.Job.ApplicationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.Job.ApplicationInfo} ApplicationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplicationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.Job.ApplicationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.emails && message.emails.length)) + message.emails = []; + message.emails.push(reader.string()); + break; + } + case 2: { + message.instruction = reader.string(); + break; + } + case 3: { + if (!(message.uris && message.uris.length)) + message.uris = []; + message.uris.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApplicationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.Job.ApplicationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.Job.ApplicationInfo} ApplicationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplicationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApplicationInfo message. + * @function verify + * @memberof google.cloud.talent.v4.Job.ApplicationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApplicationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.emails != null && message.hasOwnProperty("emails")) { + if (!Array.isArray(message.emails)) + return "emails: array expected"; + for (var i = 0; i < message.emails.length; ++i) + if (!$util.isString(message.emails[i])) + return "emails: string[] expected"; + } + if (message.instruction != null && message.hasOwnProperty("instruction")) + if (!$util.isString(message.instruction)) + return "instruction: string expected"; + if (message.uris != null && message.hasOwnProperty("uris")) { + if (!Array.isArray(message.uris)) + return "uris: array expected"; + for (var i = 0; i < message.uris.length; ++i) + if (!$util.isString(message.uris[i])) + return "uris: string[] expected"; + } + return null; + }; + + /** + * Creates an ApplicationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.Job.ApplicationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.Job.ApplicationInfo} ApplicationInfo + */ + ApplicationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.Job.ApplicationInfo) + return object; + var message = new $root.google.cloud.talent.v4.Job.ApplicationInfo(); + if (object.emails) { + if (!Array.isArray(object.emails)) + throw TypeError(".google.cloud.talent.v4.Job.ApplicationInfo.emails: array expected"); + message.emails = []; + for (var i = 0; i < object.emails.length; ++i) + message.emails[i] = String(object.emails[i]); + } + if (object.instruction != null) + message.instruction = String(object.instruction); + if (object.uris) { + if (!Array.isArray(object.uris)) + throw TypeError(".google.cloud.talent.v4.Job.ApplicationInfo.uris: array expected"); + message.uris = []; + for (var i = 0; i < object.uris.length; ++i) + message.uris[i] = String(object.uris[i]); + } + return message; + }; + + /** + * Creates a plain object from an ApplicationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.Job.ApplicationInfo + * @static + * @param {google.cloud.talent.v4.Job.ApplicationInfo} message ApplicationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApplicationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.emails = []; + object.uris = []; + } + if (options.defaults) + object.instruction = ""; + if (message.emails && message.emails.length) { + object.emails = []; + for (var j = 0; j < message.emails.length; ++j) + object.emails[j] = message.emails[j]; + } + if (message.instruction != null && message.hasOwnProperty("instruction")) + object.instruction = message.instruction; + if (message.uris && message.uris.length) { + object.uris = []; + for (var j = 0; j < message.uris.length; ++j) + object.uris[j] = message.uris[j]; + } + return object; + }; + + /** + * Converts this ApplicationInfo to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.Job.ApplicationInfo + * @instance + * @returns {Object.} JSON object + */ + ApplicationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApplicationInfo + * @function getTypeUrl + * @memberof google.cloud.talent.v4.Job.ApplicationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApplicationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.Job.ApplicationInfo"; + }; + + return ApplicationInfo; + })(); + + Job.DerivedInfo = (function() { + + /** + * Properties of a DerivedInfo. + * @memberof google.cloud.talent.v4.Job + * @interface IDerivedInfo + * @property {Array.|null} [locations] DerivedInfo locations + * @property {Array.|null} [jobCategories] DerivedInfo jobCategories + */ + + /** + * Constructs a new DerivedInfo. + * @memberof google.cloud.talent.v4.Job + * @classdesc Represents a DerivedInfo. + * @implements IDerivedInfo + * @constructor + * @param {google.cloud.talent.v4.Job.IDerivedInfo=} [properties] Properties to set + */ + function DerivedInfo(properties) { + this.locations = []; + this.jobCategories = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DerivedInfo locations. + * @member {Array.} locations + * @memberof google.cloud.talent.v4.Job.DerivedInfo + * @instance + */ + DerivedInfo.prototype.locations = $util.emptyArray; + + /** + * DerivedInfo jobCategories. + * @member {Array.} jobCategories + * @memberof google.cloud.talent.v4.Job.DerivedInfo + * @instance + */ + DerivedInfo.prototype.jobCategories = $util.emptyArray; + + /** + * Creates a new DerivedInfo instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.Job.DerivedInfo + * @static + * @param {google.cloud.talent.v4.Job.IDerivedInfo=} [properties] Properties to set + * @returns {google.cloud.talent.v4.Job.DerivedInfo} DerivedInfo instance + */ + DerivedInfo.create = function create(properties) { + return new DerivedInfo(properties); + }; + + /** + * Encodes the specified DerivedInfo message. Does not implicitly {@link google.cloud.talent.v4.Job.DerivedInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.Job.DerivedInfo + * @static + * @param {google.cloud.talent.v4.Job.IDerivedInfo} message DerivedInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DerivedInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.locations != null && message.locations.length) + for (var i = 0; i < message.locations.length; ++i) + $root.google.cloud.talent.v4.Location.encode(message.locations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.jobCategories != null && message.jobCategories.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.jobCategories.length; ++i) + writer.int32(message.jobCategories[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified DerivedInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4.Job.DerivedInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.Job.DerivedInfo + * @static + * @param {google.cloud.talent.v4.Job.IDerivedInfo} message DerivedInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DerivedInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DerivedInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.Job.DerivedInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.Job.DerivedInfo} DerivedInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DerivedInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.Job.DerivedInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.locations && message.locations.length)) + message.locations = []; + message.locations.push($root.google.cloud.talent.v4.Location.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.jobCategories && message.jobCategories.length)) + message.jobCategories = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.jobCategories.push(reader.int32()); + } else + message.jobCategories.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DerivedInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.Job.DerivedInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.Job.DerivedInfo} DerivedInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DerivedInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DerivedInfo message. + * @function verify + * @memberof google.cloud.talent.v4.Job.DerivedInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DerivedInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.locations != null && message.hasOwnProperty("locations")) { + if (!Array.isArray(message.locations)) + return "locations: array expected"; + for (var i = 0; i < message.locations.length; ++i) { + var error = $root.google.cloud.talent.v4.Location.verify(message.locations[i]); + if (error) + return "locations." + error; + } + } + if (message.jobCategories != null && message.hasOwnProperty("jobCategories")) { + if (!Array.isArray(message.jobCategories)) + return "jobCategories: array expected"; + for (var i = 0; i < message.jobCategories.length; ++i) + switch (message.jobCategories[i]) { + default: + return "jobCategories: enum value[] expected"; + case 0: + 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: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + break; + } + } + return null; + }; + + /** + * Creates a DerivedInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.Job.DerivedInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.Job.DerivedInfo} DerivedInfo + */ + DerivedInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.Job.DerivedInfo) + return object; + var message = new $root.google.cloud.talent.v4.Job.DerivedInfo(); + if (object.locations) { + if (!Array.isArray(object.locations)) + throw TypeError(".google.cloud.talent.v4.Job.DerivedInfo.locations: array expected"); + message.locations = []; + for (var i = 0; i < object.locations.length; ++i) { + if (typeof object.locations[i] !== "object") + throw TypeError(".google.cloud.talent.v4.Job.DerivedInfo.locations: object expected"); + message.locations[i] = $root.google.cloud.talent.v4.Location.fromObject(object.locations[i]); + } + } + if (object.jobCategories) { + if (!Array.isArray(object.jobCategories)) + throw TypeError(".google.cloud.talent.v4.Job.DerivedInfo.jobCategories: array expected"); + message.jobCategories = []; + for (var i = 0; i < object.jobCategories.length; ++i) + switch (object.jobCategories[i]) { + default: + if (typeof object.jobCategories[i] === "number") { + message.jobCategories[i] = object.jobCategories[i]; + break; + } + case "JOB_CATEGORY_UNSPECIFIED": + case 0: + message.jobCategories[i] = 0; + break; + case "ACCOUNTING_AND_FINANCE": + case 1: + message.jobCategories[i] = 1; + break; + case "ADMINISTRATIVE_AND_OFFICE": + case 2: + message.jobCategories[i] = 2; + break; + case "ADVERTISING_AND_MARKETING": + case 3: + message.jobCategories[i] = 3; + break; + case "ANIMAL_CARE": + case 4: + message.jobCategories[i] = 4; + break; + case "ART_FASHION_AND_DESIGN": + case 5: + message.jobCategories[i] = 5; + break; + case "BUSINESS_OPERATIONS": + case 6: + message.jobCategories[i] = 6; + break; + case "CLEANING_AND_FACILITIES": + case 7: + message.jobCategories[i] = 7; + break; + case "COMPUTER_AND_IT": + case 8: + message.jobCategories[i] = 8; + break; + case "CONSTRUCTION": + case 9: + message.jobCategories[i] = 9; + break; + case "CUSTOMER_SERVICE": + case 10: + message.jobCategories[i] = 10; + break; + case "EDUCATION": + case 11: + message.jobCategories[i] = 11; + break; + case "ENTERTAINMENT_AND_TRAVEL": + case 12: + message.jobCategories[i] = 12; + break; + case "FARMING_AND_OUTDOORS": + case 13: + message.jobCategories[i] = 13; + break; + case "HEALTHCARE": + case 14: + message.jobCategories[i] = 14; + break; + case "HUMAN_RESOURCES": + case 15: + message.jobCategories[i] = 15; + break; + case "INSTALLATION_MAINTENANCE_AND_REPAIR": + case 16: + message.jobCategories[i] = 16; + break; + case "LEGAL": + case 17: + message.jobCategories[i] = 17; + break; + case "MANAGEMENT": + case 18: + message.jobCategories[i] = 18; + break; + case "MANUFACTURING_AND_WAREHOUSE": + case 19: + message.jobCategories[i] = 19; + break; + case "MEDIA_COMMUNICATIONS_AND_WRITING": + case 20: + message.jobCategories[i] = 20; + break; + case "OIL_GAS_AND_MINING": + case 21: + message.jobCategories[i] = 21; + break; + case "PERSONAL_CARE_AND_SERVICES": + case 22: + message.jobCategories[i] = 22; + break; + case "PROTECTIVE_SERVICES": + case 23: + message.jobCategories[i] = 23; + break; + case "REAL_ESTATE": + case 24: + message.jobCategories[i] = 24; + break; + case "RESTAURANT_AND_HOSPITALITY": + case 25: + message.jobCategories[i] = 25; + break; + case "SALES_AND_RETAIL": + case 26: + message.jobCategories[i] = 26; + break; + case "SCIENCE_AND_ENGINEERING": + case 27: + message.jobCategories[i] = 27; + break; + case "SOCIAL_SERVICES_AND_NON_PROFIT": + case 28: + message.jobCategories[i] = 28; + break; + case "SPORTS_FITNESS_AND_RECREATION": + case 29: + message.jobCategories[i] = 29; + break; + case "TRANSPORTATION_AND_LOGISTICS": + case 30: + message.jobCategories[i] = 30; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a DerivedInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.Job.DerivedInfo + * @static + * @param {google.cloud.talent.v4.Job.DerivedInfo} message DerivedInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DerivedInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.locations = []; + object.jobCategories = []; + } + if (message.locations && message.locations.length) { + object.locations = []; + for (var j = 0; j < message.locations.length; ++j) + object.locations[j] = $root.google.cloud.talent.v4.Location.toObject(message.locations[j], options); + } + if (message.jobCategories && message.jobCategories.length) { + object.jobCategories = []; + for (var j = 0; j < message.jobCategories.length; ++j) + object.jobCategories[j] = options.enums === String ? $root.google.cloud.talent.v4.JobCategory[message.jobCategories[j]] === undefined ? message.jobCategories[j] : $root.google.cloud.talent.v4.JobCategory[message.jobCategories[j]] : message.jobCategories[j]; + } + return object; + }; + + /** + * Converts this DerivedInfo to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.Job.DerivedInfo + * @instance + * @returns {Object.} JSON object + */ + DerivedInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DerivedInfo + * @function getTypeUrl + * @memberof google.cloud.talent.v4.Job.DerivedInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DerivedInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.Job.DerivedInfo"; + }; + + return DerivedInfo; + })(); + + Job.ProcessingOptions = (function() { + + /** + * Properties of a ProcessingOptions. + * @memberof google.cloud.talent.v4.Job + * @interface IProcessingOptions + * @property {boolean|null} [disableStreetAddressResolution] ProcessingOptions disableStreetAddressResolution + * @property {google.cloud.talent.v4.HtmlSanitization|null} [htmlSanitization] ProcessingOptions htmlSanitization + */ + + /** + * Constructs a new ProcessingOptions. + * @memberof google.cloud.talent.v4.Job + * @classdesc Represents a ProcessingOptions. + * @implements IProcessingOptions + * @constructor + * @param {google.cloud.talent.v4.Job.IProcessingOptions=} [properties] Properties to set + */ + function ProcessingOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProcessingOptions disableStreetAddressResolution. + * @member {boolean} disableStreetAddressResolution + * @memberof google.cloud.talent.v4.Job.ProcessingOptions + * @instance + */ + ProcessingOptions.prototype.disableStreetAddressResolution = false; + + /** + * ProcessingOptions htmlSanitization. + * @member {google.cloud.talent.v4.HtmlSanitization} htmlSanitization + * @memberof google.cloud.talent.v4.Job.ProcessingOptions + * @instance + */ + ProcessingOptions.prototype.htmlSanitization = 0; + + /** + * Creates a new ProcessingOptions instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.Job.ProcessingOptions + * @static + * @param {google.cloud.talent.v4.Job.IProcessingOptions=} [properties] Properties to set + * @returns {google.cloud.talent.v4.Job.ProcessingOptions} ProcessingOptions instance + */ + ProcessingOptions.create = function create(properties) { + return new ProcessingOptions(properties); + }; + + /** + * Encodes the specified ProcessingOptions message. Does not implicitly {@link google.cloud.talent.v4.Job.ProcessingOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.Job.ProcessingOptions + * @static + * @param {google.cloud.talent.v4.Job.IProcessingOptions} message ProcessingOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessingOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disableStreetAddressResolution != null && Object.hasOwnProperty.call(message, "disableStreetAddressResolution")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.disableStreetAddressResolution); + if (message.htmlSanitization != null && Object.hasOwnProperty.call(message, "htmlSanitization")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.htmlSanitization); + return writer; + }; + + /** + * Encodes the specified ProcessingOptions message, length delimited. Does not implicitly {@link google.cloud.talent.v4.Job.ProcessingOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.Job.ProcessingOptions + * @static + * @param {google.cloud.talent.v4.Job.IProcessingOptions} message ProcessingOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessingOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessingOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.Job.ProcessingOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.Job.ProcessingOptions} ProcessingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessingOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.Job.ProcessingOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.disableStreetAddressResolution = reader.bool(); + break; + } + case 2: { + message.htmlSanitization = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessingOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.Job.ProcessingOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.Job.ProcessingOptions} ProcessingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessingOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessingOptions message. + * @function verify + * @memberof google.cloud.talent.v4.Job.ProcessingOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessingOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.disableStreetAddressResolution != null && message.hasOwnProperty("disableStreetAddressResolution")) + if (typeof message.disableStreetAddressResolution !== "boolean") + return "disableStreetAddressResolution: boolean expected"; + if (message.htmlSanitization != null && message.hasOwnProperty("htmlSanitization")) + switch (message.htmlSanitization) { + default: + return "htmlSanitization: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ProcessingOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.Job.ProcessingOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.Job.ProcessingOptions} ProcessingOptions + */ + ProcessingOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.Job.ProcessingOptions) + return object; + var message = new $root.google.cloud.talent.v4.Job.ProcessingOptions(); + if (object.disableStreetAddressResolution != null) + message.disableStreetAddressResolution = Boolean(object.disableStreetAddressResolution); + switch (object.htmlSanitization) { + default: + if (typeof object.htmlSanitization === "number") { + message.htmlSanitization = object.htmlSanitization; + break; + } + break; + case "HTML_SANITIZATION_UNSPECIFIED": + case 0: + message.htmlSanitization = 0; + break; + case "HTML_SANITIZATION_DISABLED": + case 1: + message.htmlSanitization = 1; + break; + case "SIMPLE_FORMATTING_ONLY": + case 2: + message.htmlSanitization = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ProcessingOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.Job.ProcessingOptions + * @static + * @param {google.cloud.talent.v4.Job.ProcessingOptions} message ProcessingOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessingOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disableStreetAddressResolution = false; + object.htmlSanitization = options.enums === String ? "HTML_SANITIZATION_UNSPECIFIED" : 0; + } + if (message.disableStreetAddressResolution != null && message.hasOwnProperty("disableStreetAddressResolution")) + object.disableStreetAddressResolution = message.disableStreetAddressResolution; + if (message.htmlSanitization != null && message.hasOwnProperty("htmlSanitization")) + object.htmlSanitization = options.enums === String ? $root.google.cloud.talent.v4.HtmlSanitization[message.htmlSanitization] === undefined ? message.htmlSanitization : $root.google.cloud.talent.v4.HtmlSanitization[message.htmlSanitization] : message.htmlSanitization; + return object; + }; + + /** + * Converts this ProcessingOptions to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.Job.ProcessingOptions + * @instance + * @returns {Object.} JSON object + */ + ProcessingOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessingOptions + * @function getTypeUrl + * @memberof google.cloud.talent.v4.Job.ProcessingOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessingOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.Job.ProcessingOptions"; + }; + + return ProcessingOptions; + })(); + + return Job; + })(); + + v4.JobService = (function() { + + /** + * Constructs a new JobService service. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a JobService + * @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 JobService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (JobService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = JobService; + + /** + * Creates new JobService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.talent.v4.JobService + * @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 {JobService} RPC service. Useful where requests and/or responses are streamed. + */ + JobService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.talent.v4.JobService|createJob}. + * @memberof google.cloud.talent.v4.JobService + * @typedef CreateJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4.Job} [response] Job + */ + + /** + * Calls CreateJob. + * @function createJob + * @memberof google.cloud.talent.v4.JobService + * @instance + * @param {google.cloud.talent.v4.ICreateJobRequest} request CreateJobRequest message or plain object + * @param {google.cloud.talent.v4.JobService.CreateJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.createJob = function createJob(request, callback) { + return this.rpcCall(createJob, $root.google.cloud.talent.v4.CreateJobRequest, $root.google.cloud.talent.v4.Job, request, callback); + }, "name", { value: "CreateJob" }); + + /** + * Calls CreateJob. + * @function createJob + * @memberof google.cloud.talent.v4.JobService + * @instance + * @param {google.cloud.talent.v4.ICreateJobRequest} request CreateJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4.JobService|batchCreateJobs}. + * @memberof google.cloud.talent.v4.JobService + * @typedef BatchCreateJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchCreateJobs. + * @function batchCreateJobs + * @memberof google.cloud.talent.v4.JobService + * @instance + * @param {google.cloud.talent.v4.IBatchCreateJobsRequest} request BatchCreateJobsRequest message or plain object + * @param {google.cloud.talent.v4.JobService.BatchCreateJobsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.batchCreateJobs = function batchCreateJobs(request, callback) { + return this.rpcCall(batchCreateJobs, $root.google.cloud.talent.v4.BatchCreateJobsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchCreateJobs" }); + + /** + * Calls BatchCreateJobs. + * @function batchCreateJobs + * @memberof google.cloud.talent.v4.JobService + * @instance + * @param {google.cloud.talent.v4.IBatchCreateJobsRequest} request BatchCreateJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4.JobService|getJob}. + * @memberof google.cloud.talent.v4.JobService + * @typedef GetJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4.Job} [response] Job + */ + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.talent.v4.JobService + * @instance + * @param {google.cloud.talent.v4.IGetJobRequest} request GetJobRequest message or plain object + * @param {google.cloud.talent.v4.JobService.GetJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.getJob = function getJob(request, callback) { + return this.rpcCall(getJob, $root.google.cloud.talent.v4.GetJobRequest, $root.google.cloud.talent.v4.Job, request, callback); + }, "name", { value: "GetJob" }); + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.talent.v4.JobService + * @instance + * @param {google.cloud.talent.v4.IGetJobRequest} request GetJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4.JobService|updateJob}. + * @memberof google.cloud.talent.v4.JobService + * @typedef UpdateJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4.Job} [response] Job + */ + + /** + * Calls UpdateJob. + * @function updateJob + * @memberof google.cloud.talent.v4.JobService + * @instance + * @param {google.cloud.talent.v4.IUpdateJobRequest} request UpdateJobRequest message or plain object + * @param {google.cloud.talent.v4.JobService.UpdateJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.updateJob = function updateJob(request, callback) { + return this.rpcCall(updateJob, $root.google.cloud.talent.v4.UpdateJobRequest, $root.google.cloud.talent.v4.Job, request, callback); + }, "name", { value: "UpdateJob" }); + + /** + * Calls UpdateJob. + * @function updateJob + * @memberof google.cloud.talent.v4.JobService + * @instance + * @param {google.cloud.talent.v4.IUpdateJobRequest} request UpdateJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4.JobService|batchUpdateJobs}. + * @memberof google.cloud.talent.v4.JobService + * @typedef BatchUpdateJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchUpdateJobs. + * @function batchUpdateJobs + * @memberof google.cloud.talent.v4.JobService + * @instance + * @param {google.cloud.talent.v4.IBatchUpdateJobsRequest} request BatchUpdateJobsRequest message or plain object + * @param {google.cloud.talent.v4.JobService.BatchUpdateJobsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.batchUpdateJobs = function batchUpdateJobs(request, callback) { + return this.rpcCall(batchUpdateJobs, $root.google.cloud.talent.v4.BatchUpdateJobsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchUpdateJobs" }); + + /** + * Calls BatchUpdateJobs. + * @function batchUpdateJobs + * @memberof google.cloud.talent.v4.JobService + * @instance + * @param {google.cloud.talent.v4.IBatchUpdateJobsRequest} request BatchUpdateJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4.JobService|deleteJob}. + * @memberof google.cloud.talent.v4.JobService + * @typedef DeleteJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteJob. + * @function deleteJob + * @memberof google.cloud.talent.v4.JobService + * @instance + * @param {google.cloud.talent.v4.IDeleteJobRequest} request DeleteJobRequest message or plain object + * @param {google.cloud.talent.v4.JobService.DeleteJobCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.deleteJob = function deleteJob(request, callback) { + return this.rpcCall(deleteJob, $root.google.cloud.talent.v4.DeleteJobRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteJob" }); + + /** + * Calls DeleteJob. + * @function deleteJob + * @memberof google.cloud.talent.v4.JobService + * @instance + * @param {google.cloud.talent.v4.IDeleteJobRequest} request DeleteJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4.JobService|batchDeleteJobs}. + * @memberof google.cloud.talent.v4.JobService + * @typedef BatchDeleteJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchDeleteJobs. + * @function batchDeleteJobs + * @memberof google.cloud.talent.v4.JobService + * @instance + * @param {google.cloud.talent.v4.IBatchDeleteJobsRequest} request BatchDeleteJobsRequest message or plain object + * @param {google.cloud.talent.v4.JobService.BatchDeleteJobsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.batchDeleteJobs = function batchDeleteJobs(request, callback) { + return this.rpcCall(batchDeleteJobs, $root.google.cloud.talent.v4.BatchDeleteJobsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchDeleteJobs" }); + + /** + * Calls BatchDeleteJobs. + * @function batchDeleteJobs + * @memberof google.cloud.talent.v4.JobService + * @instance + * @param {google.cloud.talent.v4.IBatchDeleteJobsRequest} request BatchDeleteJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4.JobService|listJobs}. + * @memberof google.cloud.talent.v4.JobService + * @typedef ListJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4.ListJobsResponse} [response] ListJobsResponse + */ + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.talent.v4.JobService + * @instance + * @param {google.cloud.talent.v4.IListJobsRequest} request ListJobsRequest message or plain object + * @param {google.cloud.talent.v4.JobService.ListJobsCallback} callback Node-style callback called with the error, if any, and ListJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.listJobs = function listJobs(request, callback) { + return this.rpcCall(listJobs, $root.google.cloud.talent.v4.ListJobsRequest, $root.google.cloud.talent.v4.ListJobsResponse, request, callback); + }, "name", { value: "ListJobs" }); + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.talent.v4.JobService + * @instance + * @param {google.cloud.talent.v4.IListJobsRequest} request ListJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4.JobService|searchJobs}. + * @memberof google.cloud.talent.v4.JobService + * @typedef SearchJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4.SearchJobsResponse} [response] SearchJobsResponse + */ + + /** + * Calls SearchJobs. + * @function searchJobs + * @memberof google.cloud.talent.v4.JobService + * @instance + * @param {google.cloud.talent.v4.ISearchJobsRequest} request SearchJobsRequest message or plain object + * @param {google.cloud.talent.v4.JobService.SearchJobsCallback} callback Node-style callback called with the error, if any, and SearchJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.searchJobs = function searchJobs(request, callback) { + return this.rpcCall(searchJobs, $root.google.cloud.talent.v4.SearchJobsRequest, $root.google.cloud.talent.v4.SearchJobsResponse, request, callback); + }, "name", { value: "SearchJobs" }); + + /** + * Calls SearchJobs. + * @function searchJobs + * @memberof google.cloud.talent.v4.JobService + * @instance + * @param {google.cloud.talent.v4.ISearchJobsRequest} request SearchJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4.JobService|searchJobsForAlert}. + * @memberof google.cloud.talent.v4.JobService + * @typedef SearchJobsForAlertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4.SearchJobsResponse} [response] SearchJobsResponse + */ + + /** + * Calls SearchJobsForAlert. + * @function searchJobsForAlert + * @memberof google.cloud.talent.v4.JobService + * @instance + * @param {google.cloud.talent.v4.ISearchJobsRequest} request SearchJobsRequest message or plain object + * @param {google.cloud.talent.v4.JobService.SearchJobsForAlertCallback} callback Node-style callback called with the error, if any, and SearchJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.searchJobsForAlert = function searchJobsForAlert(request, callback) { + return this.rpcCall(searchJobsForAlert, $root.google.cloud.talent.v4.SearchJobsRequest, $root.google.cloud.talent.v4.SearchJobsResponse, request, callback); + }, "name", { value: "SearchJobsForAlert" }); + + /** + * Calls SearchJobsForAlert. + * @function searchJobsForAlert + * @memberof google.cloud.talent.v4.JobService + * @instance + * @param {google.cloud.talent.v4.ISearchJobsRequest} request SearchJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return JobService; + })(); + + v4.CreateJobRequest = (function() { + + /** + * Properties of a CreateJobRequest. + * @memberof google.cloud.talent.v4 + * @interface ICreateJobRequest + * @property {string|null} [parent] CreateJobRequest parent + * @property {google.cloud.talent.v4.IJob|null} [job] CreateJobRequest job + */ + + /** + * Constructs a new CreateJobRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a CreateJobRequest. + * @implements ICreateJobRequest + * @constructor + * @param {google.cloud.talent.v4.ICreateJobRequest=} [properties] Properties to set + */ + function CreateJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateJobRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.parent = ""; + + /** + * CreateJobRequest job. + * @member {google.cloud.talent.v4.IJob|null|undefined} job + * @memberof google.cloud.talent.v4.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.job = null; + + /** + * Creates a new CreateJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.CreateJobRequest + * @static + * @param {google.cloud.talent.v4.ICreateJobRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.CreateJobRequest} CreateJobRequest instance + */ + CreateJobRequest.create = function create(properties) { + return new CreateJobRequest(properties); + }; + + /** + * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.talent.v4.CreateJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.CreateJobRequest + * @static + * @param {google.cloud.talent.v4.ICreateJobRequest} message CreateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.talent.v4.Job.encode(message.job, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CreateJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.CreateJobRequest + * @static + * @param {google.cloud.talent.v4.ICreateJobRequest} message CreateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.CreateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.CreateJobRequest} CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.CreateJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.job = $root.google.cloud.talent.v4.Job.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.CreateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.CreateJobRequest} CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateJobRequest message. + * @function verify + * @memberof google.cloud.talent.v4.CreateJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.cloud.talent.v4.Job.verify(message.job); + if (error) + return "job." + error; + } + return null; + }; + + /** + * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.CreateJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.CreateJobRequest} CreateJobRequest + */ + CreateJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.CreateJobRequest) + return object; + var message = new $root.google.cloud.talent.v4.CreateJobRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.talent.v4.CreateJobRequest.job: object expected"); + message.job = $root.google.cloud.talent.v4.Job.fromObject(object.job); + } + return message; + }; + + /** + * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.CreateJobRequest + * @static + * @param {google.cloud.talent.v4.CreateJobRequest} message CreateJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.job = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.talent.v4.Job.toObject(message.job, options); + return object; + }; + + /** + * Converts this CreateJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.CreateJobRequest + * @instance + * @returns {Object.} JSON object + */ + CreateJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateJobRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.CreateJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.CreateJobRequest"; + }; + + return CreateJobRequest; + })(); + + v4.GetJobRequest = (function() { + + /** + * Properties of a GetJobRequest. + * @memberof google.cloud.talent.v4 + * @interface IGetJobRequest + * @property {string|null} [name] GetJobRequest name + */ + + /** + * Constructs a new GetJobRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a GetJobRequest. + * @implements IGetJobRequest + * @constructor + * @param {google.cloud.talent.v4.IGetJobRequest=} [properties] Properties to set + */ + function GetJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetJobRequest name. + * @member {string} name + * @memberof google.cloud.talent.v4.GetJobRequest + * @instance + */ + GetJobRequest.prototype.name = ""; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.GetJobRequest + * @static + * @param {google.cloud.talent.v4.IGetJobRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.GetJobRequest} GetJobRequest instance + */ + GetJobRequest.create = function create(properties) { + return new GetJobRequest(properties); + }; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.talent.v4.GetJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.GetJobRequest + * @static + * @param {google.cloud.talent.v4.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.GetJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.GetJobRequest + * @static + * @param {google.cloud.talent.v4.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.GetJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetJobRequest message. + * @function verify + * @memberof google.cloud.talent.v4.GetJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.GetJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.GetJobRequest} GetJobRequest + */ + GetJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.GetJobRequest) + return object; + var message = new $root.google.cloud.talent.v4.GetJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.GetJobRequest + * @static + * @param {google.cloud.talent.v4.GetJobRequest} message GetJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.GetJobRequest + * @instance + * @returns {Object.} JSON object + */ + GetJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetJobRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.GetJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.GetJobRequest"; + }; + + return GetJobRequest; + })(); + + v4.UpdateJobRequest = (function() { + + /** + * Properties of an UpdateJobRequest. + * @memberof google.cloud.talent.v4 + * @interface IUpdateJobRequest + * @property {google.cloud.talent.v4.IJob|null} [job] UpdateJobRequest job + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateJobRequest updateMask + */ + + /** + * Constructs a new UpdateJobRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents an UpdateJobRequest. + * @implements IUpdateJobRequest + * @constructor + * @param {google.cloud.talent.v4.IUpdateJobRequest=} [properties] Properties to set + */ + function UpdateJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateJobRequest job. + * @member {google.cloud.talent.v4.IJob|null|undefined} job + * @memberof google.cloud.talent.v4.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.job = null; + + /** + * UpdateJobRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.talent.v4.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.UpdateJobRequest + * @static + * @param {google.cloud.talent.v4.IUpdateJobRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.UpdateJobRequest} UpdateJobRequest instance + */ + UpdateJobRequest.create = function create(properties) { + return new UpdateJobRequest(properties); + }; + + /** + * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.talent.v4.UpdateJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.UpdateJobRequest + * @static + * @param {google.cloud.talent.v4.IUpdateJobRequest} message UpdateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.talent.v4.Job.encode(message.job, 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 UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.UpdateJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.UpdateJobRequest + * @static + * @param {google.cloud.talent.v4.IUpdateJobRequest} message UpdateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.UpdateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.UpdateJobRequest} UpdateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.UpdateJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.job = $root.google.cloud.talent.v4.Job.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 UpdateJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.UpdateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.UpdateJobRequest} UpdateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateJobRequest message. + * @function verify + * @memberof google.cloud.talent.v4.UpdateJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.cloud.talent.v4.Job.verify(message.job); + if (error) + return "job." + 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 UpdateJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.UpdateJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.UpdateJobRequest} UpdateJobRequest + */ + UpdateJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.UpdateJobRequest) + return object; + var message = new $root.google.cloud.talent.v4.UpdateJobRequest(); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.talent.v4.UpdateJobRequest.job: object expected"); + message.job = $root.google.cloud.talent.v4.Job.fromObject(object.job); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.talent.v4.UpdateJobRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.UpdateJobRequest + * @static + * @param {google.cloud.talent.v4.UpdateJobRequest} message UpdateJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.job = null; + object.updateMask = null; + } + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.talent.v4.Job.toObject(message.job, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.UpdateJobRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateJobRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.UpdateJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.UpdateJobRequest"; + }; + + return UpdateJobRequest; + })(); + + v4.DeleteJobRequest = (function() { + + /** + * Properties of a DeleteJobRequest. + * @memberof google.cloud.talent.v4 + * @interface IDeleteJobRequest + * @property {string|null} [name] DeleteJobRequest name + */ + + /** + * Constructs a new DeleteJobRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a DeleteJobRequest. + * @implements IDeleteJobRequest + * @constructor + * @param {google.cloud.talent.v4.IDeleteJobRequest=} [properties] Properties to set + */ + function DeleteJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteJobRequest name. + * @member {string} name + * @memberof google.cloud.talent.v4.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.name = ""; + + /** + * Creates a new DeleteJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.DeleteJobRequest + * @static + * @param {google.cloud.talent.v4.IDeleteJobRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.DeleteJobRequest} DeleteJobRequest instance + */ + DeleteJobRequest.create = function create(properties) { + return new DeleteJobRequest(properties); + }; + + /** + * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.talent.v4.DeleteJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.DeleteJobRequest + * @static + * @param {google.cloud.talent.v4.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.DeleteJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.DeleteJobRequest + * @static + * @param {google.cloud.talent.v4.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.DeleteJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.DeleteJobRequest} DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.DeleteJobRequest(); + 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 DeleteJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.DeleteJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.DeleteJobRequest} DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteJobRequest message. + * @function verify + * @memberof google.cloud.talent.v4.DeleteJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.DeleteJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.DeleteJobRequest} DeleteJobRequest + */ + DeleteJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.DeleteJobRequest) + return object; + var message = new $root.google.cloud.talent.v4.DeleteJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.DeleteJobRequest + * @static + * @param {google.cloud.talent.v4.DeleteJobRequest} message DeleteJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.DeleteJobRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteJobRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.DeleteJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.DeleteJobRequest"; + }; + + return DeleteJobRequest; + })(); + + /** + * JobView enum. + * @name google.cloud.talent.v4.JobView + * @enum {number} + * @property {number} JOB_VIEW_UNSPECIFIED=0 JOB_VIEW_UNSPECIFIED value + * @property {number} JOB_VIEW_ID_ONLY=1 JOB_VIEW_ID_ONLY value + * @property {number} JOB_VIEW_MINIMAL=2 JOB_VIEW_MINIMAL value + * @property {number} JOB_VIEW_SMALL=3 JOB_VIEW_SMALL value + * @property {number} JOB_VIEW_FULL=4 JOB_VIEW_FULL value + */ + v4.JobView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "JOB_VIEW_ID_ONLY"] = 1; + values[valuesById[2] = "JOB_VIEW_MINIMAL"] = 2; + values[valuesById[3] = "JOB_VIEW_SMALL"] = 3; + values[valuesById[4] = "JOB_VIEW_FULL"] = 4; + return values; + })(); + + v4.ListJobsRequest = (function() { + + /** + * Properties of a ListJobsRequest. + * @memberof google.cloud.talent.v4 + * @interface IListJobsRequest + * @property {string|null} [parent] ListJobsRequest parent + * @property {string|null} [filter] ListJobsRequest filter + * @property {string|null} [pageToken] ListJobsRequest pageToken + * @property {number|null} [pageSize] ListJobsRequest pageSize + * @property {google.cloud.talent.v4.JobView|null} [jobView] ListJobsRequest jobView + */ + + /** + * Constructs a new ListJobsRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a ListJobsRequest. + * @implements IListJobsRequest + * @constructor + * @param {google.cloud.talent.v4.IListJobsRequest=} [properties] Properties to set + */ + function ListJobsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.parent = ""; + + /** + * ListJobsRequest filter. + * @member {string} filter + * @memberof google.cloud.talent.v4.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.filter = ""; + + /** + * ListJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.talent.v4.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageToken = ""; + + /** + * ListJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.talent.v4.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageSize = 0; + + /** + * ListJobsRequest jobView. + * @member {google.cloud.talent.v4.JobView} jobView + * @memberof google.cloud.talent.v4.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.jobView = 0; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.ListJobsRequest + * @static + * @param {google.cloud.talent.v4.IListJobsRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.ListJobsRequest} ListJobsRequest instance + */ + ListJobsRequest.create = function create(properties) { + return new ListJobsRequest(properties); + }; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.talent.v4.ListJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.ListJobsRequest + * @static + * @param {google.cloud.talent.v4.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.jobView != null && Object.hasOwnProperty.call(message, "jobView")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.jobView); + return writer; + }; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.ListJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.ListJobsRequest + * @static + * @param {google.cloud.talent.v4.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.ListJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.jobView = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsRequest message. + * @function verify + * @memberof google.cloud.talent.v4.ListJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.jobView != null && message.hasOwnProperty("jobView")) + switch (message.jobView) { + default: + return "jobView: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.ListJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.ListJobsRequest} ListJobsRequest + */ + ListJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.ListJobsRequest) + return object; + var message = new $root.google.cloud.talent.v4.ListJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + switch (object.jobView) { + default: + if (typeof object.jobView === "number") { + message.jobView = object.jobView; + break; + } + break; + case "JOB_VIEW_UNSPECIFIED": + case 0: + message.jobView = 0; + break; + case "JOB_VIEW_ID_ONLY": + case 1: + message.jobView = 1; + break; + case "JOB_VIEW_MINIMAL": + case 2: + message.jobView = 2; + break; + case "JOB_VIEW_SMALL": + case 3: + message.jobView = 3; + break; + case "JOB_VIEW_FULL": + case 4: + message.jobView = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.ListJobsRequest + * @static + * @param {google.cloud.talent.v4.ListJobsRequest} message ListJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageToken = ""; + object.pageSize = 0; + object.jobView = options.enums === String ? "JOB_VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.jobView != null && message.hasOwnProperty("jobView")) + object.jobView = options.enums === String ? $root.google.cloud.talent.v4.JobView[message.jobView] === undefined ? message.jobView : $root.google.cloud.talent.v4.JobView[message.jobView] : message.jobView; + return object; + }; + + /** + * Converts this ListJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.ListJobsRequest + * @instance + * @returns {Object.} JSON object + */ + ListJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.ListJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.ListJobsRequest"; + }; + + return ListJobsRequest; + })(); + + v4.ListJobsResponse = (function() { + + /** + * Properties of a ListJobsResponse. + * @memberof google.cloud.talent.v4 + * @interface IListJobsResponse + * @property {Array.|null} [jobs] ListJobsResponse jobs + * @property {string|null} [nextPageToken] ListJobsResponse nextPageToken + * @property {google.cloud.talent.v4.IResponseMetadata|null} [metadata] ListJobsResponse metadata + */ + + /** + * Constructs a new ListJobsResponse. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a ListJobsResponse. + * @implements IListJobsResponse + * @constructor + * @param {google.cloud.talent.v4.IListJobsResponse=} [properties] Properties to set + */ + function ListJobsResponse(properties) { + this.jobs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobsResponse jobs. + * @member {Array.} jobs + * @memberof google.cloud.talent.v4.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.jobs = $util.emptyArray; + + /** + * ListJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.talent.v4.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.nextPageToken = ""; + + /** + * ListJobsResponse metadata. + * @member {google.cloud.talent.v4.IResponseMetadata|null|undefined} metadata + * @memberof google.cloud.talent.v4.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.metadata = null; + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.ListJobsResponse + * @static + * @param {google.cloud.talent.v4.IListJobsResponse=} [properties] Properties to set + * @returns {google.cloud.talent.v4.ListJobsResponse} ListJobsResponse instance + */ + ListJobsResponse.create = function create(properties) { + return new ListJobsResponse(properties); + }; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.talent.v4.ListJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.ListJobsResponse + * @static + * @param {google.cloud.talent.v4.IListJobsResponse} message ListJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + $root.google.cloud.talent.v4.Job.encode(message.jobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.talent.v4.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4.ListJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.ListJobsResponse + * @static + * @param {google.cloud.talent.v4.IListJobsResponse} message ListJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.ListJobsResponse} ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.ListJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push($root.google.cloud.talent.v4.Job.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.metadata = $root.google.cloud.talent.v4.ResponseMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.ListJobsResponse} ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsResponse message. + * @function verify + * @memberof google.cloud.talent.v4.ListJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobs != null && message.hasOwnProperty("jobs")) { + if (!Array.isArray(message.jobs)) + return "jobs: array expected"; + for (var i = 0; i < message.jobs.length; ++i) { + var error = $root.google.cloud.talent.v4.Job.verify(message.jobs[i]); + if (error) + return "jobs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.talent.v4.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.ListJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.ListJobsResponse} ListJobsResponse + */ + ListJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.ListJobsResponse) + return object; + var message = new $root.google.cloud.talent.v4.ListJobsResponse(); + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.talent.v4.ListJobsResponse.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) { + if (typeof object.jobs[i] !== "object") + throw TypeError(".google.cloud.talent.v4.ListJobsResponse.jobs: object expected"); + message.jobs[i] = $root.google.cloud.talent.v4.Job.fromObject(object.jobs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.talent.v4.ListJobsResponse.metadata: object expected"); + message.metadata = $root.google.cloud.talent.v4.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.ListJobsResponse + * @static + * @param {google.cloud.talent.v4.ListJobsResponse} message ListJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jobs = []; + if (options.defaults) { + object.nextPageToken = ""; + object.metadata = null; + } + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = $root.google.cloud.talent.v4.Job.toObject(message.jobs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.talent.v4.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this ListJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.ListJobsResponse + * @instance + * @returns {Object.} JSON object + */ + ListJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsResponse + * @function getTypeUrl + * @memberof google.cloud.talent.v4.ListJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.ListJobsResponse"; + }; + + return ListJobsResponse; + })(); + + v4.SearchJobsRequest = (function() { + + /** + * Properties of a SearchJobsRequest. + * @memberof google.cloud.talent.v4 + * @interface ISearchJobsRequest + * @property {string|null} [parent] SearchJobsRequest parent + * @property {google.cloud.talent.v4.SearchJobsRequest.SearchMode|null} [searchMode] SearchJobsRequest searchMode + * @property {google.cloud.talent.v4.IRequestMetadata|null} [requestMetadata] SearchJobsRequest requestMetadata + * @property {google.cloud.talent.v4.IJobQuery|null} [jobQuery] SearchJobsRequest jobQuery + * @property {boolean|null} [enableBroadening] SearchJobsRequest enableBroadening + * @property {Array.|null} [histogramQueries] SearchJobsRequest histogramQueries + * @property {google.cloud.talent.v4.JobView|null} [jobView] SearchJobsRequest jobView + * @property {number|null} [offset] SearchJobsRequest offset + * @property {number|null} [maxPageSize] SearchJobsRequest maxPageSize + * @property {string|null} [pageToken] SearchJobsRequest pageToken + * @property {string|null} [orderBy] SearchJobsRequest orderBy + * @property {google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel|null} [diversificationLevel] SearchJobsRequest diversificationLevel + * @property {google.cloud.talent.v4.SearchJobsRequest.ICustomRankingInfo|null} [customRankingInfo] SearchJobsRequest customRankingInfo + * @property {boolean|null} [disableKeywordMatch] SearchJobsRequest disableKeywordMatch + * @property {google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode|null} [keywordMatchMode] SearchJobsRequest keywordMatchMode + */ + + /** + * Constructs a new SearchJobsRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a SearchJobsRequest. + * @implements ISearchJobsRequest + * @constructor + * @param {google.cloud.talent.v4.ISearchJobsRequest=} [properties] Properties to set + */ + function SearchJobsRequest(properties) { + this.histogramQueries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.parent = ""; + + /** + * SearchJobsRequest searchMode. + * @member {google.cloud.talent.v4.SearchJobsRequest.SearchMode} searchMode + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.searchMode = 0; + + /** + * SearchJobsRequest requestMetadata. + * @member {google.cloud.talent.v4.IRequestMetadata|null|undefined} requestMetadata + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.requestMetadata = null; + + /** + * SearchJobsRequest jobQuery. + * @member {google.cloud.talent.v4.IJobQuery|null|undefined} jobQuery + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.jobQuery = null; + + /** + * SearchJobsRequest enableBroadening. + * @member {boolean} enableBroadening + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.enableBroadening = false; + + /** + * SearchJobsRequest histogramQueries. + * @member {Array.} histogramQueries + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.histogramQueries = $util.emptyArray; + + /** + * SearchJobsRequest jobView. + * @member {google.cloud.talent.v4.JobView} jobView + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.jobView = 0; + + /** + * SearchJobsRequest offset. + * @member {number} offset + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.offset = 0; + + /** + * SearchJobsRequest maxPageSize. + * @member {number} maxPageSize + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.maxPageSize = 0; + + /** + * SearchJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.pageToken = ""; + + /** + * SearchJobsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.orderBy = ""; + + /** + * SearchJobsRequest diversificationLevel. + * @member {google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel} diversificationLevel + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.diversificationLevel = 0; + + /** + * SearchJobsRequest customRankingInfo. + * @member {google.cloud.talent.v4.SearchJobsRequest.ICustomRankingInfo|null|undefined} customRankingInfo + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.customRankingInfo = null; + + /** + * SearchJobsRequest disableKeywordMatch. + * @member {boolean} disableKeywordMatch + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.disableKeywordMatch = false; + + /** + * SearchJobsRequest keywordMatchMode. + * @member {google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode} keywordMatchMode + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.keywordMatchMode = 0; + + /** + * Creates a new SearchJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @static + * @param {google.cloud.talent.v4.ISearchJobsRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.SearchJobsRequest} SearchJobsRequest instance + */ + SearchJobsRequest.create = function create(properties) { + return new SearchJobsRequest(properties); + }; + + /** + * Encodes the specified SearchJobsRequest message. Does not implicitly {@link google.cloud.talent.v4.SearchJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @static + * @param {google.cloud.talent.v4.ISearchJobsRequest} message SearchJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchJobsRequest.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.searchMode != null && Object.hasOwnProperty.call(message, "searchMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.searchMode); + if (message.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) + $root.google.cloud.talent.v4.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.jobQuery != null && Object.hasOwnProperty.call(message, "jobQuery")) + $root.google.cloud.talent.v4.JobQuery.encode(message.jobQuery, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enableBroadening != null && Object.hasOwnProperty.call(message, "enableBroadening")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enableBroadening); + if (message.histogramQueries != null && message.histogramQueries.length) + for (var i = 0; i < message.histogramQueries.length; ++i) + $root.google.cloud.talent.v4.HistogramQuery.encode(message.histogramQueries[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.jobView != null && Object.hasOwnProperty.call(message, "jobView")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.jobView); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.offset); + if (message.maxPageSize != null && Object.hasOwnProperty.call(message, "maxPageSize")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.maxPageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.pageToken); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.orderBy); + if (message.diversificationLevel != null && Object.hasOwnProperty.call(message, "diversificationLevel")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.diversificationLevel); + if (message.customRankingInfo != null && Object.hasOwnProperty.call(message, "customRankingInfo")) + $root.google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.encode(message.customRankingInfo, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.disableKeywordMatch != null && Object.hasOwnProperty.call(message, "disableKeywordMatch")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.disableKeywordMatch); + if (message.keywordMatchMode != null && Object.hasOwnProperty.call(message, "keywordMatchMode")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.keywordMatchMode); + return writer; + }; + + /** + * Encodes the specified SearchJobsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.SearchJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @static + * @param {google.cloud.talent.v4.ISearchJobsRequest} message SearchJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.SearchJobsRequest} SearchJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.SearchJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.searchMode = reader.int32(); + break; + } + case 3: { + message.requestMetadata = $root.google.cloud.talent.v4.RequestMetadata.decode(reader, reader.uint32()); + break; + } + case 4: { + message.jobQuery = $root.google.cloud.talent.v4.JobQuery.decode(reader, reader.uint32()); + break; + } + case 5: { + message.enableBroadening = reader.bool(); + break; + } + case 7: { + if (!(message.histogramQueries && message.histogramQueries.length)) + message.histogramQueries = []; + message.histogramQueries.push($root.google.cloud.talent.v4.HistogramQuery.decode(reader, reader.uint32())); + break; + } + case 8: { + message.jobView = reader.int32(); + break; + } + case 9: { + message.offset = reader.int32(); + break; + } + case 10: { + message.maxPageSize = reader.int32(); + break; + } + case 11: { + message.pageToken = reader.string(); + break; + } + case 12: { + message.orderBy = reader.string(); + break; + } + case 13: { + message.diversificationLevel = reader.int32(); + break; + } + case 14: { + message.customRankingInfo = $root.google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.decode(reader, reader.uint32()); + break; + } + case 16: { + message.disableKeywordMatch = reader.bool(); + break; + } + case 18: { + message.keywordMatchMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.SearchJobsRequest} SearchJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchJobsRequest message. + * @function verify + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchJobsRequest.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.searchMode != null && message.hasOwnProperty("searchMode")) + switch (message.searchMode) { + default: + return "searchMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { + var error = $root.google.cloud.talent.v4.RequestMetadata.verify(message.requestMetadata); + if (error) + return "requestMetadata." + error; + } + if (message.jobQuery != null && message.hasOwnProperty("jobQuery")) { + var error = $root.google.cloud.talent.v4.JobQuery.verify(message.jobQuery); + if (error) + return "jobQuery." + error; + } + if (message.enableBroadening != null && message.hasOwnProperty("enableBroadening")) + if (typeof message.enableBroadening !== "boolean") + return "enableBroadening: boolean expected"; + if (message.histogramQueries != null && message.hasOwnProperty("histogramQueries")) { + if (!Array.isArray(message.histogramQueries)) + return "histogramQueries: array expected"; + for (var i = 0; i < message.histogramQueries.length; ++i) { + var error = $root.google.cloud.talent.v4.HistogramQuery.verify(message.histogramQueries[i]); + if (error) + return "histogramQueries." + error; + } + } + if (message.jobView != null && message.hasOwnProperty("jobView")) + switch (message.jobView) { + default: + return "jobView: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset)) + return "offset: integer expected"; + if (message.maxPageSize != null && message.hasOwnProperty("maxPageSize")) + if (!$util.isInteger(message.maxPageSize)) + return "maxPageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.diversificationLevel != null && message.hasOwnProperty("diversificationLevel")) + switch (message.diversificationLevel) { + default: + return "diversificationLevel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.customRankingInfo != null && message.hasOwnProperty("customRankingInfo")) { + var error = $root.google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.verify(message.customRankingInfo); + if (error) + return "customRankingInfo." + error; + } + if (message.disableKeywordMatch != null && message.hasOwnProperty("disableKeywordMatch")) + if (typeof message.disableKeywordMatch !== "boolean") + return "disableKeywordMatch: boolean expected"; + if (message.keywordMatchMode != null && message.hasOwnProperty("keywordMatchMode")) + switch (message.keywordMatchMode) { + default: + return "keywordMatchMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a SearchJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.SearchJobsRequest} SearchJobsRequest + */ + SearchJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.SearchJobsRequest) + return object; + var message = new $root.google.cloud.talent.v4.SearchJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.searchMode) { + default: + if (typeof object.searchMode === "number") { + message.searchMode = object.searchMode; + break; + } + break; + case "SEARCH_MODE_UNSPECIFIED": + case 0: + message.searchMode = 0; + break; + case "JOB_SEARCH": + case 1: + message.searchMode = 1; + break; + case "FEATURED_JOB_SEARCH": + case 2: + message.searchMode = 2; + break; + } + if (object.requestMetadata != null) { + if (typeof object.requestMetadata !== "object") + throw TypeError(".google.cloud.talent.v4.SearchJobsRequest.requestMetadata: object expected"); + message.requestMetadata = $root.google.cloud.talent.v4.RequestMetadata.fromObject(object.requestMetadata); + } + if (object.jobQuery != null) { + if (typeof object.jobQuery !== "object") + throw TypeError(".google.cloud.talent.v4.SearchJobsRequest.jobQuery: object expected"); + message.jobQuery = $root.google.cloud.talent.v4.JobQuery.fromObject(object.jobQuery); + } + if (object.enableBroadening != null) + message.enableBroadening = Boolean(object.enableBroadening); + if (object.histogramQueries) { + if (!Array.isArray(object.histogramQueries)) + throw TypeError(".google.cloud.talent.v4.SearchJobsRequest.histogramQueries: array expected"); + message.histogramQueries = []; + for (var i = 0; i < object.histogramQueries.length; ++i) { + if (typeof object.histogramQueries[i] !== "object") + throw TypeError(".google.cloud.talent.v4.SearchJobsRequest.histogramQueries: object expected"); + message.histogramQueries[i] = $root.google.cloud.talent.v4.HistogramQuery.fromObject(object.histogramQueries[i]); + } + } + switch (object.jobView) { + default: + if (typeof object.jobView === "number") { + message.jobView = object.jobView; + break; + } + break; + case "JOB_VIEW_UNSPECIFIED": + case 0: + message.jobView = 0; + break; + case "JOB_VIEW_ID_ONLY": + case 1: + message.jobView = 1; + break; + case "JOB_VIEW_MINIMAL": + case 2: + message.jobView = 2; + break; + case "JOB_VIEW_SMALL": + case 3: + message.jobView = 3; + break; + case "JOB_VIEW_FULL": + case 4: + message.jobView = 4; + break; + } + if (object.offset != null) + message.offset = object.offset | 0; + if (object.maxPageSize != null) + message.maxPageSize = object.maxPageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + switch (object.diversificationLevel) { + default: + if (typeof object.diversificationLevel === "number") { + message.diversificationLevel = object.diversificationLevel; + break; + } + break; + case "DIVERSIFICATION_LEVEL_UNSPECIFIED": + case 0: + message.diversificationLevel = 0; + break; + case "DISABLED": + case 1: + message.diversificationLevel = 1; + break; + case "SIMPLE": + case 2: + message.diversificationLevel = 2; + break; + case "ONE_PER_COMPANY": + case 3: + message.diversificationLevel = 3; + break; + case "TWO_PER_COMPANY": + case 4: + message.diversificationLevel = 4; + break; + case "DIVERSIFY_BY_LOOSER_SIMILARITY": + case 5: + message.diversificationLevel = 5; + break; + } + if (object.customRankingInfo != null) { + if (typeof object.customRankingInfo !== "object") + throw TypeError(".google.cloud.talent.v4.SearchJobsRequest.customRankingInfo: object expected"); + message.customRankingInfo = $root.google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.fromObject(object.customRankingInfo); + } + if (object.disableKeywordMatch != null) + message.disableKeywordMatch = Boolean(object.disableKeywordMatch); + switch (object.keywordMatchMode) { + default: + if (typeof object.keywordMatchMode === "number") { + message.keywordMatchMode = object.keywordMatchMode; + break; + } + break; + case "KEYWORD_MATCH_MODE_UNSPECIFIED": + case 0: + message.keywordMatchMode = 0; + break; + case "KEYWORD_MATCH_DISABLED": + case 1: + message.keywordMatchMode = 1; + break; + case "KEYWORD_MATCH_ALL": + case 2: + message.keywordMatchMode = 2; + break; + case "KEYWORD_MATCH_TITLE_ONLY": + case 3: + message.keywordMatchMode = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a SearchJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @static + * @param {google.cloud.talent.v4.SearchJobsRequest} message SearchJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.histogramQueries = []; + if (options.defaults) { + object.parent = ""; + object.searchMode = options.enums === String ? "SEARCH_MODE_UNSPECIFIED" : 0; + object.requestMetadata = null; + object.jobQuery = null; + object.enableBroadening = false; + object.jobView = options.enums === String ? "JOB_VIEW_UNSPECIFIED" : 0; + object.offset = 0; + object.maxPageSize = 0; + object.pageToken = ""; + object.orderBy = ""; + object.diversificationLevel = options.enums === String ? "DIVERSIFICATION_LEVEL_UNSPECIFIED" : 0; + object.customRankingInfo = null; + object.disableKeywordMatch = false; + object.keywordMatchMode = options.enums === String ? "KEYWORD_MATCH_MODE_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.searchMode != null && message.hasOwnProperty("searchMode")) + object.searchMode = options.enums === String ? $root.google.cloud.talent.v4.SearchJobsRequest.SearchMode[message.searchMode] === undefined ? message.searchMode : $root.google.cloud.talent.v4.SearchJobsRequest.SearchMode[message.searchMode] : message.searchMode; + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) + object.requestMetadata = $root.google.cloud.talent.v4.RequestMetadata.toObject(message.requestMetadata, options); + if (message.jobQuery != null && message.hasOwnProperty("jobQuery")) + object.jobQuery = $root.google.cloud.talent.v4.JobQuery.toObject(message.jobQuery, options); + if (message.enableBroadening != null && message.hasOwnProperty("enableBroadening")) + object.enableBroadening = message.enableBroadening; + if (message.histogramQueries && message.histogramQueries.length) { + object.histogramQueries = []; + for (var j = 0; j < message.histogramQueries.length; ++j) + object.histogramQueries[j] = $root.google.cloud.talent.v4.HistogramQuery.toObject(message.histogramQueries[j], options); + } + if (message.jobView != null && message.hasOwnProperty("jobView")) + object.jobView = options.enums === String ? $root.google.cloud.talent.v4.JobView[message.jobView] === undefined ? message.jobView : $root.google.cloud.talent.v4.JobView[message.jobView] : message.jobView; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = message.offset; + if (message.maxPageSize != null && message.hasOwnProperty("maxPageSize")) + object.maxPageSize = message.maxPageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.diversificationLevel != null && message.hasOwnProperty("diversificationLevel")) + object.diversificationLevel = options.enums === String ? $root.google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel[message.diversificationLevel] === undefined ? message.diversificationLevel : $root.google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel[message.diversificationLevel] : message.diversificationLevel; + if (message.customRankingInfo != null && message.hasOwnProperty("customRankingInfo")) + object.customRankingInfo = $root.google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.toObject(message.customRankingInfo, options); + if (message.disableKeywordMatch != null && message.hasOwnProperty("disableKeywordMatch")) + object.disableKeywordMatch = message.disableKeywordMatch; + if (message.keywordMatchMode != null && message.hasOwnProperty("keywordMatchMode")) + object.keywordMatchMode = options.enums === String ? $root.google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode[message.keywordMatchMode] === undefined ? message.keywordMatchMode : $root.google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode[message.keywordMatchMode] : message.keywordMatchMode; + return object; + }; + + /** + * Converts this SearchJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @instance + * @returns {Object.} JSON object + */ + SearchJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchJobsRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.SearchJobsRequest"; + }; + + /** + * SearchMode enum. + * @name google.cloud.talent.v4.SearchJobsRequest.SearchMode + * @enum {number} + * @property {number} SEARCH_MODE_UNSPECIFIED=0 SEARCH_MODE_UNSPECIFIED value + * @property {number} JOB_SEARCH=1 JOB_SEARCH value + * @property {number} FEATURED_JOB_SEARCH=2 FEATURED_JOB_SEARCH value + */ + SearchJobsRequest.SearchMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEARCH_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "JOB_SEARCH"] = 1; + values[valuesById[2] = "FEATURED_JOB_SEARCH"] = 2; + return values; + })(); + + /** + * DiversificationLevel enum. + * @name google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel + * @enum {number} + * @property {number} DIVERSIFICATION_LEVEL_UNSPECIFIED=0 DIVERSIFICATION_LEVEL_UNSPECIFIED value + * @property {number} DISABLED=1 DISABLED value + * @property {number} SIMPLE=2 SIMPLE value + * @property {number} ONE_PER_COMPANY=3 ONE_PER_COMPANY value + * @property {number} TWO_PER_COMPANY=4 TWO_PER_COMPANY value + * @property {number} DIVERSIFY_BY_LOOSER_SIMILARITY=5 DIVERSIFY_BY_LOOSER_SIMILARITY value + */ + SearchJobsRequest.DiversificationLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DIVERSIFICATION_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISABLED"] = 1; + values[valuesById[2] = "SIMPLE"] = 2; + values[valuesById[3] = "ONE_PER_COMPANY"] = 3; + values[valuesById[4] = "TWO_PER_COMPANY"] = 4; + values[valuesById[5] = "DIVERSIFY_BY_LOOSER_SIMILARITY"] = 5; + return values; + })(); + + /** + * KeywordMatchMode enum. + * @name google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode + * @enum {number} + * @property {number} KEYWORD_MATCH_MODE_UNSPECIFIED=0 KEYWORD_MATCH_MODE_UNSPECIFIED value + * @property {number} KEYWORD_MATCH_DISABLED=1 KEYWORD_MATCH_DISABLED value + * @property {number} KEYWORD_MATCH_ALL=2 KEYWORD_MATCH_ALL value + * @property {number} KEYWORD_MATCH_TITLE_ONLY=3 KEYWORD_MATCH_TITLE_ONLY value + */ + SearchJobsRequest.KeywordMatchMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KEYWORD_MATCH_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "KEYWORD_MATCH_DISABLED"] = 1; + values[valuesById[2] = "KEYWORD_MATCH_ALL"] = 2; + values[valuesById[3] = "KEYWORD_MATCH_TITLE_ONLY"] = 3; + return values; + })(); + + SearchJobsRequest.CustomRankingInfo = (function() { + + /** + * Properties of a CustomRankingInfo. + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @interface ICustomRankingInfo + * @property {google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ImportanceLevel|null} [importanceLevel] CustomRankingInfo importanceLevel + * @property {string|null} [rankingExpression] CustomRankingInfo rankingExpression + */ + + /** + * Constructs a new CustomRankingInfo. + * @memberof google.cloud.talent.v4.SearchJobsRequest + * @classdesc Represents a CustomRankingInfo. + * @implements ICustomRankingInfo + * @constructor + * @param {google.cloud.talent.v4.SearchJobsRequest.ICustomRankingInfo=} [properties] Properties to set + */ + function CustomRankingInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomRankingInfo importanceLevel. + * @member {google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ImportanceLevel} importanceLevel + * @memberof google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo + * @instance + */ + CustomRankingInfo.prototype.importanceLevel = 0; + + /** + * CustomRankingInfo rankingExpression. + * @member {string} rankingExpression + * @memberof google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo + * @instance + */ + CustomRankingInfo.prototype.rankingExpression = ""; + + /** + * Creates a new CustomRankingInfo instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo + * @static + * @param {google.cloud.talent.v4.SearchJobsRequest.ICustomRankingInfo=} [properties] Properties to set + * @returns {google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo} CustomRankingInfo instance + */ + CustomRankingInfo.create = function create(properties) { + return new CustomRankingInfo(properties); + }; + + /** + * Encodes the specified CustomRankingInfo message. Does not implicitly {@link google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo + * @static + * @param {google.cloud.talent.v4.SearchJobsRequest.ICustomRankingInfo} message CustomRankingInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomRankingInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.importanceLevel != null && Object.hasOwnProperty.call(message, "importanceLevel")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.importanceLevel); + if (message.rankingExpression != null && Object.hasOwnProperty.call(message, "rankingExpression")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rankingExpression); + return writer; + }; + + /** + * Encodes the specified CustomRankingInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo + * @static + * @param {google.cloud.talent.v4.SearchJobsRequest.ICustomRankingInfo} message CustomRankingInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomRankingInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomRankingInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo} CustomRankingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomRankingInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.importanceLevel = reader.int32(); + break; + } + case 2: { + message.rankingExpression = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomRankingInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo} CustomRankingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomRankingInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomRankingInfo message. + * @function verify + * @memberof google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomRankingInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.importanceLevel != null && message.hasOwnProperty("importanceLevel")) + switch (message.importanceLevel) { + default: + return "importanceLevel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.rankingExpression != null && message.hasOwnProperty("rankingExpression")) + if (!$util.isString(message.rankingExpression)) + return "rankingExpression: string expected"; + return null; + }; + + /** + * Creates a CustomRankingInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo} CustomRankingInfo + */ + CustomRankingInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo) + return object; + var message = new $root.google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo(); + switch (object.importanceLevel) { + default: + if (typeof object.importanceLevel === "number") { + message.importanceLevel = object.importanceLevel; + break; + } + break; + case "IMPORTANCE_LEVEL_UNSPECIFIED": + case 0: + message.importanceLevel = 0; + break; + case "NONE": + case 1: + message.importanceLevel = 1; + break; + case "LOW": + case 2: + message.importanceLevel = 2; + break; + case "MILD": + case 3: + message.importanceLevel = 3; + break; + case "MEDIUM": + case 4: + message.importanceLevel = 4; + break; + case "HIGH": + case 5: + message.importanceLevel = 5; + break; + case "EXTREME": + case 6: + message.importanceLevel = 6; + break; + } + if (object.rankingExpression != null) + message.rankingExpression = String(object.rankingExpression); + return message; + }; + + /** + * Creates a plain object from a CustomRankingInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo + * @static + * @param {google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo} message CustomRankingInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomRankingInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.importanceLevel = options.enums === String ? "IMPORTANCE_LEVEL_UNSPECIFIED" : 0; + object.rankingExpression = ""; + } + if (message.importanceLevel != null && message.hasOwnProperty("importanceLevel")) + object.importanceLevel = options.enums === String ? $root.google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ImportanceLevel[message.importanceLevel] === undefined ? message.importanceLevel : $root.google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ImportanceLevel[message.importanceLevel] : message.importanceLevel; + if (message.rankingExpression != null && message.hasOwnProperty("rankingExpression")) + object.rankingExpression = message.rankingExpression; + return object; + }; + + /** + * Converts this CustomRankingInfo to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo + * @instance + * @returns {Object.} JSON object + */ + CustomRankingInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomRankingInfo + * @function getTypeUrl + * @memberof google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomRankingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo"; + }; + + /** + * ImportanceLevel enum. + * @name google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ImportanceLevel + * @enum {number} + * @property {number} IMPORTANCE_LEVEL_UNSPECIFIED=0 IMPORTANCE_LEVEL_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} LOW=2 LOW value + * @property {number} MILD=3 MILD value + * @property {number} MEDIUM=4 MEDIUM value + * @property {number} HIGH=5 HIGH value + * @property {number} EXTREME=6 EXTREME value + */ + CustomRankingInfo.ImportanceLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IMPORTANCE_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "LOW"] = 2; + values[valuesById[3] = "MILD"] = 3; + values[valuesById[4] = "MEDIUM"] = 4; + values[valuesById[5] = "HIGH"] = 5; + values[valuesById[6] = "EXTREME"] = 6; + return values; + })(); + + return CustomRankingInfo; + })(); + + return SearchJobsRequest; + })(); + + v4.SearchJobsResponse = (function() { + + /** + * Properties of a SearchJobsResponse. + * @memberof google.cloud.talent.v4 + * @interface ISearchJobsResponse + * @property {Array.|null} [matchingJobs] SearchJobsResponse matchingJobs + * @property {Array.|null} [histogramQueryResults] SearchJobsResponse histogramQueryResults + * @property {string|null} [nextPageToken] SearchJobsResponse nextPageToken + * @property {Array.|null} [locationFilters] SearchJobsResponse locationFilters + * @property {number|null} [totalSize] SearchJobsResponse totalSize + * @property {google.cloud.talent.v4.IResponseMetadata|null} [metadata] SearchJobsResponse metadata + * @property {number|null} [broadenedQueryJobsCount] SearchJobsResponse broadenedQueryJobsCount + * @property {google.cloud.talent.v4.ISpellingCorrection|null} [spellCorrection] SearchJobsResponse spellCorrection + */ + + /** + * Constructs a new SearchJobsResponse. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a SearchJobsResponse. + * @implements ISearchJobsResponse + * @constructor + * @param {google.cloud.talent.v4.ISearchJobsResponse=} [properties] Properties to set + */ + function SearchJobsResponse(properties) { + this.matchingJobs = []; + this.histogramQueryResults = []; + this.locationFilters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchJobsResponse matchingJobs. + * @member {Array.} matchingJobs + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @instance + */ + SearchJobsResponse.prototype.matchingJobs = $util.emptyArray; + + /** + * SearchJobsResponse histogramQueryResults. + * @member {Array.} histogramQueryResults + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @instance + */ + SearchJobsResponse.prototype.histogramQueryResults = $util.emptyArray; + + /** + * SearchJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @instance + */ + SearchJobsResponse.prototype.nextPageToken = ""; + + /** + * SearchJobsResponse locationFilters. + * @member {Array.} locationFilters + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @instance + */ + SearchJobsResponse.prototype.locationFilters = $util.emptyArray; + + /** + * SearchJobsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @instance + */ + SearchJobsResponse.prototype.totalSize = 0; + + /** + * SearchJobsResponse metadata. + * @member {google.cloud.talent.v4.IResponseMetadata|null|undefined} metadata + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @instance + */ + SearchJobsResponse.prototype.metadata = null; + + /** + * SearchJobsResponse broadenedQueryJobsCount. + * @member {number} broadenedQueryJobsCount + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @instance + */ + SearchJobsResponse.prototype.broadenedQueryJobsCount = 0; + + /** + * SearchJobsResponse spellCorrection. + * @member {google.cloud.talent.v4.ISpellingCorrection|null|undefined} spellCorrection + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @instance + */ + SearchJobsResponse.prototype.spellCorrection = null; + + /** + * Creates a new SearchJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @static + * @param {google.cloud.talent.v4.ISearchJobsResponse=} [properties] Properties to set + * @returns {google.cloud.talent.v4.SearchJobsResponse} SearchJobsResponse instance + */ + SearchJobsResponse.create = function create(properties) { + return new SearchJobsResponse(properties); + }; + + /** + * Encodes the specified SearchJobsResponse message. Does not implicitly {@link google.cloud.talent.v4.SearchJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @static + * @param {google.cloud.talent.v4.ISearchJobsResponse} message SearchJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.matchingJobs != null && message.matchingJobs.length) + for (var i = 0; i < message.matchingJobs.length; ++i) + $root.google.cloud.talent.v4.SearchJobsResponse.MatchingJob.encode(message.matchingJobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.histogramQueryResults != null && message.histogramQueryResults.length) + for (var i = 0; i < message.histogramQueryResults.length; ++i) + $root.google.cloud.talent.v4.HistogramQueryResult.encode(message.histogramQueryResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.locationFilters != null && message.locationFilters.length) + for (var i = 0; i < message.locationFilters.length; ++i) + $root.google.cloud.talent.v4.Location.encode(message.locationFilters[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.totalSize); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.talent.v4.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.broadenedQueryJobsCount != null && Object.hasOwnProperty.call(message, "broadenedQueryJobsCount")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.broadenedQueryJobsCount); + if (message.spellCorrection != null && Object.hasOwnProperty.call(message, "spellCorrection")) + $root.google.cloud.talent.v4.SpellingCorrection.encode(message.spellCorrection, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchJobsResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4.SearchJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @static + * @param {google.cloud.talent.v4.ISearchJobsResponse} message SearchJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.SearchJobsResponse} SearchJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchJobsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.SearchJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.matchingJobs && message.matchingJobs.length)) + message.matchingJobs = []; + message.matchingJobs.push($root.google.cloud.talent.v4.SearchJobsResponse.MatchingJob.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.histogramQueryResults && message.histogramQueryResults.length)) + message.histogramQueryResults = []; + message.histogramQueryResults.push($root.google.cloud.talent.v4.HistogramQueryResult.decode(reader, reader.uint32())); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + if (!(message.locationFilters && message.locationFilters.length)) + message.locationFilters = []; + message.locationFilters.push($root.google.cloud.talent.v4.Location.decode(reader, reader.uint32())); + break; + } + case 6: { + message.totalSize = reader.int32(); + break; + } + case 7: { + message.metadata = $root.google.cloud.talent.v4.ResponseMetadata.decode(reader, reader.uint32()); + break; + } + case 8: { + message.broadenedQueryJobsCount = reader.int32(); + break; + } + case 9: { + message.spellCorrection = $root.google.cloud.talent.v4.SpellingCorrection.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.SearchJobsResponse} SearchJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchJobsResponse message. + * @function verify + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.matchingJobs != null && message.hasOwnProperty("matchingJobs")) { + if (!Array.isArray(message.matchingJobs)) + return "matchingJobs: array expected"; + for (var i = 0; i < message.matchingJobs.length; ++i) { + var error = $root.google.cloud.talent.v4.SearchJobsResponse.MatchingJob.verify(message.matchingJobs[i]); + if (error) + return "matchingJobs." + error; + } + } + if (message.histogramQueryResults != null && message.hasOwnProperty("histogramQueryResults")) { + if (!Array.isArray(message.histogramQueryResults)) + return "histogramQueryResults: array expected"; + for (var i = 0; i < message.histogramQueryResults.length; ++i) { + var error = $root.google.cloud.talent.v4.HistogramQueryResult.verify(message.histogramQueryResults[i]); + if (error) + return "histogramQueryResults." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.locationFilters != null && message.hasOwnProperty("locationFilters")) { + if (!Array.isArray(message.locationFilters)) + return "locationFilters: array expected"; + for (var i = 0; i < message.locationFilters.length; ++i) { + var error = $root.google.cloud.talent.v4.Location.verify(message.locationFilters[i]); + if (error) + return "locationFilters." + error; + } + } + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.talent.v4.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.broadenedQueryJobsCount != null && message.hasOwnProperty("broadenedQueryJobsCount")) + if (!$util.isInteger(message.broadenedQueryJobsCount)) + return "broadenedQueryJobsCount: integer expected"; + if (message.spellCorrection != null && message.hasOwnProperty("spellCorrection")) { + var error = $root.google.cloud.talent.v4.SpellingCorrection.verify(message.spellCorrection); + if (error) + return "spellCorrection." + error; + } + return null; + }; + + /** + * Creates a SearchJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.SearchJobsResponse} SearchJobsResponse + */ + SearchJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.SearchJobsResponse) + return object; + var message = new $root.google.cloud.talent.v4.SearchJobsResponse(); + if (object.matchingJobs) { + if (!Array.isArray(object.matchingJobs)) + throw TypeError(".google.cloud.talent.v4.SearchJobsResponse.matchingJobs: array expected"); + message.matchingJobs = []; + for (var i = 0; i < object.matchingJobs.length; ++i) { + if (typeof object.matchingJobs[i] !== "object") + throw TypeError(".google.cloud.talent.v4.SearchJobsResponse.matchingJobs: object expected"); + message.matchingJobs[i] = $root.google.cloud.talent.v4.SearchJobsResponse.MatchingJob.fromObject(object.matchingJobs[i]); + } + } + if (object.histogramQueryResults) { + if (!Array.isArray(object.histogramQueryResults)) + throw TypeError(".google.cloud.talent.v4.SearchJobsResponse.histogramQueryResults: array expected"); + message.histogramQueryResults = []; + for (var i = 0; i < object.histogramQueryResults.length; ++i) { + if (typeof object.histogramQueryResults[i] !== "object") + throw TypeError(".google.cloud.talent.v4.SearchJobsResponse.histogramQueryResults: object expected"); + message.histogramQueryResults[i] = $root.google.cloud.talent.v4.HistogramQueryResult.fromObject(object.histogramQueryResults[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.locationFilters) { + if (!Array.isArray(object.locationFilters)) + throw TypeError(".google.cloud.talent.v4.SearchJobsResponse.locationFilters: array expected"); + message.locationFilters = []; + for (var i = 0; i < object.locationFilters.length; ++i) { + if (typeof object.locationFilters[i] !== "object") + throw TypeError(".google.cloud.talent.v4.SearchJobsResponse.locationFilters: object expected"); + message.locationFilters[i] = $root.google.cloud.talent.v4.Location.fromObject(object.locationFilters[i]); + } + } + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.talent.v4.SearchJobsResponse.metadata: object expected"); + message.metadata = $root.google.cloud.talent.v4.ResponseMetadata.fromObject(object.metadata); + } + if (object.broadenedQueryJobsCount != null) + message.broadenedQueryJobsCount = object.broadenedQueryJobsCount | 0; + if (object.spellCorrection != null) { + if (typeof object.spellCorrection !== "object") + throw TypeError(".google.cloud.talent.v4.SearchJobsResponse.spellCorrection: object expected"); + message.spellCorrection = $root.google.cloud.talent.v4.SpellingCorrection.fromObject(object.spellCorrection); + } + return message; + }; + + /** + * Creates a plain object from a SearchJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @static + * @param {google.cloud.talent.v4.SearchJobsResponse} message SearchJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.matchingJobs = []; + object.histogramQueryResults = []; + object.locationFilters = []; + } + if (options.defaults) { + object.nextPageToken = ""; + object.totalSize = 0; + object.metadata = null; + object.broadenedQueryJobsCount = 0; + object.spellCorrection = null; + } + if (message.matchingJobs && message.matchingJobs.length) { + object.matchingJobs = []; + for (var j = 0; j < message.matchingJobs.length; ++j) + object.matchingJobs[j] = $root.google.cloud.talent.v4.SearchJobsResponse.MatchingJob.toObject(message.matchingJobs[j], options); + } + if (message.histogramQueryResults && message.histogramQueryResults.length) { + object.histogramQueryResults = []; + for (var j = 0; j < message.histogramQueryResults.length; ++j) + object.histogramQueryResults[j] = $root.google.cloud.talent.v4.HistogramQueryResult.toObject(message.histogramQueryResults[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.locationFilters && message.locationFilters.length) { + object.locationFilters = []; + for (var j = 0; j < message.locationFilters.length; ++j) + object.locationFilters[j] = $root.google.cloud.talent.v4.Location.toObject(message.locationFilters[j], options); + } + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.talent.v4.ResponseMetadata.toObject(message.metadata, options); + if (message.broadenedQueryJobsCount != null && message.hasOwnProperty("broadenedQueryJobsCount")) + object.broadenedQueryJobsCount = message.broadenedQueryJobsCount; + if (message.spellCorrection != null && message.hasOwnProperty("spellCorrection")) + object.spellCorrection = $root.google.cloud.talent.v4.SpellingCorrection.toObject(message.spellCorrection, options); + return object; + }; + + /** + * Converts this SearchJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @instance + * @returns {Object.} JSON object + */ + SearchJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchJobsResponse + * @function getTypeUrl + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.SearchJobsResponse"; + }; + + SearchJobsResponse.MatchingJob = (function() { + + /** + * Properties of a MatchingJob. + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @interface IMatchingJob + * @property {google.cloud.talent.v4.IJob|null} [job] MatchingJob job + * @property {string|null} [jobSummary] MatchingJob jobSummary + * @property {string|null} [jobTitleSnippet] MatchingJob jobTitleSnippet + * @property {string|null} [searchTextSnippet] MatchingJob searchTextSnippet + * @property {google.cloud.talent.v4.SearchJobsResponse.ICommuteInfo|null} [commuteInfo] MatchingJob commuteInfo + */ + + /** + * Constructs a new MatchingJob. + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @classdesc Represents a MatchingJob. + * @implements IMatchingJob + * @constructor + * @param {google.cloud.talent.v4.SearchJobsResponse.IMatchingJob=} [properties] Properties to set + */ + function MatchingJob(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MatchingJob job. + * @member {google.cloud.talent.v4.IJob|null|undefined} job + * @memberof google.cloud.talent.v4.SearchJobsResponse.MatchingJob + * @instance + */ + MatchingJob.prototype.job = null; + + /** + * MatchingJob jobSummary. + * @member {string} jobSummary + * @memberof google.cloud.talent.v4.SearchJobsResponse.MatchingJob + * @instance + */ + MatchingJob.prototype.jobSummary = ""; + + /** + * MatchingJob jobTitleSnippet. + * @member {string} jobTitleSnippet + * @memberof google.cloud.talent.v4.SearchJobsResponse.MatchingJob + * @instance + */ + MatchingJob.prototype.jobTitleSnippet = ""; + + /** + * MatchingJob searchTextSnippet. + * @member {string} searchTextSnippet + * @memberof google.cloud.talent.v4.SearchJobsResponse.MatchingJob + * @instance + */ + MatchingJob.prototype.searchTextSnippet = ""; + + /** + * MatchingJob commuteInfo. + * @member {google.cloud.talent.v4.SearchJobsResponse.ICommuteInfo|null|undefined} commuteInfo + * @memberof google.cloud.talent.v4.SearchJobsResponse.MatchingJob + * @instance + */ + MatchingJob.prototype.commuteInfo = null; + + /** + * Creates a new MatchingJob instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.SearchJobsResponse.MatchingJob + * @static + * @param {google.cloud.talent.v4.SearchJobsResponse.IMatchingJob=} [properties] Properties to set + * @returns {google.cloud.talent.v4.SearchJobsResponse.MatchingJob} MatchingJob instance + */ + MatchingJob.create = function create(properties) { + return new MatchingJob(properties); + }; + + /** + * Encodes the specified MatchingJob message. Does not implicitly {@link google.cloud.talent.v4.SearchJobsResponse.MatchingJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.SearchJobsResponse.MatchingJob + * @static + * @param {google.cloud.talent.v4.SearchJobsResponse.IMatchingJob} message MatchingJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchingJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.talent.v4.Job.encode(message.job, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.jobSummary != null && Object.hasOwnProperty.call(message, "jobSummary")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobSummary); + if (message.jobTitleSnippet != null && Object.hasOwnProperty.call(message, "jobTitleSnippet")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobTitleSnippet); + if (message.searchTextSnippet != null && Object.hasOwnProperty.call(message, "searchTextSnippet")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.searchTextSnippet); + if (message.commuteInfo != null && Object.hasOwnProperty.call(message, "commuteInfo")) + $root.google.cloud.talent.v4.SearchJobsResponse.CommuteInfo.encode(message.commuteInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MatchingJob message, length delimited. Does not implicitly {@link google.cloud.talent.v4.SearchJobsResponse.MatchingJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.SearchJobsResponse.MatchingJob + * @static + * @param {google.cloud.talent.v4.SearchJobsResponse.IMatchingJob} message MatchingJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchingJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MatchingJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.SearchJobsResponse.MatchingJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.SearchJobsResponse.MatchingJob} MatchingJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchingJob.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.SearchJobsResponse.MatchingJob(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.job = $root.google.cloud.talent.v4.Job.decode(reader, reader.uint32()); + break; + } + case 2: { + message.jobSummary = reader.string(); + break; + } + case 3: { + message.jobTitleSnippet = reader.string(); + break; + } + case 4: { + message.searchTextSnippet = reader.string(); + break; + } + case 5: { + message.commuteInfo = $root.google.cloud.talent.v4.SearchJobsResponse.CommuteInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MatchingJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.SearchJobsResponse.MatchingJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.SearchJobsResponse.MatchingJob} MatchingJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchingJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MatchingJob message. + * @function verify + * @memberof google.cloud.talent.v4.SearchJobsResponse.MatchingJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MatchingJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.cloud.talent.v4.Job.verify(message.job); + if (error) + return "job." + error; + } + if (message.jobSummary != null && message.hasOwnProperty("jobSummary")) + if (!$util.isString(message.jobSummary)) + return "jobSummary: string expected"; + if (message.jobTitleSnippet != null && message.hasOwnProperty("jobTitleSnippet")) + if (!$util.isString(message.jobTitleSnippet)) + return "jobTitleSnippet: string expected"; + if (message.searchTextSnippet != null && message.hasOwnProperty("searchTextSnippet")) + if (!$util.isString(message.searchTextSnippet)) + return "searchTextSnippet: string expected"; + if (message.commuteInfo != null && message.hasOwnProperty("commuteInfo")) { + var error = $root.google.cloud.talent.v4.SearchJobsResponse.CommuteInfo.verify(message.commuteInfo); + if (error) + return "commuteInfo." + error; + } + return null; + }; + + /** + * Creates a MatchingJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.SearchJobsResponse.MatchingJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.SearchJobsResponse.MatchingJob} MatchingJob + */ + MatchingJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.SearchJobsResponse.MatchingJob) + return object; + var message = new $root.google.cloud.talent.v4.SearchJobsResponse.MatchingJob(); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.talent.v4.SearchJobsResponse.MatchingJob.job: object expected"); + message.job = $root.google.cloud.talent.v4.Job.fromObject(object.job); + } + if (object.jobSummary != null) + message.jobSummary = String(object.jobSummary); + if (object.jobTitleSnippet != null) + message.jobTitleSnippet = String(object.jobTitleSnippet); + if (object.searchTextSnippet != null) + message.searchTextSnippet = String(object.searchTextSnippet); + if (object.commuteInfo != null) { + if (typeof object.commuteInfo !== "object") + throw TypeError(".google.cloud.talent.v4.SearchJobsResponse.MatchingJob.commuteInfo: object expected"); + message.commuteInfo = $root.google.cloud.talent.v4.SearchJobsResponse.CommuteInfo.fromObject(object.commuteInfo); + } + return message; + }; + + /** + * Creates a plain object from a MatchingJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.SearchJobsResponse.MatchingJob + * @static + * @param {google.cloud.talent.v4.SearchJobsResponse.MatchingJob} message MatchingJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MatchingJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.job = null; + object.jobSummary = ""; + object.jobTitleSnippet = ""; + object.searchTextSnippet = ""; + object.commuteInfo = null; + } + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.talent.v4.Job.toObject(message.job, options); + if (message.jobSummary != null && message.hasOwnProperty("jobSummary")) + object.jobSummary = message.jobSummary; + if (message.jobTitleSnippet != null && message.hasOwnProperty("jobTitleSnippet")) + object.jobTitleSnippet = message.jobTitleSnippet; + if (message.searchTextSnippet != null && message.hasOwnProperty("searchTextSnippet")) + object.searchTextSnippet = message.searchTextSnippet; + if (message.commuteInfo != null && message.hasOwnProperty("commuteInfo")) + object.commuteInfo = $root.google.cloud.talent.v4.SearchJobsResponse.CommuteInfo.toObject(message.commuteInfo, options); + return object; + }; + + /** + * Converts this MatchingJob to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.SearchJobsResponse.MatchingJob + * @instance + * @returns {Object.} JSON object + */ + MatchingJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MatchingJob + * @function getTypeUrl + * @memberof google.cloud.talent.v4.SearchJobsResponse.MatchingJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MatchingJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.SearchJobsResponse.MatchingJob"; + }; + + return MatchingJob; + })(); + + SearchJobsResponse.CommuteInfo = (function() { + + /** + * Properties of a CommuteInfo. + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @interface ICommuteInfo + * @property {google.cloud.talent.v4.ILocation|null} [jobLocation] CommuteInfo jobLocation + * @property {google.protobuf.IDuration|null} [travelDuration] CommuteInfo travelDuration + */ + + /** + * Constructs a new CommuteInfo. + * @memberof google.cloud.talent.v4.SearchJobsResponse + * @classdesc Represents a CommuteInfo. + * @implements ICommuteInfo + * @constructor + * @param {google.cloud.talent.v4.SearchJobsResponse.ICommuteInfo=} [properties] Properties to set + */ + function CommuteInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommuteInfo jobLocation. + * @member {google.cloud.talent.v4.ILocation|null|undefined} jobLocation + * @memberof google.cloud.talent.v4.SearchJobsResponse.CommuteInfo + * @instance + */ + CommuteInfo.prototype.jobLocation = null; + + /** + * CommuteInfo travelDuration. + * @member {google.protobuf.IDuration|null|undefined} travelDuration + * @memberof google.cloud.talent.v4.SearchJobsResponse.CommuteInfo + * @instance + */ + CommuteInfo.prototype.travelDuration = null; + + /** + * Creates a new CommuteInfo instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.SearchJobsResponse.CommuteInfo + * @static + * @param {google.cloud.talent.v4.SearchJobsResponse.ICommuteInfo=} [properties] Properties to set + * @returns {google.cloud.talent.v4.SearchJobsResponse.CommuteInfo} CommuteInfo instance + */ + CommuteInfo.create = function create(properties) { + return new CommuteInfo(properties); + }; + + /** + * Encodes the specified CommuteInfo message. Does not implicitly {@link google.cloud.talent.v4.SearchJobsResponse.CommuteInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.SearchJobsResponse.CommuteInfo + * @static + * @param {google.cloud.talent.v4.SearchJobsResponse.ICommuteInfo} message CommuteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommuteInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobLocation != null && Object.hasOwnProperty.call(message, "jobLocation")) + $root.google.cloud.talent.v4.Location.encode(message.jobLocation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.travelDuration != null && Object.hasOwnProperty.call(message, "travelDuration")) + $root.google.protobuf.Duration.encode(message.travelDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommuteInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4.SearchJobsResponse.CommuteInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.SearchJobsResponse.CommuteInfo + * @static + * @param {google.cloud.talent.v4.SearchJobsResponse.ICommuteInfo} message CommuteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommuteInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommuteInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.SearchJobsResponse.CommuteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.SearchJobsResponse.CommuteInfo} CommuteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommuteInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.SearchJobsResponse.CommuteInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.jobLocation = $root.google.cloud.talent.v4.Location.decode(reader, reader.uint32()); + break; + } + case 2: { + message.travelDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommuteInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.SearchJobsResponse.CommuteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.SearchJobsResponse.CommuteInfo} CommuteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommuteInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommuteInfo message. + * @function verify + * @memberof google.cloud.talent.v4.SearchJobsResponse.CommuteInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommuteInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobLocation != null && message.hasOwnProperty("jobLocation")) { + var error = $root.google.cloud.talent.v4.Location.verify(message.jobLocation); + if (error) + return "jobLocation." + error; + } + if (message.travelDuration != null && message.hasOwnProperty("travelDuration")) { + var error = $root.google.protobuf.Duration.verify(message.travelDuration); + if (error) + return "travelDuration." + error; + } + return null; + }; + + /** + * Creates a CommuteInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.SearchJobsResponse.CommuteInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.SearchJobsResponse.CommuteInfo} CommuteInfo + */ + CommuteInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.SearchJobsResponse.CommuteInfo) + return object; + var message = new $root.google.cloud.talent.v4.SearchJobsResponse.CommuteInfo(); + if (object.jobLocation != null) { + if (typeof object.jobLocation !== "object") + throw TypeError(".google.cloud.talent.v4.SearchJobsResponse.CommuteInfo.jobLocation: object expected"); + message.jobLocation = $root.google.cloud.talent.v4.Location.fromObject(object.jobLocation); + } + if (object.travelDuration != null) { + if (typeof object.travelDuration !== "object") + throw TypeError(".google.cloud.talent.v4.SearchJobsResponse.CommuteInfo.travelDuration: object expected"); + message.travelDuration = $root.google.protobuf.Duration.fromObject(object.travelDuration); + } + return message; + }; + + /** + * Creates a plain object from a CommuteInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.SearchJobsResponse.CommuteInfo + * @static + * @param {google.cloud.talent.v4.SearchJobsResponse.CommuteInfo} message CommuteInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommuteInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.jobLocation = null; + object.travelDuration = null; + } + if (message.jobLocation != null && message.hasOwnProperty("jobLocation")) + object.jobLocation = $root.google.cloud.talent.v4.Location.toObject(message.jobLocation, options); + if (message.travelDuration != null && message.hasOwnProperty("travelDuration")) + object.travelDuration = $root.google.protobuf.Duration.toObject(message.travelDuration, options); + return object; + }; + + /** + * Converts this CommuteInfo to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.SearchJobsResponse.CommuteInfo + * @instance + * @returns {Object.} JSON object + */ + CommuteInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommuteInfo + * @function getTypeUrl + * @memberof google.cloud.talent.v4.SearchJobsResponse.CommuteInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommuteInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.SearchJobsResponse.CommuteInfo"; + }; + + return CommuteInfo; + })(); + + return SearchJobsResponse; + })(); + + v4.BatchCreateJobsRequest = (function() { + + /** + * Properties of a BatchCreateJobsRequest. + * @memberof google.cloud.talent.v4 + * @interface IBatchCreateJobsRequest + * @property {string|null} [parent] BatchCreateJobsRequest parent + * @property {Array.|null} [jobs] BatchCreateJobsRequest jobs + */ + + /** + * Constructs a new BatchCreateJobsRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a BatchCreateJobsRequest. + * @implements IBatchCreateJobsRequest + * @constructor + * @param {google.cloud.talent.v4.IBatchCreateJobsRequest=} [properties] Properties to set + */ + function BatchCreateJobsRequest(properties) { + this.jobs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4.BatchCreateJobsRequest + * @instance + */ + BatchCreateJobsRequest.prototype.parent = ""; + + /** + * BatchCreateJobsRequest jobs. + * @member {Array.} jobs + * @memberof google.cloud.talent.v4.BatchCreateJobsRequest + * @instance + */ + BatchCreateJobsRequest.prototype.jobs = $util.emptyArray; + + /** + * Creates a new BatchCreateJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.BatchCreateJobsRequest + * @static + * @param {google.cloud.talent.v4.IBatchCreateJobsRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.BatchCreateJobsRequest} BatchCreateJobsRequest instance + */ + BatchCreateJobsRequest.create = function create(properties) { + return new BatchCreateJobsRequest(properties); + }; + + /** + * Encodes the specified BatchCreateJobsRequest message. Does not implicitly {@link google.cloud.talent.v4.BatchCreateJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.BatchCreateJobsRequest + * @static + * @param {google.cloud.talent.v4.IBatchCreateJobsRequest} message BatchCreateJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateJobsRequest.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.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + $root.google.cloud.talent.v4.Job.encode(message.jobs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateJobsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.BatchCreateJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.BatchCreateJobsRequest + * @static + * @param {google.cloud.talent.v4.IBatchCreateJobsRequest} message BatchCreateJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.BatchCreateJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.BatchCreateJobsRequest} BatchCreateJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.BatchCreateJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push($root.google.cloud.talent.v4.Job.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.BatchCreateJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.BatchCreateJobsRequest} BatchCreateJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateJobsRequest message. + * @function verify + * @memberof google.cloud.talent.v4.BatchCreateJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateJobsRequest.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.jobs != null && message.hasOwnProperty("jobs")) { + if (!Array.isArray(message.jobs)) + return "jobs: array expected"; + for (var i = 0; i < message.jobs.length; ++i) { + var error = $root.google.cloud.talent.v4.Job.verify(message.jobs[i]); + if (error) + return "jobs." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.BatchCreateJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.BatchCreateJobsRequest} BatchCreateJobsRequest + */ + BatchCreateJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.BatchCreateJobsRequest) + return object; + var message = new $root.google.cloud.talent.v4.BatchCreateJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.talent.v4.BatchCreateJobsRequest.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) { + if (typeof object.jobs[i] !== "object") + throw TypeError(".google.cloud.talent.v4.BatchCreateJobsRequest.jobs: object expected"); + message.jobs[i] = $root.google.cloud.talent.v4.Job.fromObject(object.jobs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.BatchCreateJobsRequest + * @static + * @param {google.cloud.talent.v4.BatchCreateJobsRequest} message BatchCreateJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jobs = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = $root.google.cloud.talent.v4.Job.toObject(message.jobs[j], options); + } + return object; + }; + + /** + * Converts this BatchCreateJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.BatchCreateJobsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchCreateJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateJobsRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.BatchCreateJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.BatchCreateJobsRequest"; + }; + + return BatchCreateJobsRequest; + })(); + + v4.BatchUpdateJobsRequest = (function() { + + /** + * Properties of a BatchUpdateJobsRequest. + * @memberof google.cloud.talent.v4 + * @interface IBatchUpdateJobsRequest + * @property {string|null} [parent] BatchUpdateJobsRequest parent + * @property {Array.|null} [jobs] BatchUpdateJobsRequest jobs + * @property {google.protobuf.IFieldMask|null} [updateMask] BatchUpdateJobsRequest updateMask + */ + + /** + * Constructs a new BatchUpdateJobsRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a BatchUpdateJobsRequest. + * @implements IBatchUpdateJobsRequest + * @constructor + * @param {google.cloud.talent.v4.IBatchUpdateJobsRequest=} [properties] Properties to set + */ + function BatchUpdateJobsRequest(properties) { + this.jobs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchUpdateJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4.BatchUpdateJobsRequest + * @instance + */ + BatchUpdateJobsRequest.prototype.parent = ""; + + /** + * BatchUpdateJobsRequest jobs. + * @member {Array.} jobs + * @memberof google.cloud.talent.v4.BatchUpdateJobsRequest + * @instance + */ + BatchUpdateJobsRequest.prototype.jobs = $util.emptyArray; + + /** + * BatchUpdateJobsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.talent.v4.BatchUpdateJobsRequest + * @instance + */ + BatchUpdateJobsRequest.prototype.updateMask = null; + + /** + * Creates a new BatchUpdateJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.BatchUpdateJobsRequest + * @static + * @param {google.cloud.talent.v4.IBatchUpdateJobsRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.BatchUpdateJobsRequest} BatchUpdateJobsRequest instance + */ + BatchUpdateJobsRequest.create = function create(properties) { + return new BatchUpdateJobsRequest(properties); + }; + + /** + * Encodes the specified BatchUpdateJobsRequest message. Does not implicitly {@link google.cloud.talent.v4.BatchUpdateJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.BatchUpdateJobsRequest + * @static + * @param {google.cloud.talent.v4.IBatchUpdateJobsRequest} message BatchUpdateJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateJobsRequest.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.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + $root.google.cloud.talent.v4.Job.encode(message.jobs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchUpdateJobsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.BatchUpdateJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.BatchUpdateJobsRequest + * @static + * @param {google.cloud.talent.v4.IBatchUpdateJobsRequest} message BatchUpdateJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchUpdateJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.BatchUpdateJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.BatchUpdateJobsRequest} BatchUpdateJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.BatchUpdateJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push($root.google.cloud.talent.v4.Job.decode(reader, reader.uint32())); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchUpdateJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.BatchUpdateJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.BatchUpdateJobsRequest} BatchUpdateJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchUpdateJobsRequest message. + * @function verify + * @memberof google.cloud.talent.v4.BatchUpdateJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchUpdateJobsRequest.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.jobs != null && message.hasOwnProperty("jobs")) { + if (!Array.isArray(message.jobs)) + return "jobs: array expected"; + for (var i = 0; i < message.jobs.length; ++i) { + var error = $root.google.cloud.talent.v4.Job.verify(message.jobs[i]); + if (error) + return "jobs." + 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 a BatchUpdateJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.BatchUpdateJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.BatchUpdateJobsRequest} BatchUpdateJobsRequest + */ + BatchUpdateJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.BatchUpdateJobsRequest) + return object; + var message = new $root.google.cloud.talent.v4.BatchUpdateJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.talent.v4.BatchUpdateJobsRequest.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) { + if (typeof object.jobs[i] !== "object") + throw TypeError(".google.cloud.talent.v4.BatchUpdateJobsRequest.jobs: object expected"); + message.jobs[i] = $root.google.cloud.talent.v4.Job.fromObject(object.jobs[i]); + } + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.talent.v4.BatchUpdateJobsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a BatchUpdateJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.BatchUpdateJobsRequest + * @static + * @param {google.cloud.talent.v4.BatchUpdateJobsRequest} message BatchUpdateJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchUpdateJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jobs = []; + if (options.defaults) { + object.parent = ""; + object.updateMask = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = $root.google.cloud.talent.v4.Job.toObject(message.jobs[j], options); + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this BatchUpdateJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.BatchUpdateJobsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchUpdateJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchUpdateJobsRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.BatchUpdateJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchUpdateJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.BatchUpdateJobsRequest"; + }; + + return BatchUpdateJobsRequest; + })(); + + v4.BatchDeleteJobsRequest = (function() { + + /** + * Properties of a BatchDeleteJobsRequest. + * @memberof google.cloud.talent.v4 + * @interface IBatchDeleteJobsRequest + * @property {string|null} [parent] BatchDeleteJobsRequest parent + * @property {Array.|null} [names] BatchDeleteJobsRequest names + */ + + /** + * Constructs a new BatchDeleteJobsRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a BatchDeleteJobsRequest. + * @implements IBatchDeleteJobsRequest + * @constructor + * @param {google.cloud.talent.v4.IBatchDeleteJobsRequest=} [properties] Properties to set + */ + function BatchDeleteJobsRequest(properties) { + this.names = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDeleteJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4.BatchDeleteJobsRequest + * @instance + */ + BatchDeleteJobsRequest.prototype.parent = ""; + + /** + * BatchDeleteJobsRequest names. + * @member {Array.} names + * @memberof google.cloud.talent.v4.BatchDeleteJobsRequest + * @instance + */ + BatchDeleteJobsRequest.prototype.names = $util.emptyArray; + + /** + * Creates a new BatchDeleteJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.BatchDeleteJobsRequest + * @static + * @param {google.cloud.talent.v4.IBatchDeleteJobsRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.BatchDeleteJobsRequest} BatchDeleteJobsRequest instance + */ + BatchDeleteJobsRequest.create = function create(properties) { + return new BatchDeleteJobsRequest(properties); + }; + + /** + * Encodes the specified BatchDeleteJobsRequest message. Does not implicitly {@link google.cloud.talent.v4.BatchDeleteJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.BatchDeleteJobsRequest + * @static + * @param {google.cloud.talent.v4.IBatchDeleteJobsRequest} message BatchDeleteJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteJobsRequest.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.names != null && message.names.length) + for (var i = 0; i < message.names.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.names[i]); + return writer; + }; + + /** + * Encodes the specified BatchDeleteJobsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.BatchDeleteJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.BatchDeleteJobsRequest + * @static + * @param {google.cloud.talent.v4.IBatchDeleteJobsRequest} message BatchDeleteJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDeleteJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.BatchDeleteJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.BatchDeleteJobsRequest} BatchDeleteJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.BatchDeleteJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.names && message.names.length)) + message.names = []; + message.names.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDeleteJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.BatchDeleteJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.BatchDeleteJobsRequest} BatchDeleteJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDeleteJobsRequest message. + * @function verify + * @memberof google.cloud.talent.v4.BatchDeleteJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteJobsRequest.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.names != null && message.hasOwnProperty("names")) { + if (!Array.isArray(message.names)) + return "names: array expected"; + for (var i = 0; i < message.names.length; ++i) + if (!$util.isString(message.names[i])) + return "names: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchDeleteJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.BatchDeleteJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.BatchDeleteJobsRequest} BatchDeleteJobsRequest + */ + BatchDeleteJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.BatchDeleteJobsRequest) + return object; + var message = new $root.google.cloud.talent.v4.BatchDeleteJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.names) { + if (!Array.isArray(object.names)) + throw TypeError(".google.cloud.talent.v4.BatchDeleteJobsRequest.names: array expected"); + message.names = []; + for (var i = 0; i < object.names.length; ++i) + message.names[i] = String(object.names[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchDeleteJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.BatchDeleteJobsRequest + * @static + * @param {google.cloud.talent.v4.BatchDeleteJobsRequest} message BatchDeleteJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.names = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.names && message.names.length) { + object.names = []; + for (var j = 0; j < message.names.length; ++j) + object.names[j] = message.names[j]; + } + return object; + }; + + /** + * Converts this BatchDeleteJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.BatchDeleteJobsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDeleteJobsRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.BatchDeleteJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDeleteJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.BatchDeleteJobsRequest"; + }; + + return BatchDeleteJobsRequest; + })(); + + v4.JobResult = (function() { + + /** + * Properties of a JobResult. + * @memberof google.cloud.talent.v4 + * @interface IJobResult + * @property {google.cloud.talent.v4.IJob|null} [job] JobResult job + * @property {google.rpc.IStatus|null} [status] JobResult status + */ + + /** + * Constructs a new JobResult. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a JobResult. + * @implements IJobResult + * @constructor + * @param {google.cloud.talent.v4.IJobResult=} [properties] Properties to set + */ + function JobResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobResult job. + * @member {google.cloud.talent.v4.IJob|null|undefined} job + * @memberof google.cloud.talent.v4.JobResult + * @instance + */ + JobResult.prototype.job = null; + + /** + * JobResult status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.cloud.talent.v4.JobResult + * @instance + */ + JobResult.prototype.status = null; + + /** + * Creates a new JobResult instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.JobResult + * @static + * @param {google.cloud.talent.v4.IJobResult=} [properties] Properties to set + * @returns {google.cloud.talent.v4.JobResult} JobResult instance + */ + JobResult.create = function create(properties) { + return new JobResult(properties); + }; + + /** + * Encodes the specified JobResult message. Does not implicitly {@link google.cloud.talent.v4.JobResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.JobResult + * @static + * @param {google.cloud.talent.v4.IJobResult} message JobResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.talent.v4.Job.encode(message.job, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobResult message, length delimited. Does not implicitly {@link google.cloud.talent.v4.JobResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.JobResult + * @static + * @param {google.cloud.talent.v4.IJobResult} message JobResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.JobResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.JobResult} JobResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.JobResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.job = $root.google.cloud.talent.v4.Job.decode(reader, reader.uint32()); + break; + } + case 2: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.JobResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.JobResult} JobResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobResult message. + * @function verify + * @memberof google.cloud.talent.v4.JobResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.cloud.talent.v4.Job.verify(message.job); + if (error) + return "job." + error; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates a JobResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.JobResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.JobResult} JobResult + */ + JobResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.JobResult) + return object; + var message = new $root.google.cloud.talent.v4.JobResult(); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.talent.v4.JobResult.job: object expected"); + message.job = $root.google.cloud.talent.v4.Job.fromObject(object.job); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.talent.v4.JobResult.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from a JobResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.JobResult + * @static + * @param {google.cloud.talent.v4.JobResult} message JobResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.job = null; + object.status = null; + } + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.talent.v4.Job.toObject(message.job, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this JobResult to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.JobResult + * @instance + * @returns {Object.} JSON object + */ + JobResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobResult + * @function getTypeUrl + * @memberof google.cloud.talent.v4.JobResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.JobResult"; + }; + + return JobResult; + })(); + + v4.BatchCreateJobsResponse = (function() { + + /** + * Properties of a BatchCreateJobsResponse. + * @memberof google.cloud.talent.v4 + * @interface IBatchCreateJobsResponse + * @property {Array.|null} [jobResults] BatchCreateJobsResponse jobResults + */ + + /** + * Constructs a new BatchCreateJobsResponse. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a BatchCreateJobsResponse. + * @implements IBatchCreateJobsResponse + * @constructor + * @param {google.cloud.talent.v4.IBatchCreateJobsResponse=} [properties] Properties to set + */ + function BatchCreateJobsResponse(properties) { + this.jobResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateJobsResponse jobResults. + * @member {Array.} jobResults + * @memberof google.cloud.talent.v4.BatchCreateJobsResponse + * @instance + */ + BatchCreateJobsResponse.prototype.jobResults = $util.emptyArray; + + /** + * Creates a new BatchCreateJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.BatchCreateJobsResponse + * @static + * @param {google.cloud.talent.v4.IBatchCreateJobsResponse=} [properties] Properties to set + * @returns {google.cloud.talent.v4.BatchCreateJobsResponse} BatchCreateJobsResponse instance + */ + BatchCreateJobsResponse.create = function create(properties) { + return new BatchCreateJobsResponse(properties); + }; + + /** + * Encodes the specified BatchCreateJobsResponse message. Does not implicitly {@link google.cloud.talent.v4.BatchCreateJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.BatchCreateJobsResponse + * @static + * @param {google.cloud.talent.v4.IBatchCreateJobsResponse} message BatchCreateJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobResults != null && message.jobResults.length) + for (var i = 0; i < message.jobResults.length; ++i) + $root.google.cloud.talent.v4.JobResult.encode(message.jobResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateJobsResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4.BatchCreateJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.BatchCreateJobsResponse + * @static + * @param {google.cloud.talent.v4.IBatchCreateJobsResponse} message BatchCreateJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.BatchCreateJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.BatchCreateJobsResponse} BatchCreateJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateJobsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.BatchCreateJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.jobResults && message.jobResults.length)) + message.jobResults = []; + message.jobResults.push($root.google.cloud.talent.v4.JobResult.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.BatchCreateJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.BatchCreateJobsResponse} BatchCreateJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateJobsResponse message. + * @function verify + * @memberof google.cloud.talent.v4.BatchCreateJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobResults != null && message.hasOwnProperty("jobResults")) { + if (!Array.isArray(message.jobResults)) + return "jobResults: array expected"; + for (var i = 0; i < message.jobResults.length; ++i) { + var error = $root.google.cloud.talent.v4.JobResult.verify(message.jobResults[i]); + if (error) + return "jobResults." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.BatchCreateJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.BatchCreateJobsResponse} BatchCreateJobsResponse + */ + BatchCreateJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.BatchCreateJobsResponse) + return object; + var message = new $root.google.cloud.talent.v4.BatchCreateJobsResponse(); + if (object.jobResults) { + if (!Array.isArray(object.jobResults)) + throw TypeError(".google.cloud.talent.v4.BatchCreateJobsResponse.jobResults: array expected"); + message.jobResults = []; + for (var i = 0; i < object.jobResults.length; ++i) { + if (typeof object.jobResults[i] !== "object") + throw TypeError(".google.cloud.talent.v4.BatchCreateJobsResponse.jobResults: object expected"); + message.jobResults[i] = $root.google.cloud.talent.v4.JobResult.fromObject(object.jobResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.BatchCreateJobsResponse + * @static + * @param {google.cloud.talent.v4.BatchCreateJobsResponse} message BatchCreateJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jobResults = []; + if (message.jobResults && message.jobResults.length) { + object.jobResults = []; + for (var j = 0; j < message.jobResults.length; ++j) + object.jobResults[j] = $root.google.cloud.talent.v4.JobResult.toObject(message.jobResults[j], options); + } + return object; + }; + + /** + * Converts this BatchCreateJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.BatchCreateJobsResponse + * @instance + * @returns {Object.} JSON object + */ + BatchCreateJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateJobsResponse + * @function getTypeUrl + * @memberof google.cloud.talent.v4.BatchCreateJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.BatchCreateJobsResponse"; + }; + + return BatchCreateJobsResponse; + })(); + + v4.BatchUpdateJobsResponse = (function() { + + /** + * Properties of a BatchUpdateJobsResponse. + * @memberof google.cloud.talent.v4 + * @interface IBatchUpdateJobsResponse + * @property {Array.|null} [jobResults] BatchUpdateJobsResponse jobResults + */ + + /** + * Constructs a new BatchUpdateJobsResponse. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a BatchUpdateJobsResponse. + * @implements IBatchUpdateJobsResponse + * @constructor + * @param {google.cloud.talent.v4.IBatchUpdateJobsResponse=} [properties] Properties to set + */ + function BatchUpdateJobsResponse(properties) { + this.jobResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchUpdateJobsResponse jobResults. + * @member {Array.} jobResults + * @memberof google.cloud.talent.v4.BatchUpdateJobsResponse + * @instance + */ + BatchUpdateJobsResponse.prototype.jobResults = $util.emptyArray; + + /** + * Creates a new BatchUpdateJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.BatchUpdateJobsResponse + * @static + * @param {google.cloud.talent.v4.IBatchUpdateJobsResponse=} [properties] Properties to set + * @returns {google.cloud.talent.v4.BatchUpdateJobsResponse} BatchUpdateJobsResponse instance + */ + BatchUpdateJobsResponse.create = function create(properties) { + return new BatchUpdateJobsResponse(properties); + }; + + /** + * Encodes the specified BatchUpdateJobsResponse message. Does not implicitly {@link google.cloud.talent.v4.BatchUpdateJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.BatchUpdateJobsResponse + * @static + * @param {google.cloud.talent.v4.IBatchUpdateJobsResponse} message BatchUpdateJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobResults != null && message.jobResults.length) + for (var i = 0; i < message.jobResults.length; ++i) + $root.google.cloud.talent.v4.JobResult.encode(message.jobResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchUpdateJobsResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4.BatchUpdateJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.BatchUpdateJobsResponse + * @static + * @param {google.cloud.talent.v4.IBatchUpdateJobsResponse} message BatchUpdateJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchUpdateJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.BatchUpdateJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.BatchUpdateJobsResponse} BatchUpdateJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateJobsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.BatchUpdateJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.jobResults && message.jobResults.length)) + message.jobResults = []; + message.jobResults.push($root.google.cloud.talent.v4.JobResult.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchUpdateJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.BatchUpdateJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.BatchUpdateJobsResponse} BatchUpdateJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchUpdateJobsResponse message. + * @function verify + * @memberof google.cloud.talent.v4.BatchUpdateJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchUpdateJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobResults != null && message.hasOwnProperty("jobResults")) { + if (!Array.isArray(message.jobResults)) + return "jobResults: array expected"; + for (var i = 0; i < message.jobResults.length; ++i) { + var error = $root.google.cloud.talent.v4.JobResult.verify(message.jobResults[i]); + if (error) + return "jobResults." + error; + } + } + return null; + }; + + /** + * Creates a BatchUpdateJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.BatchUpdateJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.BatchUpdateJobsResponse} BatchUpdateJobsResponse + */ + BatchUpdateJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.BatchUpdateJobsResponse) + return object; + var message = new $root.google.cloud.talent.v4.BatchUpdateJobsResponse(); + if (object.jobResults) { + if (!Array.isArray(object.jobResults)) + throw TypeError(".google.cloud.talent.v4.BatchUpdateJobsResponse.jobResults: array expected"); + message.jobResults = []; + for (var i = 0; i < object.jobResults.length; ++i) { + if (typeof object.jobResults[i] !== "object") + throw TypeError(".google.cloud.talent.v4.BatchUpdateJobsResponse.jobResults: object expected"); + message.jobResults[i] = $root.google.cloud.talent.v4.JobResult.fromObject(object.jobResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchUpdateJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.BatchUpdateJobsResponse + * @static + * @param {google.cloud.talent.v4.BatchUpdateJobsResponse} message BatchUpdateJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchUpdateJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jobResults = []; + if (message.jobResults && message.jobResults.length) { + object.jobResults = []; + for (var j = 0; j < message.jobResults.length; ++j) + object.jobResults[j] = $root.google.cloud.talent.v4.JobResult.toObject(message.jobResults[j], options); + } + return object; + }; + + /** + * Converts this BatchUpdateJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.BatchUpdateJobsResponse + * @instance + * @returns {Object.} JSON object + */ + BatchUpdateJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchUpdateJobsResponse + * @function getTypeUrl + * @memberof google.cloud.talent.v4.BatchUpdateJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchUpdateJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.BatchUpdateJobsResponse"; + }; + + return BatchUpdateJobsResponse; + })(); + + v4.BatchDeleteJobsResponse = (function() { + + /** + * Properties of a BatchDeleteJobsResponse. + * @memberof google.cloud.talent.v4 + * @interface IBatchDeleteJobsResponse + * @property {Array.|null} [jobResults] BatchDeleteJobsResponse jobResults + */ + + /** + * Constructs a new BatchDeleteJobsResponse. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a BatchDeleteJobsResponse. + * @implements IBatchDeleteJobsResponse + * @constructor + * @param {google.cloud.talent.v4.IBatchDeleteJobsResponse=} [properties] Properties to set + */ + function BatchDeleteJobsResponse(properties) { + this.jobResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDeleteJobsResponse jobResults. + * @member {Array.} jobResults + * @memberof google.cloud.talent.v4.BatchDeleteJobsResponse + * @instance + */ + BatchDeleteJobsResponse.prototype.jobResults = $util.emptyArray; + + /** + * Creates a new BatchDeleteJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.BatchDeleteJobsResponse + * @static + * @param {google.cloud.talent.v4.IBatchDeleteJobsResponse=} [properties] Properties to set + * @returns {google.cloud.talent.v4.BatchDeleteJobsResponse} BatchDeleteJobsResponse instance + */ + BatchDeleteJobsResponse.create = function create(properties) { + return new BatchDeleteJobsResponse(properties); + }; + + /** + * Encodes the specified BatchDeleteJobsResponse message. Does not implicitly {@link google.cloud.talent.v4.BatchDeleteJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.BatchDeleteJobsResponse + * @static + * @param {google.cloud.talent.v4.IBatchDeleteJobsResponse} message BatchDeleteJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobResults != null && message.jobResults.length) + for (var i = 0; i < message.jobResults.length; ++i) + $root.google.cloud.talent.v4.JobResult.encode(message.jobResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchDeleteJobsResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4.BatchDeleteJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.BatchDeleteJobsResponse + * @static + * @param {google.cloud.talent.v4.IBatchDeleteJobsResponse} message BatchDeleteJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDeleteJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.BatchDeleteJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.BatchDeleteJobsResponse} BatchDeleteJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteJobsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.BatchDeleteJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.jobResults && message.jobResults.length)) + message.jobResults = []; + message.jobResults.push($root.google.cloud.talent.v4.JobResult.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDeleteJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.BatchDeleteJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.BatchDeleteJobsResponse} BatchDeleteJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDeleteJobsResponse message. + * @function verify + * @memberof google.cloud.talent.v4.BatchDeleteJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobResults != null && message.hasOwnProperty("jobResults")) { + if (!Array.isArray(message.jobResults)) + return "jobResults: array expected"; + for (var i = 0; i < message.jobResults.length; ++i) { + var error = $root.google.cloud.talent.v4.JobResult.verify(message.jobResults[i]); + if (error) + return "jobResults." + error; + } + } + return null; + }; + + /** + * Creates a BatchDeleteJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.BatchDeleteJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.BatchDeleteJobsResponse} BatchDeleteJobsResponse + */ + BatchDeleteJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.BatchDeleteJobsResponse) + return object; + var message = new $root.google.cloud.talent.v4.BatchDeleteJobsResponse(); + if (object.jobResults) { + if (!Array.isArray(object.jobResults)) + throw TypeError(".google.cloud.talent.v4.BatchDeleteJobsResponse.jobResults: array expected"); + message.jobResults = []; + for (var i = 0; i < object.jobResults.length; ++i) { + if (typeof object.jobResults[i] !== "object") + throw TypeError(".google.cloud.talent.v4.BatchDeleteJobsResponse.jobResults: object expected"); + message.jobResults[i] = $root.google.cloud.talent.v4.JobResult.fromObject(object.jobResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchDeleteJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.BatchDeleteJobsResponse + * @static + * @param {google.cloud.talent.v4.BatchDeleteJobsResponse} message BatchDeleteJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jobResults = []; + if (message.jobResults && message.jobResults.length) { + object.jobResults = []; + for (var j = 0; j < message.jobResults.length; ++j) + object.jobResults[j] = $root.google.cloud.talent.v4.JobResult.toObject(message.jobResults[j], options); + } + return object; + }; + + /** + * Converts this BatchDeleteJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.BatchDeleteJobsResponse + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDeleteJobsResponse + * @function getTypeUrl + * @memberof google.cloud.talent.v4.BatchDeleteJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDeleteJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.BatchDeleteJobsResponse"; + }; + + return BatchDeleteJobsResponse; + })(); + + v4.Tenant = (function() { + + /** + * Properties of a Tenant. + * @memberof google.cloud.talent.v4 + * @interface ITenant + * @property {string|null} [name] Tenant name + * @property {string|null} [externalId] Tenant externalId + */ + + /** + * Constructs a new Tenant. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a Tenant. + * @implements ITenant + * @constructor + * @param {google.cloud.talent.v4.ITenant=} [properties] Properties to set + */ + function Tenant(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tenant name. + * @member {string} name + * @memberof google.cloud.talent.v4.Tenant + * @instance + */ + Tenant.prototype.name = ""; + + /** + * Tenant externalId. + * @member {string} externalId + * @memberof google.cloud.talent.v4.Tenant + * @instance + */ + Tenant.prototype.externalId = ""; + + /** + * Creates a new Tenant instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.Tenant + * @static + * @param {google.cloud.talent.v4.ITenant=} [properties] Properties to set + * @returns {google.cloud.talent.v4.Tenant} Tenant instance + */ + Tenant.create = function create(properties) { + return new Tenant(properties); + }; + + /** + * Encodes the specified Tenant message. Does not implicitly {@link google.cloud.talent.v4.Tenant.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.Tenant + * @static + * @param {google.cloud.talent.v4.ITenant} message Tenant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tenant.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.externalId != null && Object.hasOwnProperty.call(message, "externalId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.externalId); + return writer; + }; + + /** + * Encodes the specified Tenant message, length delimited. Does not implicitly {@link google.cloud.talent.v4.Tenant.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.Tenant + * @static + * @param {google.cloud.talent.v4.ITenant} message Tenant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tenant.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tenant message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.Tenant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.Tenant} Tenant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tenant.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.Tenant(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.externalId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tenant message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.Tenant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.Tenant} Tenant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tenant.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tenant message. + * @function verify + * @memberof google.cloud.talent.v4.Tenant + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tenant.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.externalId != null && message.hasOwnProperty("externalId")) + if (!$util.isString(message.externalId)) + return "externalId: string expected"; + return null; + }; + + /** + * Creates a Tenant message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.Tenant + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.Tenant} Tenant + */ + Tenant.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.Tenant) + return object; + var message = new $root.google.cloud.talent.v4.Tenant(); + if (object.name != null) + message.name = String(object.name); + if (object.externalId != null) + message.externalId = String(object.externalId); + return message; + }; + + /** + * Creates a plain object from a Tenant message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.Tenant + * @static + * @param {google.cloud.talent.v4.Tenant} message Tenant + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tenant.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.externalId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.externalId != null && message.hasOwnProperty("externalId")) + object.externalId = message.externalId; + return object; + }; + + /** + * Converts this Tenant to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.Tenant + * @instance + * @returns {Object.} JSON object + */ + Tenant.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Tenant + * @function getTypeUrl + * @memberof google.cloud.talent.v4.Tenant + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Tenant.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.Tenant"; + }; + + return Tenant; + })(); + + v4.TenantService = (function() { + + /** + * Constructs a new TenantService service. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a TenantService + * @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 TenantService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TenantService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TenantService; + + /** + * Creates new TenantService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.talent.v4.TenantService + * @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 {TenantService} RPC service. Useful where requests and/or responses are streamed. + */ + TenantService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.talent.v4.TenantService|createTenant}. + * @memberof google.cloud.talent.v4.TenantService + * @typedef CreateTenantCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4.Tenant} [response] Tenant + */ + + /** + * Calls CreateTenant. + * @function createTenant + * @memberof google.cloud.talent.v4.TenantService + * @instance + * @param {google.cloud.talent.v4.ICreateTenantRequest} request CreateTenantRequest message or plain object + * @param {google.cloud.talent.v4.TenantService.CreateTenantCallback} callback Node-style callback called with the error, if any, and Tenant + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TenantService.prototype.createTenant = function createTenant(request, callback) { + return this.rpcCall(createTenant, $root.google.cloud.talent.v4.CreateTenantRequest, $root.google.cloud.talent.v4.Tenant, request, callback); + }, "name", { value: "CreateTenant" }); + + /** + * Calls CreateTenant. + * @function createTenant + * @memberof google.cloud.talent.v4.TenantService + * @instance + * @param {google.cloud.talent.v4.ICreateTenantRequest} request CreateTenantRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4.TenantService|getTenant}. + * @memberof google.cloud.talent.v4.TenantService + * @typedef GetTenantCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4.Tenant} [response] Tenant + */ + + /** + * Calls GetTenant. + * @function getTenant + * @memberof google.cloud.talent.v4.TenantService + * @instance + * @param {google.cloud.talent.v4.IGetTenantRequest} request GetTenantRequest message or plain object + * @param {google.cloud.talent.v4.TenantService.GetTenantCallback} callback Node-style callback called with the error, if any, and Tenant + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TenantService.prototype.getTenant = function getTenant(request, callback) { + return this.rpcCall(getTenant, $root.google.cloud.talent.v4.GetTenantRequest, $root.google.cloud.talent.v4.Tenant, request, callback); + }, "name", { value: "GetTenant" }); + + /** + * Calls GetTenant. + * @function getTenant + * @memberof google.cloud.talent.v4.TenantService + * @instance + * @param {google.cloud.talent.v4.IGetTenantRequest} request GetTenantRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4.TenantService|updateTenant}. + * @memberof google.cloud.talent.v4.TenantService + * @typedef UpdateTenantCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4.Tenant} [response] Tenant + */ + + /** + * Calls UpdateTenant. + * @function updateTenant + * @memberof google.cloud.talent.v4.TenantService + * @instance + * @param {google.cloud.talent.v4.IUpdateTenantRequest} request UpdateTenantRequest message or plain object + * @param {google.cloud.talent.v4.TenantService.UpdateTenantCallback} callback Node-style callback called with the error, if any, and Tenant + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TenantService.prototype.updateTenant = function updateTenant(request, callback) { + return this.rpcCall(updateTenant, $root.google.cloud.talent.v4.UpdateTenantRequest, $root.google.cloud.talent.v4.Tenant, request, callback); + }, "name", { value: "UpdateTenant" }); + + /** + * Calls UpdateTenant. + * @function updateTenant + * @memberof google.cloud.talent.v4.TenantService + * @instance + * @param {google.cloud.talent.v4.IUpdateTenantRequest} request UpdateTenantRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4.TenantService|deleteTenant}. + * @memberof google.cloud.talent.v4.TenantService + * @typedef DeleteTenantCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTenant. + * @function deleteTenant + * @memberof google.cloud.talent.v4.TenantService + * @instance + * @param {google.cloud.talent.v4.IDeleteTenantRequest} request DeleteTenantRequest message or plain object + * @param {google.cloud.talent.v4.TenantService.DeleteTenantCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TenantService.prototype.deleteTenant = function deleteTenant(request, callback) { + return this.rpcCall(deleteTenant, $root.google.cloud.talent.v4.DeleteTenantRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTenant" }); + + /** + * Calls DeleteTenant. + * @function deleteTenant + * @memberof google.cloud.talent.v4.TenantService + * @instance + * @param {google.cloud.talent.v4.IDeleteTenantRequest} request DeleteTenantRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4.TenantService|listTenants}. + * @memberof google.cloud.talent.v4.TenantService + * @typedef ListTenantsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4.ListTenantsResponse} [response] ListTenantsResponse + */ + + /** + * Calls ListTenants. + * @function listTenants + * @memberof google.cloud.talent.v4.TenantService + * @instance + * @param {google.cloud.talent.v4.IListTenantsRequest} request ListTenantsRequest message or plain object + * @param {google.cloud.talent.v4.TenantService.ListTenantsCallback} callback Node-style callback called with the error, if any, and ListTenantsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TenantService.prototype.listTenants = function listTenants(request, callback) { + return this.rpcCall(listTenants, $root.google.cloud.talent.v4.ListTenantsRequest, $root.google.cloud.talent.v4.ListTenantsResponse, request, callback); + }, "name", { value: "ListTenants" }); + + /** + * Calls ListTenants. + * @function listTenants + * @memberof google.cloud.talent.v4.TenantService + * @instance + * @param {google.cloud.talent.v4.IListTenantsRequest} request ListTenantsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TenantService; + })(); + + v4.CreateTenantRequest = (function() { + + /** + * Properties of a CreateTenantRequest. + * @memberof google.cloud.talent.v4 + * @interface ICreateTenantRequest + * @property {string|null} [parent] CreateTenantRequest parent + * @property {google.cloud.talent.v4.ITenant|null} [tenant] CreateTenantRequest tenant + */ + + /** + * Constructs a new CreateTenantRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a CreateTenantRequest. + * @implements ICreateTenantRequest + * @constructor + * @param {google.cloud.talent.v4.ICreateTenantRequest=} [properties] Properties to set + */ + function CreateTenantRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTenantRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4.CreateTenantRequest + * @instance + */ + CreateTenantRequest.prototype.parent = ""; + + /** + * CreateTenantRequest tenant. + * @member {google.cloud.talent.v4.ITenant|null|undefined} tenant + * @memberof google.cloud.talent.v4.CreateTenantRequest + * @instance + */ + CreateTenantRequest.prototype.tenant = null; + + /** + * Creates a new CreateTenantRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.CreateTenantRequest + * @static + * @param {google.cloud.talent.v4.ICreateTenantRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.CreateTenantRequest} CreateTenantRequest instance + */ + CreateTenantRequest.create = function create(properties) { + return new CreateTenantRequest(properties); + }; + + /** + * Encodes the specified CreateTenantRequest message. Does not implicitly {@link google.cloud.talent.v4.CreateTenantRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.CreateTenantRequest + * @static + * @param {google.cloud.talent.v4.ICreateTenantRequest} message CreateTenantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTenantRequest.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.tenant != null && Object.hasOwnProperty.call(message, "tenant")) + $root.google.cloud.talent.v4.Tenant.encode(message.tenant, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateTenantRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.CreateTenantRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.CreateTenantRequest + * @static + * @param {google.cloud.talent.v4.ICreateTenantRequest} message CreateTenantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTenantRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTenantRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.CreateTenantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.CreateTenantRequest} CreateTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTenantRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.CreateTenantRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.tenant = $root.google.cloud.talent.v4.Tenant.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTenantRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.CreateTenantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.CreateTenantRequest} CreateTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTenantRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTenantRequest message. + * @function verify + * @memberof google.cloud.talent.v4.CreateTenantRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTenantRequest.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.tenant != null && message.hasOwnProperty("tenant")) { + var error = $root.google.cloud.talent.v4.Tenant.verify(message.tenant); + if (error) + return "tenant." + error; + } + return null; + }; + + /** + * Creates a CreateTenantRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.CreateTenantRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.CreateTenantRequest} CreateTenantRequest + */ + CreateTenantRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.CreateTenantRequest) + return object; + var message = new $root.google.cloud.talent.v4.CreateTenantRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tenant != null) { + if (typeof object.tenant !== "object") + throw TypeError(".google.cloud.talent.v4.CreateTenantRequest.tenant: object expected"); + message.tenant = $root.google.cloud.talent.v4.Tenant.fromObject(object.tenant); + } + return message; + }; + + /** + * Creates a plain object from a CreateTenantRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.CreateTenantRequest + * @static + * @param {google.cloud.talent.v4.CreateTenantRequest} message CreateTenantRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTenantRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.tenant = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tenant != null && message.hasOwnProperty("tenant")) + object.tenant = $root.google.cloud.talent.v4.Tenant.toObject(message.tenant, options); + return object; + }; + + /** + * Converts this CreateTenantRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.CreateTenantRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTenantRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTenantRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.CreateTenantRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTenantRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.CreateTenantRequest"; + }; + + return CreateTenantRequest; + })(); + + v4.GetTenantRequest = (function() { + + /** + * Properties of a GetTenantRequest. + * @memberof google.cloud.talent.v4 + * @interface IGetTenantRequest + * @property {string|null} [name] GetTenantRequest name + */ + + /** + * Constructs a new GetTenantRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a GetTenantRequest. + * @implements IGetTenantRequest + * @constructor + * @param {google.cloud.talent.v4.IGetTenantRequest=} [properties] Properties to set + */ + function GetTenantRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTenantRequest name. + * @member {string} name + * @memberof google.cloud.talent.v4.GetTenantRequest + * @instance + */ + GetTenantRequest.prototype.name = ""; + + /** + * Creates a new GetTenantRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.GetTenantRequest + * @static + * @param {google.cloud.talent.v4.IGetTenantRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.GetTenantRequest} GetTenantRequest instance + */ + GetTenantRequest.create = function create(properties) { + return new GetTenantRequest(properties); + }; + + /** + * Encodes the specified GetTenantRequest message. Does not implicitly {@link google.cloud.talent.v4.GetTenantRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.GetTenantRequest + * @static + * @param {google.cloud.talent.v4.IGetTenantRequest} message GetTenantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTenantRequest.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 GetTenantRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.GetTenantRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.GetTenantRequest + * @static + * @param {google.cloud.talent.v4.IGetTenantRequest} message GetTenantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTenantRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTenantRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.GetTenantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.GetTenantRequest} GetTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTenantRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.GetTenantRequest(); + 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 GetTenantRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.GetTenantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.GetTenantRequest} GetTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTenantRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTenantRequest message. + * @function verify + * @memberof google.cloud.talent.v4.GetTenantRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTenantRequest.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 GetTenantRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.GetTenantRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.GetTenantRequest} GetTenantRequest + */ + GetTenantRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.GetTenantRequest) + return object; + var message = new $root.google.cloud.talent.v4.GetTenantRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTenantRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.GetTenantRequest + * @static + * @param {google.cloud.talent.v4.GetTenantRequest} message GetTenantRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTenantRequest.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 GetTenantRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.GetTenantRequest + * @instance + * @returns {Object.} JSON object + */ + GetTenantRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTenantRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.GetTenantRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTenantRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.GetTenantRequest"; + }; + + return GetTenantRequest; + })(); + + v4.UpdateTenantRequest = (function() { + + /** + * Properties of an UpdateTenantRequest. + * @memberof google.cloud.talent.v4 + * @interface IUpdateTenantRequest + * @property {google.cloud.talent.v4.ITenant|null} [tenant] UpdateTenantRequest tenant + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTenantRequest updateMask + */ + + /** + * Constructs a new UpdateTenantRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents an UpdateTenantRequest. + * @implements IUpdateTenantRequest + * @constructor + * @param {google.cloud.talent.v4.IUpdateTenantRequest=} [properties] Properties to set + */ + function UpdateTenantRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTenantRequest tenant. + * @member {google.cloud.talent.v4.ITenant|null|undefined} tenant + * @memberof google.cloud.talent.v4.UpdateTenantRequest + * @instance + */ + UpdateTenantRequest.prototype.tenant = null; + + /** + * UpdateTenantRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.talent.v4.UpdateTenantRequest + * @instance + */ + UpdateTenantRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateTenantRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.UpdateTenantRequest + * @static + * @param {google.cloud.talent.v4.IUpdateTenantRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.UpdateTenantRequest} UpdateTenantRequest instance + */ + UpdateTenantRequest.create = function create(properties) { + return new UpdateTenantRequest(properties); + }; + + /** + * Encodes the specified UpdateTenantRequest message. Does not implicitly {@link google.cloud.talent.v4.UpdateTenantRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.UpdateTenantRequest + * @static + * @param {google.cloud.talent.v4.IUpdateTenantRequest} message UpdateTenantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTenantRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tenant != null && Object.hasOwnProperty.call(message, "tenant")) + $root.google.cloud.talent.v4.Tenant.encode(message.tenant, 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 UpdateTenantRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.UpdateTenantRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.UpdateTenantRequest + * @static + * @param {google.cloud.talent.v4.IUpdateTenantRequest} message UpdateTenantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTenantRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTenantRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.UpdateTenantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.UpdateTenantRequest} UpdateTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTenantRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.UpdateTenantRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tenant = $root.google.cloud.talent.v4.Tenant.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 UpdateTenantRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.UpdateTenantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.UpdateTenantRequest} UpdateTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTenantRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTenantRequest message. + * @function verify + * @memberof google.cloud.talent.v4.UpdateTenantRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTenantRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tenant != null && message.hasOwnProperty("tenant")) { + var error = $root.google.cloud.talent.v4.Tenant.verify(message.tenant); + if (error) + return "tenant." + 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 UpdateTenantRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.UpdateTenantRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.UpdateTenantRequest} UpdateTenantRequest + */ + UpdateTenantRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.UpdateTenantRequest) + return object; + var message = new $root.google.cloud.talent.v4.UpdateTenantRequest(); + if (object.tenant != null) { + if (typeof object.tenant !== "object") + throw TypeError(".google.cloud.talent.v4.UpdateTenantRequest.tenant: object expected"); + message.tenant = $root.google.cloud.talent.v4.Tenant.fromObject(object.tenant); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.talent.v4.UpdateTenantRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateTenantRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.UpdateTenantRequest + * @static + * @param {google.cloud.talent.v4.UpdateTenantRequest} message UpdateTenantRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTenantRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tenant = null; + object.updateMask = null; + } + if (message.tenant != null && message.hasOwnProperty("tenant")) + object.tenant = $root.google.cloud.talent.v4.Tenant.toObject(message.tenant, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateTenantRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.UpdateTenantRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTenantRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTenantRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.UpdateTenantRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTenantRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.UpdateTenantRequest"; + }; + + return UpdateTenantRequest; + })(); + + v4.DeleteTenantRequest = (function() { + + /** + * Properties of a DeleteTenantRequest. + * @memberof google.cloud.talent.v4 + * @interface IDeleteTenantRequest + * @property {string|null} [name] DeleteTenantRequest name + */ + + /** + * Constructs a new DeleteTenantRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a DeleteTenantRequest. + * @implements IDeleteTenantRequest + * @constructor + * @param {google.cloud.talent.v4.IDeleteTenantRequest=} [properties] Properties to set + */ + function DeleteTenantRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTenantRequest name. + * @member {string} name + * @memberof google.cloud.talent.v4.DeleteTenantRequest + * @instance + */ + DeleteTenantRequest.prototype.name = ""; + + /** + * Creates a new DeleteTenantRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.DeleteTenantRequest + * @static + * @param {google.cloud.talent.v4.IDeleteTenantRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.DeleteTenantRequest} DeleteTenantRequest instance + */ + DeleteTenantRequest.create = function create(properties) { + return new DeleteTenantRequest(properties); + }; + + /** + * Encodes the specified DeleteTenantRequest message. Does not implicitly {@link google.cloud.talent.v4.DeleteTenantRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.DeleteTenantRequest + * @static + * @param {google.cloud.talent.v4.IDeleteTenantRequest} message DeleteTenantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTenantRequest.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 DeleteTenantRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.DeleteTenantRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.DeleteTenantRequest + * @static + * @param {google.cloud.talent.v4.IDeleteTenantRequest} message DeleteTenantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTenantRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTenantRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.DeleteTenantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.DeleteTenantRequest} DeleteTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTenantRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.DeleteTenantRequest(); + 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 DeleteTenantRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.DeleteTenantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.DeleteTenantRequest} DeleteTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTenantRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTenantRequest message. + * @function verify + * @memberof google.cloud.talent.v4.DeleteTenantRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTenantRequest.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 DeleteTenantRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.DeleteTenantRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.DeleteTenantRequest} DeleteTenantRequest + */ + DeleteTenantRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.DeleteTenantRequest) + return object; + var message = new $root.google.cloud.talent.v4.DeleteTenantRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteTenantRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.DeleteTenantRequest + * @static + * @param {google.cloud.talent.v4.DeleteTenantRequest} message DeleteTenantRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTenantRequest.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 DeleteTenantRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.DeleteTenantRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTenantRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTenantRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.DeleteTenantRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTenantRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.DeleteTenantRequest"; + }; + + return DeleteTenantRequest; + })(); + + v4.ListTenantsRequest = (function() { + + /** + * Properties of a ListTenantsRequest. + * @memberof google.cloud.talent.v4 + * @interface IListTenantsRequest + * @property {string|null} [parent] ListTenantsRequest parent + * @property {string|null} [pageToken] ListTenantsRequest pageToken + * @property {number|null} [pageSize] ListTenantsRequest pageSize + */ + + /** + * Constructs a new ListTenantsRequest. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a ListTenantsRequest. + * @implements IListTenantsRequest + * @constructor + * @param {google.cloud.talent.v4.IListTenantsRequest=} [properties] Properties to set + */ + function ListTenantsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTenantsRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4.ListTenantsRequest + * @instance + */ + ListTenantsRequest.prototype.parent = ""; + + /** + * ListTenantsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.talent.v4.ListTenantsRequest + * @instance + */ + ListTenantsRequest.prototype.pageToken = ""; + + /** + * ListTenantsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.talent.v4.ListTenantsRequest + * @instance + */ + ListTenantsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListTenantsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.ListTenantsRequest + * @static + * @param {google.cloud.talent.v4.IListTenantsRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4.ListTenantsRequest} ListTenantsRequest instance + */ + ListTenantsRequest.create = function create(properties) { + return new ListTenantsRequest(properties); + }; + + /** + * Encodes the specified ListTenantsRequest message. Does not implicitly {@link google.cloud.talent.v4.ListTenantsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.ListTenantsRequest + * @static + * @param {google.cloud.talent.v4.IListTenantsRequest} message ListTenantsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTenantsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListTenantsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4.ListTenantsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.ListTenantsRequest + * @static + * @param {google.cloud.talent.v4.IListTenantsRequest} message ListTenantsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTenantsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTenantsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.ListTenantsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.ListTenantsRequest} ListTenantsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTenantsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.ListTenantsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTenantsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.ListTenantsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.ListTenantsRequest} ListTenantsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTenantsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTenantsRequest message. + * @function verify + * @memberof google.cloud.talent.v4.ListTenantsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTenantsRequest.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.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListTenantsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.ListTenantsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.ListTenantsRequest} ListTenantsRequest + */ + ListTenantsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.ListTenantsRequest) + return object; + var message = new $root.google.cloud.talent.v4.ListTenantsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListTenantsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.ListTenantsRequest + * @static + * @param {google.cloud.talent.v4.ListTenantsRequest} message ListTenantsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTenantsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListTenantsRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.ListTenantsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTenantsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTenantsRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4.ListTenantsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTenantsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.ListTenantsRequest"; + }; + + return ListTenantsRequest; + })(); + + v4.ListTenantsResponse = (function() { + + /** + * Properties of a ListTenantsResponse. + * @memberof google.cloud.talent.v4 + * @interface IListTenantsResponse + * @property {Array.|null} [tenants] ListTenantsResponse tenants + * @property {string|null} [nextPageToken] ListTenantsResponse nextPageToken + * @property {google.cloud.talent.v4.IResponseMetadata|null} [metadata] ListTenantsResponse metadata + */ + + /** + * Constructs a new ListTenantsResponse. + * @memberof google.cloud.talent.v4 + * @classdesc Represents a ListTenantsResponse. + * @implements IListTenantsResponse + * @constructor + * @param {google.cloud.talent.v4.IListTenantsResponse=} [properties] Properties to set + */ + function ListTenantsResponse(properties) { + this.tenants = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTenantsResponse tenants. + * @member {Array.} tenants + * @memberof google.cloud.talent.v4.ListTenantsResponse + * @instance + */ + ListTenantsResponse.prototype.tenants = $util.emptyArray; + + /** + * ListTenantsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.talent.v4.ListTenantsResponse + * @instance + */ + ListTenantsResponse.prototype.nextPageToken = ""; + + /** + * ListTenantsResponse metadata. + * @member {google.cloud.talent.v4.IResponseMetadata|null|undefined} metadata + * @memberof google.cloud.talent.v4.ListTenantsResponse + * @instance + */ + ListTenantsResponse.prototype.metadata = null; + + /** + * Creates a new ListTenantsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4.ListTenantsResponse + * @static + * @param {google.cloud.talent.v4.IListTenantsResponse=} [properties] Properties to set + * @returns {google.cloud.talent.v4.ListTenantsResponse} ListTenantsResponse instance + */ + ListTenantsResponse.create = function create(properties) { + return new ListTenantsResponse(properties); + }; + + /** + * Encodes the specified ListTenantsResponse message. Does not implicitly {@link google.cloud.talent.v4.ListTenantsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4.ListTenantsResponse + * @static + * @param {google.cloud.talent.v4.IListTenantsResponse} message ListTenantsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTenantsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tenants != null && message.tenants.length) + for (var i = 0; i < message.tenants.length; ++i) + $root.google.cloud.talent.v4.Tenant.encode(message.tenants[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.talent.v4.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListTenantsResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4.ListTenantsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4.ListTenantsResponse + * @static + * @param {google.cloud.talent.v4.IListTenantsResponse} message ListTenantsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTenantsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTenantsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4.ListTenantsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4.ListTenantsResponse} ListTenantsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTenantsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4.ListTenantsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tenants && message.tenants.length)) + message.tenants = []; + message.tenants.push($root.google.cloud.talent.v4.Tenant.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.metadata = $root.google.cloud.talent.v4.ResponseMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTenantsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4.ListTenantsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4.ListTenantsResponse} ListTenantsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTenantsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTenantsResponse message. + * @function verify + * @memberof google.cloud.talent.v4.ListTenantsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTenantsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tenants != null && message.hasOwnProperty("tenants")) { + if (!Array.isArray(message.tenants)) + return "tenants: array expected"; + for (var i = 0; i < message.tenants.length; ++i) { + var error = $root.google.cloud.talent.v4.Tenant.verify(message.tenants[i]); + if (error) + return "tenants." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.talent.v4.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a ListTenantsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4.ListTenantsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4.ListTenantsResponse} ListTenantsResponse + */ + ListTenantsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4.ListTenantsResponse) + return object; + var message = new $root.google.cloud.talent.v4.ListTenantsResponse(); + if (object.tenants) { + if (!Array.isArray(object.tenants)) + throw TypeError(".google.cloud.talent.v4.ListTenantsResponse.tenants: array expected"); + message.tenants = []; + for (var i = 0; i < object.tenants.length; ++i) { + if (typeof object.tenants[i] !== "object") + throw TypeError(".google.cloud.talent.v4.ListTenantsResponse.tenants: object expected"); + message.tenants[i] = $root.google.cloud.talent.v4.Tenant.fromObject(object.tenants[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.talent.v4.ListTenantsResponse.metadata: object expected"); + message.metadata = $root.google.cloud.talent.v4.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a ListTenantsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4.ListTenantsResponse + * @static + * @param {google.cloud.talent.v4.ListTenantsResponse} message ListTenantsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTenantsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tenants = []; + if (options.defaults) { + object.nextPageToken = ""; + object.metadata = null; + } + if (message.tenants && message.tenants.length) { + object.tenants = []; + for (var j = 0; j < message.tenants.length; ++j) + object.tenants[j] = $root.google.cloud.talent.v4.Tenant.toObject(message.tenants[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.talent.v4.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this ListTenantsResponse to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4.ListTenantsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTenantsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTenantsResponse + * @function getTypeUrl + * @memberof google.cloud.talent.v4.ListTenantsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTenantsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4.ListTenantsResponse"; + }; + + return ListTenantsResponse; + })(); + + return v4; + })(); + + talent.v4beta1 = (function() { + + /** + * Namespace v4beta1. + * @memberof google.cloud.talent + * @namespace + */ + var v4beta1 = {}; + + v4beta1.TimestampRange = (function() { + + /** + * Properties of a TimestampRange. + * @memberof google.cloud.talent.v4beta1 + * @interface ITimestampRange + * @property {google.protobuf.ITimestamp|null} [startTime] TimestampRange startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimestampRange endTime + */ + + /** + * Constructs a new TimestampRange. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a TimestampRange. + * @implements ITimestampRange + * @constructor + * @param {google.cloud.talent.v4beta1.ITimestampRange=} [properties] Properties to set + */ + function TimestampRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimestampRange startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.talent.v4beta1.TimestampRange + * @instance + */ + TimestampRange.prototype.startTime = null; + + /** + * TimestampRange endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.talent.v4beta1.TimestampRange + * @instance + */ + TimestampRange.prototype.endTime = null; + + /** + * Creates a new TimestampRange instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.TimestampRange + * @static + * @param {google.cloud.talent.v4beta1.ITimestampRange=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.TimestampRange} TimestampRange instance + */ + TimestampRange.create = function create(properties) { + return new TimestampRange(properties); + }; + + /** + * Encodes the specified TimestampRange message. Does not implicitly {@link google.cloud.talent.v4beta1.TimestampRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.TimestampRange + * @static + * @param {google.cloud.talent.v4beta1.ITimestampRange} message TimestampRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimestampRange message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.TimestampRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.TimestampRange + * @static + * @param {google.cloud.talent.v4beta1.ITimestampRange} message TimestampRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimestampRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.TimestampRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.TimestampRange} TimestampRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.TimestampRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimestampRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.TimestampRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.TimestampRange} TimestampRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimestampRange message. + * @function verify + * @memberof google.cloud.talent.v4beta1.TimestampRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimestampRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a TimestampRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.TimestampRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.TimestampRange} TimestampRange + */ + TimestampRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.TimestampRange) + return object; + var message = new $root.google.cloud.talent.v4beta1.TimestampRange(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.talent.v4beta1.TimestampRange.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.talent.v4beta1.TimestampRange.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a TimestampRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.TimestampRange + * @static + * @param {google.cloud.talent.v4beta1.TimestampRange} message TimestampRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimestampRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this TimestampRange to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.TimestampRange + * @instance + * @returns {Object.} JSON object + */ + TimestampRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimestampRange + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.TimestampRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.TimestampRange"; + }; + + return TimestampRange; + })(); + + /** + * CompanySize enum. + * @name google.cloud.talent.v4beta1.CompanySize + * @enum {number} + * @property {number} COMPANY_SIZE_UNSPECIFIED=0 COMPANY_SIZE_UNSPECIFIED value + * @property {number} MINI=1 MINI value + * @property {number} SMALL=2 SMALL value + * @property {number} SMEDIUM=3 SMEDIUM value + * @property {number} MEDIUM=4 MEDIUM value + * @property {number} BIG=5 BIG value + * @property {number} BIGGER=6 BIGGER value + * @property {number} GIANT=7 GIANT value + */ + v4beta1.CompanySize = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPANY_SIZE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MINI"] = 1; + values[valuesById[2] = "SMALL"] = 2; + values[valuesById[3] = "SMEDIUM"] = 3; + values[valuesById[4] = "MEDIUM"] = 4; + values[valuesById[5] = "BIG"] = 5; + values[valuesById[6] = "BIGGER"] = 6; + values[valuesById[7] = "GIANT"] = 7; + return values; + })(); + + /** + * JobBenefit enum. + * @name google.cloud.talent.v4beta1.JobBenefit + * @enum {number} + * @property {number} JOB_BENEFIT_UNSPECIFIED=0 JOB_BENEFIT_UNSPECIFIED value + * @property {number} CHILD_CARE=1 CHILD_CARE value + * @property {number} DENTAL=2 DENTAL value + * @property {number} DOMESTIC_PARTNER=3 DOMESTIC_PARTNER value + * @property {number} FLEXIBLE_HOURS=4 FLEXIBLE_HOURS value + * @property {number} MEDICAL=5 MEDICAL value + * @property {number} LIFE_INSURANCE=6 LIFE_INSURANCE value + * @property {number} PARENTAL_LEAVE=7 PARENTAL_LEAVE value + * @property {number} RETIREMENT_PLAN=8 RETIREMENT_PLAN value + * @property {number} SICK_DAYS=9 SICK_DAYS value + * @property {number} VACATION=10 VACATION value + * @property {number} VISION=11 VISION value + */ + v4beta1.JobBenefit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_BENEFIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "CHILD_CARE"] = 1; + values[valuesById[2] = "DENTAL"] = 2; + values[valuesById[3] = "DOMESTIC_PARTNER"] = 3; + values[valuesById[4] = "FLEXIBLE_HOURS"] = 4; + values[valuesById[5] = "MEDICAL"] = 5; + values[valuesById[6] = "LIFE_INSURANCE"] = 6; + values[valuesById[7] = "PARENTAL_LEAVE"] = 7; + values[valuesById[8] = "RETIREMENT_PLAN"] = 8; + values[valuesById[9] = "SICK_DAYS"] = 9; + values[valuesById[10] = "VACATION"] = 10; + values[valuesById[11] = "VISION"] = 11; + return values; + })(); + + /** + * DegreeType enum. + * @name google.cloud.talent.v4beta1.DegreeType + * @enum {number} + * @property {number} DEGREE_TYPE_UNSPECIFIED=0 DEGREE_TYPE_UNSPECIFIED value + * @property {number} PRIMARY_EDUCATION=1 PRIMARY_EDUCATION value + * @property {number} LOWER_SECONDARY_EDUCATION=2 LOWER_SECONDARY_EDUCATION value + * @property {number} UPPER_SECONDARY_EDUCATION=3 UPPER_SECONDARY_EDUCATION value + * @property {number} ADULT_REMEDIAL_EDUCATION=4 ADULT_REMEDIAL_EDUCATION value + * @property {number} ASSOCIATES_OR_EQUIVALENT=5 ASSOCIATES_OR_EQUIVALENT value + * @property {number} BACHELORS_OR_EQUIVALENT=6 BACHELORS_OR_EQUIVALENT value + * @property {number} MASTERS_OR_EQUIVALENT=7 MASTERS_OR_EQUIVALENT value + * @property {number} DOCTORAL_OR_EQUIVALENT=8 DOCTORAL_OR_EQUIVALENT value + */ + v4beta1.DegreeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEGREE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIMARY_EDUCATION"] = 1; + values[valuesById[2] = "LOWER_SECONDARY_EDUCATION"] = 2; + values[valuesById[3] = "UPPER_SECONDARY_EDUCATION"] = 3; + values[valuesById[4] = "ADULT_REMEDIAL_EDUCATION"] = 4; + values[valuesById[5] = "ASSOCIATES_OR_EQUIVALENT"] = 5; + values[valuesById[6] = "BACHELORS_OR_EQUIVALENT"] = 6; + values[valuesById[7] = "MASTERS_OR_EQUIVALENT"] = 7; + values[valuesById[8] = "DOCTORAL_OR_EQUIVALENT"] = 8; + return values; + })(); + + /** + * EmploymentType enum. + * @name google.cloud.talent.v4beta1.EmploymentType + * @enum {number} + * @property {number} EMPLOYMENT_TYPE_UNSPECIFIED=0 EMPLOYMENT_TYPE_UNSPECIFIED value + * @property {number} FULL_TIME=1 FULL_TIME value + * @property {number} PART_TIME=2 PART_TIME value + * @property {number} CONTRACTOR=3 CONTRACTOR value + * @property {number} CONTRACT_TO_HIRE=4 CONTRACT_TO_HIRE value + * @property {number} TEMPORARY=5 TEMPORARY value + * @property {number} INTERN=6 INTERN value + * @property {number} VOLUNTEER=7 VOLUNTEER value + * @property {number} PER_DIEM=8 PER_DIEM value + * @property {number} FLY_IN_FLY_OUT=9 FLY_IN_FLY_OUT value + * @property {number} OTHER_EMPLOYMENT_TYPE=10 OTHER_EMPLOYMENT_TYPE value + */ + v4beta1.EmploymentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EMPLOYMENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FULL_TIME"] = 1; + values[valuesById[2] = "PART_TIME"] = 2; + values[valuesById[3] = "CONTRACTOR"] = 3; + values[valuesById[4] = "CONTRACT_TO_HIRE"] = 4; + values[valuesById[5] = "TEMPORARY"] = 5; + values[valuesById[6] = "INTERN"] = 6; + values[valuesById[7] = "VOLUNTEER"] = 7; + values[valuesById[8] = "PER_DIEM"] = 8; + values[valuesById[9] = "FLY_IN_FLY_OUT"] = 9; + values[valuesById[10] = "OTHER_EMPLOYMENT_TYPE"] = 10; + return values; + })(); + + /** + * JobLevel enum. + * @name google.cloud.talent.v4beta1.JobLevel + * @enum {number} + * @property {number} JOB_LEVEL_UNSPECIFIED=0 JOB_LEVEL_UNSPECIFIED value + * @property {number} ENTRY_LEVEL=1 ENTRY_LEVEL value + * @property {number} EXPERIENCED=2 EXPERIENCED value + * @property {number} MANAGER=3 MANAGER value + * @property {number} DIRECTOR=4 DIRECTOR value + * @property {number} EXECUTIVE=5 EXECUTIVE value + */ + v4beta1.JobLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENTRY_LEVEL"] = 1; + values[valuesById[2] = "EXPERIENCED"] = 2; + values[valuesById[3] = "MANAGER"] = 3; + values[valuesById[4] = "DIRECTOR"] = 4; + values[valuesById[5] = "EXECUTIVE"] = 5; + return values; + })(); + + /** + * JobCategory enum. + * @name google.cloud.talent.v4beta1.JobCategory + * @enum {number} + * @property {number} JOB_CATEGORY_UNSPECIFIED=0 JOB_CATEGORY_UNSPECIFIED value + * @property {number} ACCOUNTING_AND_FINANCE=1 ACCOUNTING_AND_FINANCE value + * @property {number} ADMINISTRATIVE_AND_OFFICE=2 ADMINISTRATIVE_AND_OFFICE value + * @property {number} ADVERTISING_AND_MARKETING=3 ADVERTISING_AND_MARKETING value + * @property {number} ANIMAL_CARE=4 ANIMAL_CARE value + * @property {number} ART_FASHION_AND_DESIGN=5 ART_FASHION_AND_DESIGN value + * @property {number} BUSINESS_OPERATIONS=6 BUSINESS_OPERATIONS value + * @property {number} CLEANING_AND_FACILITIES=7 CLEANING_AND_FACILITIES value + * @property {number} COMPUTER_AND_IT=8 COMPUTER_AND_IT value + * @property {number} CONSTRUCTION=9 CONSTRUCTION value + * @property {number} CUSTOMER_SERVICE=10 CUSTOMER_SERVICE value + * @property {number} EDUCATION=11 EDUCATION value + * @property {number} ENTERTAINMENT_AND_TRAVEL=12 ENTERTAINMENT_AND_TRAVEL value + * @property {number} FARMING_AND_OUTDOORS=13 FARMING_AND_OUTDOORS value + * @property {number} HEALTHCARE=14 HEALTHCARE value + * @property {number} HUMAN_RESOURCES=15 HUMAN_RESOURCES value + * @property {number} INSTALLATION_MAINTENANCE_AND_REPAIR=16 INSTALLATION_MAINTENANCE_AND_REPAIR value + * @property {number} LEGAL=17 LEGAL value + * @property {number} MANAGEMENT=18 MANAGEMENT value + * @property {number} MANUFACTURING_AND_WAREHOUSE=19 MANUFACTURING_AND_WAREHOUSE value + * @property {number} MEDIA_COMMUNICATIONS_AND_WRITING=20 MEDIA_COMMUNICATIONS_AND_WRITING value + * @property {number} OIL_GAS_AND_MINING=21 OIL_GAS_AND_MINING value + * @property {number} PERSONAL_CARE_AND_SERVICES=22 PERSONAL_CARE_AND_SERVICES value + * @property {number} PROTECTIVE_SERVICES=23 PROTECTIVE_SERVICES value + * @property {number} REAL_ESTATE=24 REAL_ESTATE value + * @property {number} RESTAURANT_AND_HOSPITALITY=25 RESTAURANT_AND_HOSPITALITY value + * @property {number} SALES_AND_RETAIL=26 SALES_AND_RETAIL value + * @property {number} SCIENCE_AND_ENGINEERING=27 SCIENCE_AND_ENGINEERING value + * @property {number} SOCIAL_SERVICES_AND_NON_PROFIT=28 SOCIAL_SERVICES_AND_NON_PROFIT value + * @property {number} SPORTS_FITNESS_AND_RECREATION=29 SPORTS_FITNESS_AND_RECREATION value + * @property {number} TRANSPORTATION_AND_LOGISTICS=30 TRANSPORTATION_AND_LOGISTICS value + */ + v4beta1.JobCategory = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_CATEGORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACCOUNTING_AND_FINANCE"] = 1; + values[valuesById[2] = "ADMINISTRATIVE_AND_OFFICE"] = 2; + values[valuesById[3] = "ADVERTISING_AND_MARKETING"] = 3; + values[valuesById[4] = "ANIMAL_CARE"] = 4; + values[valuesById[5] = "ART_FASHION_AND_DESIGN"] = 5; + values[valuesById[6] = "BUSINESS_OPERATIONS"] = 6; + values[valuesById[7] = "CLEANING_AND_FACILITIES"] = 7; + values[valuesById[8] = "COMPUTER_AND_IT"] = 8; + values[valuesById[9] = "CONSTRUCTION"] = 9; + values[valuesById[10] = "CUSTOMER_SERVICE"] = 10; + values[valuesById[11] = "EDUCATION"] = 11; + values[valuesById[12] = "ENTERTAINMENT_AND_TRAVEL"] = 12; + values[valuesById[13] = "FARMING_AND_OUTDOORS"] = 13; + values[valuesById[14] = "HEALTHCARE"] = 14; + values[valuesById[15] = "HUMAN_RESOURCES"] = 15; + values[valuesById[16] = "INSTALLATION_MAINTENANCE_AND_REPAIR"] = 16; + values[valuesById[17] = "LEGAL"] = 17; + values[valuesById[18] = "MANAGEMENT"] = 18; + values[valuesById[19] = "MANUFACTURING_AND_WAREHOUSE"] = 19; + values[valuesById[20] = "MEDIA_COMMUNICATIONS_AND_WRITING"] = 20; + values[valuesById[21] = "OIL_GAS_AND_MINING"] = 21; + values[valuesById[22] = "PERSONAL_CARE_AND_SERVICES"] = 22; + values[valuesById[23] = "PROTECTIVE_SERVICES"] = 23; + values[valuesById[24] = "REAL_ESTATE"] = 24; + values[valuesById[25] = "RESTAURANT_AND_HOSPITALITY"] = 25; + values[valuesById[26] = "SALES_AND_RETAIL"] = 26; + values[valuesById[27] = "SCIENCE_AND_ENGINEERING"] = 27; + values[valuesById[28] = "SOCIAL_SERVICES_AND_NON_PROFIT"] = 28; + values[valuesById[29] = "SPORTS_FITNESS_AND_RECREATION"] = 29; + values[valuesById[30] = "TRANSPORTATION_AND_LOGISTICS"] = 30; + return values; + })(); + + /** + * PostingRegion enum. + * @name google.cloud.talent.v4beta1.PostingRegion + * @enum {number} + * @property {number} POSTING_REGION_UNSPECIFIED=0 POSTING_REGION_UNSPECIFIED value + * @property {number} ADMINISTRATIVE_AREA=1 ADMINISTRATIVE_AREA value + * @property {number} NATION=2 NATION value + * @property {number} TELECOMMUTE=3 TELECOMMUTE value + */ + v4beta1.PostingRegion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "POSTING_REGION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMINISTRATIVE_AREA"] = 1; + values[valuesById[2] = "NATION"] = 2; + values[valuesById[3] = "TELECOMMUTE"] = 3; + return values; + })(); + + /** + * Visibility enum. + * @name google.cloud.talent.v4beta1.Visibility + * @enum {number} + * @property {number} VISIBILITY_UNSPECIFIED=0 VISIBILITY_UNSPECIFIED value + * @property {number} ACCOUNT_ONLY=1 ACCOUNT_ONLY value + * @property {number} SHARED_WITH_GOOGLE=2 SHARED_WITH_GOOGLE value + * @property {number} SHARED_WITH_PUBLIC=3 SHARED_WITH_PUBLIC value + */ + v4beta1.Visibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACCOUNT_ONLY"] = 1; + values[valuesById[2] = "SHARED_WITH_GOOGLE"] = 2; + values[valuesById[3] = "SHARED_WITH_PUBLIC"] = 3; + return values; + })(); + + /** + * HtmlSanitization enum. + * @name google.cloud.talent.v4beta1.HtmlSanitization + * @enum {number} + * @property {number} HTML_SANITIZATION_UNSPECIFIED=0 HTML_SANITIZATION_UNSPECIFIED value + * @property {number} HTML_SANITIZATION_DISABLED=1 HTML_SANITIZATION_DISABLED value + * @property {number} SIMPLE_FORMATTING_ONLY=2 SIMPLE_FORMATTING_ONLY value + */ + v4beta1.HtmlSanitization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HTML_SANITIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "HTML_SANITIZATION_DISABLED"] = 1; + values[valuesById[2] = "SIMPLE_FORMATTING_ONLY"] = 2; + return values; + })(); + + /** + * CommuteMethod enum. + * @name google.cloud.talent.v4beta1.CommuteMethod + * @enum {number} + * @property {number} COMMUTE_METHOD_UNSPECIFIED=0 COMMUTE_METHOD_UNSPECIFIED value + * @property {number} DRIVING=1 DRIVING value + * @property {number} TRANSIT=2 TRANSIT value + * @property {number} WALKING=3 WALKING value + * @property {number} CYCLING=4 CYCLING value + */ + v4beta1.CommuteMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMMUTE_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "DRIVING"] = 1; + values[valuesById[2] = "TRANSIT"] = 2; + values[valuesById[3] = "WALKING"] = 3; + values[valuesById[4] = "CYCLING"] = 4; + return values; + })(); + + v4beta1.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.cloud.talent.v4beta1 + * @interface ILocation + * @property {google.cloud.talent.v4beta1.Location.LocationType|null} [locationType] Location locationType + * @property {google.type.IPostalAddress|null} [postalAddress] Location postalAddress + * @property {google.type.ILatLng|null} [latLng] Location latLng + * @property {number|null} [radiusMiles] Location radiusMiles + */ + + /** + * Constructs a new Location. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.cloud.talent.v4beta1.ILocation=} [properties] Properties to set + */ + function Location(properties) { + if (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 locationType. + * @member {google.cloud.talent.v4beta1.Location.LocationType} locationType + * @memberof google.cloud.talent.v4beta1.Location + * @instance + */ + Location.prototype.locationType = 0; + + /** + * Location postalAddress. + * @member {google.type.IPostalAddress|null|undefined} postalAddress + * @memberof google.cloud.talent.v4beta1.Location + * @instance + */ + Location.prototype.postalAddress = null; + + /** + * Location latLng. + * @member {google.type.ILatLng|null|undefined} latLng + * @memberof google.cloud.talent.v4beta1.Location + * @instance + */ + Location.prototype.latLng = null; + + /** + * Location radiusMiles. + * @member {number} radiusMiles + * @memberof google.cloud.talent.v4beta1.Location + * @instance + */ + Location.prototype.radiusMiles = 0; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.Location + * @static + * @param {google.cloud.talent.v4beta1.ILocation=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.cloud.talent.v4beta1.Location.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.Location + * @static + * @param {google.cloud.talent.v4beta1.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.locationType != null && Object.hasOwnProperty.call(message, "locationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.locationType); + if (message.postalAddress != null && Object.hasOwnProperty.call(message, "postalAddress")) + $root.google.type.PostalAddress.encode(message.postalAddress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.latLng != null && Object.hasOwnProperty.call(message, "latLng")) + $root.google.type.LatLng.encode(message.latLng, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.radiusMiles != null && Object.hasOwnProperty.call(message, "radiusMiles")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.radiusMiles); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.Location + * @static + * @param {google.cloud.talent.v4beta1.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.cloud.talent.v4beta1.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.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.cloud.talent.v4beta1.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.locationType = reader.int32(); + break; + } + case 2: { + message.postalAddress = $root.google.type.PostalAddress.decode(reader, reader.uint32()); + break; + } + case 3: { + message.latLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + case 4: { + message.radiusMiles = reader.double(); + 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.cloud.talent.v4beta1.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.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.cloud.talent.v4beta1.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.locationType != null && message.hasOwnProperty("locationType")) + switch (message.locationType) { + default: + return "locationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + } + if (message.postalAddress != null && message.hasOwnProperty("postalAddress")) { + var error = $root.google.type.PostalAddress.verify(message.postalAddress); + if (error) + return "postalAddress." + error; + } + if (message.latLng != null && message.hasOwnProperty("latLng")) { + var error = $root.google.type.LatLng.verify(message.latLng); + if (error) + return "latLng." + error; + } + if (message.radiusMiles != null && message.hasOwnProperty("radiusMiles")) + if (typeof message.radiusMiles !== "number") + return "radiusMiles: number expected"; + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.Location + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.Location) + return object; + var message = new $root.google.cloud.talent.v4beta1.Location(); + switch (object.locationType) { + default: + if (typeof object.locationType === "number") { + message.locationType = object.locationType; + break; + } + break; + case "LOCATION_TYPE_UNSPECIFIED": + case 0: + message.locationType = 0; + break; + case "COUNTRY": + case 1: + message.locationType = 1; + break; + case "ADMINISTRATIVE_AREA": + case 2: + message.locationType = 2; + break; + case "SUB_ADMINISTRATIVE_AREA": + case 3: + message.locationType = 3; + break; + case "LOCALITY": + case 4: + message.locationType = 4; + break; + case "POSTAL_CODE": + case 5: + message.locationType = 5; + break; + case "SUB_LOCALITY": + case 6: + message.locationType = 6; + break; + case "SUB_LOCALITY_1": + case 7: + message.locationType = 7; + break; + case "SUB_LOCALITY_2": + case 8: + message.locationType = 8; + break; + case "NEIGHBORHOOD": + case 9: + message.locationType = 9; + break; + case "STREET_ADDRESS": + case 10: + message.locationType = 10; + break; + } + if (object.postalAddress != null) { + if (typeof object.postalAddress !== "object") + throw TypeError(".google.cloud.talent.v4beta1.Location.postalAddress: object expected"); + message.postalAddress = $root.google.type.PostalAddress.fromObject(object.postalAddress); + } + if (object.latLng != null) { + if (typeof object.latLng !== "object") + throw TypeError(".google.cloud.talent.v4beta1.Location.latLng: object expected"); + message.latLng = $root.google.type.LatLng.fromObject(object.latLng); + } + if (object.radiusMiles != null) + message.radiusMiles = Number(object.radiusMiles); + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.Location + * @static + * @param {google.cloud.talent.v4beta1.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.defaults) { + object.locationType = options.enums === String ? "LOCATION_TYPE_UNSPECIFIED" : 0; + object.postalAddress = null; + object.latLng = null; + object.radiusMiles = 0; + } + if (message.locationType != null && message.hasOwnProperty("locationType")) + object.locationType = options.enums === String ? $root.google.cloud.talent.v4beta1.Location.LocationType[message.locationType] === undefined ? message.locationType : $root.google.cloud.talent.v4beta1.Location.LocationType[message.locationType] : message.locationType; + if (message.postalAddress != null && message.hasOwnProperty("postalAddress")) + object.postalAddress = $root.google.type.PostalAddress.toObject(message.postalAddress, options); + if (message.latLng != null && message.hasOwnProperty("latLng")) + object.latLng = $root.google.type.LatLng.toObject(message.latLng, options); + if (message.radiusMiles != null && message.hasOwnProperty("radiusMiles")) + object.radiusMiles = options.json && !isFinite(message.radiusMiles) ? String(message.radiusMiles) : message.radiusMiles; + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.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.cloud.talent.v4beta1.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.cloud.talent.v4beta1.Location"; + }; + + /** + * LocationType enum. + * @name google.cloud.talent.v4beta1.Location.LocationType + * @enum {number} + * @property {number} LOCATION_TYPE_UNSPECIFIED=0 LOCATION_TYPE_UNSPECIFIED value + * @property {number} COUNTRY=1 COUNTRY value + * @property {number} ADMINISTRATIVE_AREA=2 ADMINISTRATIVE_AREA value + * @property {number} SUB_ADMINISTRATIVE_AREA=3 SUB_ADMINISTRATIVE_AREA value + * @property {number} LOCALITY=4 LOCALITY value + * @property {number} POSTAL_CODE=5 POSTAL_CODE value + * @property {number} SUB_LOCALITY=6 SUB_LOCALITY value + * @property {number} SUB_LOCALITY_1=7 SUB_LOCALITY_1 value + * @property {number} SUB_LOCALITY_2=8 SUB_LOCALITY_2 value + * @property {number} NEIGHBORHOOD=9 NEIGHBORHOOD value + * @property {number} STREET_ADDRESS=10 STREET_ADDRESS value + */ + Location.LocationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOCATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COUNTRY"] = 1; + values[valuesById[2] = "ADMINISTRATIVE_AREA"] = 2; + values[valuesById[3] = "SUB_ADMINISTRATIVE_AREA"] = 3; + values[valuesById[4] = "LOCALITY"] = 4; + values[valuesById[5] = "POSTAL_CODE"] = 5; + values[valuesById[6] = "SUB_LOCALITY"] = 6; + values[valuesById[7] = "SUB_LOCALITY_1"] = 7; + values[valuesById[8] = "SUB_LOCALITY_2"] = 8; + values[valuesById[9] = "NEIGHBORHOOD"] = 9; + values[valuesById[10] = "STREET_ADDRESS"] = 10; + return values; + })(); + + return Location; + })(); + + v4beta1.RequestMetadata = (function() { + + /** + * Properties of a RequestMetadata. + * @memberof google.cloud.talent.v4beta1 + * @interface IRequestMetadata + * @property {string|null} [domain] RequestMetadata domain + * @property {string|null} [sessionId] RequestMetadata sessionId + * @property {string|null} [userId] RequestMetadata userId + * @property {boolean|null} [allowMissingIds] RequestMetadata allowMissingIds + * @property {google.cloud.talent.v4beta1.IDeviceInfo|null} [deviceInfo] RequestMetadata deviceInfo + */ + + /** + * Constructs a new RequestMetadata. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a RequestMetadata. + * @implements IRequestMetadata + * @constructor + * @param {google.cloud.talent.v4beta1.IRequestMetadata=} [properties] Properties to set + */ + function RequestMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestMetadata domain. + * @member {string} domain + * @memberof google.cloud.talent.v4beta1.RequestMetadata + * @instance + */ + RequestMetadata.prototype.domain = ""; + + /** + * RequestMetadata sessionId. + * @member {string} sessionId + * @memberof google.cloud.talent.v4beta1.RequestMetadata + * @instance + */ + RequestMetadata.prototype.sessionId = ""; + + /** + * RequestMetadata userId. + * @member {string} userId + * @memberof google.cloud.talent.v4beta1.RequestMetadata + * @instance + */ + RequestMetadata.prototype.userId = ""; + + /** + * RequestMetadata allowMissingIds. + * @member {boolean} allowMissingIds + * @memberof google.cloud.talent.v4beta1.RequestMetadata + * @instance + */ + RequestMetadata.prototype.allowMissingIds = false; + + /** + * RequestMetadata deviceInfo. + * @member {google.cloud.talent.v4beta1.IDeviceInfo|null|undefined} deviceInfo + * @memberof google.cloud.talent.v4beta1.RequestMetadata + * @instance + */ + RequestMetadata.prototype.deviceInfo = null; + + /** + * Creates a new RequestMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.RequestMetadata + * @static + * @param {google.cloud.talent.v4beta1.IRequestMetadata=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.RequestMetadata} RequestMetadata instance + */ + RequestMetadata.create = function create(properties) { + return new RequestMetadata(properties); + }; + + /** + * Encodes the specified RequestMetadata message. Does not implicitly {@link google.cloud.talent.v4beta1.RequestMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.RequestMetadata + * @static + * @param {google.cloud.talent.v4beta1.IRequestMetadata} message RequestMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.domain); + if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sessionId); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.userId); + if (message.allowMissingIds != null && Object.hasOwnProperty.call(message, "allowMissingIds")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissingIds); + if (message.deviceInfo != null && Object.hasOwnProperty.call(message, "deviceInfo")) + $root.google.cloud.talent.v4beta1.DeviceInfo.encode(message.deviceInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestMetadata message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.RequestMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.RequestMetadata + * @static + * @param {google.cloud.talent.v4beta1.IRequestMetadata} message RequestMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.RequestMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.RequestMetadata} RequestMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.RequestMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.domain = reader.string(); + break; + } + case 2: { + message.sessionId = reader.string(); + break; + } + case 3: { + message.userId = reader.string(); + break; + } + case 4: { + message.allowMissingIds = reader.bool(); + break; + } + case 5: { + message.deviceInfo = $root.google.cloud.talent.v4beta1.DeviceInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.RequestMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.RequestMetadata} RequestMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestMetadata message. + * @function verify + * @memberof google.cloud.talent.v4beta1.RequestMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.domain != null && message.hasOwnProperty("domain")) + if (!$util.isString(message.domain)) + return "domain: string expected"; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + if (!$util.isString(message.sessionId)) + return "sessionId: string expected"; + if (message.userId != null && message.hasOwnProperty("userId")) + if (!$util.isString(message.userId)) + return "userId: string expected"; + if (message.allowMissingIds != null && message.hasOwnProperty("allowMissingIds")) + if (typeof message.allowMissingIds !== "boolean") + return "allowMissingIds: boolean expected"; + if (message.deviceInfo != null && message.hasOwnProperty("deviceInfo")) { + var error = $root.google.cloud.talent.v4beta1.DeviceInfo.verify(message.deviceInfo); + if (error) + return "deviceInfo." + error; + } + return null; + }; + + /** + * Creates a RequestMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.RequestMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.RequestMetadata} RequestMetadata + */ + RequestMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.RequestMetadata) + return object; + var message = new $root.google.cloud.talent.v4beta1.RequestMetadata(); + if (object.domain != null) + message.domain = String(object.domain); + if (object.sessionId != null) + message.sessionId = String(object.sessionId); + if (object.userId != null) + message.userId = String(object.userId); + if (object.allowMissingIds != null) + message.allowMissingIds = Boolean(object.allowMissingIds); + if (object.deviceInfo != null) { + if (typeof object.deviceInfo !== "object") + throw TypeError(".google.cloud.talent.v4beta1.RequestMetadata.deviceInfo: object expected"); + message.deviceInfo = $root.google.cloud.talent.v4beta1.DeviceInfo.fromObject(object.deviceInfo); + } + return message; + }; + + /** + * Creates a plain object from a RequestMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.RequestMetadata + * @static + * @param {google.cloud.talent.v4beta1.RequestMetadata} message RequestMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.domain = ""; + object.sessionId = ""; + object.userId = ""; + object.allowMissingIds = false; + object.deviceInfo = null; + } + if (message.domain != null && message.hasOwnProperty("domain")) + object.domain = message.domain; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + object.sessionId = message.sessionId; + if (message.userId != null && message.hasOwnProperty("userId")) + object.userId = message.userId; + if (message.allowMissingIds != null && message.hasOwnProperty("allowMissingIds")) + object.allowMissingIds = message.allowMissingIds; + if (message.deviceInfo != null && message.hasOwnProperty("deviceInfo")) + object.deviceInfo = $root.google.cloud.talent.v4beta1.DeviceInfo.toObject(message.deviceInfo, options); + return object; + }; + + /** + * Converts this RequestMetadata to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.RequestMetadata + * @instance + * @returns {Object.} JSON object + */ + RequestMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RequestMetadata + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.RequestMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RequestMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.RequestMetadata"; + }; + + return RequestMetadata; + })(); + + v4beta1.ResponseMetadata = (function() { + + /** + * Properties of a ResponseMetadata. + * @memberof google.cloud.talent.v4beta1 + * @interface IResponseMetadata + * @property {string|null} [requestId] ResponseMetadata requestId + */ + + /** + * Constructs a new ResponseMetadata. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a ResponseMetadata. + * @implements IResponseMetadata + * @constructor + * @param {google.cloud.talent.v4beta1.IResponseMetadata=} [properties] Properties to set + */ + function ResponseMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseMetadata requestId. + * @member {string} requestId + * @memberof google.cloud.talent.v4beta1.ResponseMetadata + * @instance + */ + ResponseMetadata.prototype.requestId = ""; + + /** + * Creates a new ResponseMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.ResponseMetadata + * @static + * @param {google.cloud.talent.v4beta1.IResponseMetadata=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.ResponseMetadata} ResponseMetadata instance + */ + ResponseMetadata.create = function create(properties) { + return new ResponseMetadata(properties); + }; + + /** + * Encodes the specified ResponseMetadata message. Does not implicitly {@link google.cloud.talent.v4beta1.ResponseMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.ResponseMetadata + * @static + * @param {google.cloud.talent.v4beta1.IResponseMetadata} message ResponseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified ResponseMetadata message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.ResponseMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.ResponseMetadata + * @static + * @param {google.cloud.talent.v4beta1.IResponseMetadata} message ResponseMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.ResponseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.ResponseMetadata} ResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.ResponseMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.ResponseMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.ResponseMetadata} ResponseMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseMetadata message. + * @function verify + * @memberof google.cloud.talent.v4beta1.ResponseMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a ResponseMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.ResponseMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.ResponseMetadata} ResponseMetadata + */ + ResponseMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.ResponseMetadata) + return object; + var message = new $root.google.cloud.talent.v4beta1.ResponseMetadata(); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a ResponseMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.ResponseMetadata + * @static + * @param {google.cloud.talent.v4beta1.ResponseMetadata} message ResponseMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.requestId = ""; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this ResponseMetadata to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.ResponseMetadata + * @instance + * @returns {Object.} JSON object + */ + ResponseMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResponseMetadata + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.ResponseMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResponseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.ResponseMetadata"; + }; + + return ResponseMetadata; + })(); + + v4beta1.DeviceInfo = (function() { + + /** + * Properties of a DeviceInfo. + * @memberof google.cloud.talent.v4beta1 + * @interface IDeviceInfo + * @property {google.cloud.talent.v4beta1.DeviceInfo.DeviceType|null} [deviceType] DeviceInfo deviceType + * @property {string|null} [id] DeviceInfo id + */ + + /** + * Constructs a new DeviceInfo. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a DeviceInfo. + * @implements IDeviceInfo + * @constructor + * @param {google.cloud.talent.v4beta1.IDeviceInfo=} [properties] Properties to set + */ + function DeviceInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeviceInfo deviceType. + * @member {google.cloud.talent.v4beta1.DeviceInfo.DeviceType} deviceType + * @memberof google.cloud.talent.v4beta1.DeviceInfo + * @instance + */ + DeviceInfo.prototype.deviceType = 0; + + /** + * DeviceInfo id. + * @member {string} id + * @memberof google.cloud.talent.v4beta1.DeviceInfo + * @instance + */ + DeviceInfo.prototype.id = ""; + + /** + * Creates a new DeviceInfo instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.DeviceInfo + * @static + * @param {google.cloud.talent.v4beta1.IDeviceInfo=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.DeviceInfo} DeviceInfo instance + */ + DeviceInfo.create = function create(properties) { + return new DeviceInfo(properties); + }; + + /** + * Encodes the specified DeviceInfo message. Does not implicitly {@link google.cloud.talent.v4beta1.DeviceInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.DeviceInfo + * @static + * @param {google.cloud.talent.v4beta1.IDeviceInfo} message DeviceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeviceInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deviceType != null && Object.hasOwnProperty.call(message, "deviceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.deviceType); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + return writer; + }; + + /** + * Encodes the specified DeviceInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.DeviceInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.DeviceInfo + * @static + * @param {google.cloud.talent.v4beta1.IDeviceInfo} message DeviceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeviceInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeviceInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.DeviceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.DeviceInfo} DeviceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeviceInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.DeviceInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deviceType = reader.int32(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeviceInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.DeviceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.DeviceInfo} DeviceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeviceInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeviceInfo message. + * @function verify + * @memberof google.cloud.talent.v4beta1.DeviceInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeviceInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deviceType != null && message.hasOwnProperty("deviceType")) + switch (message.deviceType) { + default: + return "deviceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + return null; + }; + + /** + * Creates a DeviceInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.DeviceInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.DeviceInfo} DeviceInfo + */ + DeviceInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.DeviceInfo) + return object; + var message = new $root.google.cloud.talent.v4beta1.DeviceInfo(); + switch (object.deviceType) { + default: + if (typeof object.deviceType === "number") { + message.deviceType = object.deviceType; + break; + } + break; + case "DEVICE_TYPE_UNSPECIFIED": + case 0: + message.deviceType = 0; + break; + case "WEB": + case 1: + message.deviceType = 1; + break; + case "MOBILE_WEB": + case 2: + message.deviceType = 2; + break; + case "ANDROID": + case 3: + message.deviceType = 3; + break; + case "IOS": + case 4: + message.deviceType = 4; + break; + case "BOT": + case 5: + message.deviceType = 5; + break; + case "OTHER": + case 6: + message.deviceType = 6; + break; + } + if (object.id != null) + message.id = String(object.id); + return message; + }; + + /** + * Creates a plain object from a DeviceInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.DeviceInfo + * @static + * @param {google.cloud.talent.v4beta1.DeviceInfo} message DeviceInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeviceInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.deviceType = options.enums === String ? "DEVICE_TYPE_UNSPECIFIED" : 0; + object.id = ""; + } + if (message.deviceType != null && message.hasOwnProperty("deviceType")) + object.deviceType = options.enums === String ? $root.google.cloud.talent.v4beta1.DeviceInfo.DeviceType[message.deviceType] === undefined ? message.deviceType : $root.google.cloud.talent.v4beta1.DeviceInfo.DeviceType[message.deviceType] : message.deviceType; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + return object; + }; + + /** + * Converts this DeviceInfo to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.DeviceInfo + * @instance + * @returns {Object.} JSON object + */ + DeviceInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeviceInfo + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.DeviceInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeviceInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.DeviceInfo"; + }; + + /** + * DeviceType enum. + * @name google.cloud.talent.v4beta1.DeviceInfo.DeviceType + * @enum {number} + * @property {number} DEVICE_TYPE_UNSPECIFIED=0 DEVICE_TYPE_UNSPECIFIED value + * @property {number} WEB=1 WEB value + * @property {number} MOBILE_WEB=2 MOBILE_WEB value + * @property {number} ANDROID=3 ANDROID value + * @property {number} IOS=4 IOS value + * @property {number} BOT=5 BOT value + * @property {number} OTHER=6 OTHER value + */ + DeviceInfo.DeviceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEVICE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "WEB"] = 1; + values[valuesById[2] = "MOBILE_WEB"] = 2; + values[valuesById[3] = "ANDROID"] = 3; + values[valuesById[4] = "IOS"] = 4; + values[valuesById[5] = "BOT"] = 5; + values[valuesById[6] = "OTHER"] = 6; + return values; + })(); + + return DeviceInfo; + })(); + + v4beta1.CustomAttribute = (function() { + + /** + * Properties of a CustomAttribute. + * @memberof google.cloud.talent.v4beta1 + * @interface ICustomAttribute + * @property {Array.|null} [stringValues] CustomAttribute stringValues + * @property {Array.|null} [longValues] CustomAttribute longValues + * @property {boolean|null} [filterable] CustomAttribute filterable + * @property {boolean|null} [keywordSearchable] CustomAttribute keywordSearchable + */ + + /** + * Constructs a new CustomAttribute. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a CustomAttribute. + * @implements ICustomAttribute + * @constructor + * @param {google.cloud.talent.v4beta1.ICustomAttribute=} [properties] Properties to set + */ + function CustomAttribute(properties) { + this.stringValues = []; + this.longValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomAttribute stringValues. + * @member {Array.} stringValues + * @memberof google.cloud.talent.v4beta1.CustomAttribute + * @instance + */ + CustomAttribute.prototype.stringValues = $util.emptyArray; + + /** + * CustomAttribute longValues. + * @member {Array.} longValues + * @memberof google.cloud.talent.v4beta1.CustomAttribute + * @instance + */ + CustomAttribute.prototype.longValues = $util.emptyArray; + + /** + * CustomAttribute filterable. + * @member {boolean} filterable + * @memberof google.cloud.talent.v4beta1.CustomAttribute + * @instance + */ + CustomAttribute.prototype.filterable = false; + + /** + * CustomAttribute keywordSearchable. + * @member {boolean} keywordSearchable + * @memberof google.cloud.talent.v4beta1.CustomAttribute + * @instance + */ + CustomAttribute.prototype.keywordSearchable = false; + + /** + * Creates a new CustomAttribute instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.CustomAttribute + * @static + * @param {google.cloud.talent.v4beta1.ICustomAttribute=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.CustomAttribute} CustomAttribute instance + */ + CustomAttribute.create = function create(properties) { + return new CustomAttribute(properties); + }; + + /** + * Encodes the specified CustomAttribute message. Does not implicitly {@link google.cloud.talent.v4beta1.CustomAttribute.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.CustomAttribute + * @static + * @param {google.cloud.talent.v4beta1.ICustomAttribute} message CustomAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomAttribute.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stringValues != null && message.stringValues.length) + for (var i = 0; i < message.stringValues.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stringValues[i]); + if (message.longValues != null && message.longValues.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.longValues.length; ++i) + writer.int64(message.longValues[i]); + writer.ldelim(); + } + if (message.filterable != null && Object.hasOwnProperty.call(message, "filterable")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.filterable); + if (message.keywordSearchable != null && Object.hasOwnProperty.call(message, "keywordSearchable")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.keywordSearchable); + return writer; + }; + + /** + * Encodes the specified CustomAttribute message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CustomAttribute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.CustomAttribute + * @static + * @param {google.cloud.talent.v4beta1.ICustomAttribute} message CustomAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomAttribute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomAttribute message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.CustomAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.CustomAttribute} CustomAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomAttribute.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.CustomAttribute(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.stringValues && message.stringValues.length)) + message.stringValues = []; + message.stringValues.push(reader.string()); + break; + } + case 2: { + if (!(message.longValues && message.longValues.length)) + message.longValues = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.longValues.push(reader.int64()); + } else + message.longValues.push(reader.int64()); + break; + } + case 3: { + message.filterable = reader.bool(); + break; + } + case 4: { + message.keywordSearchable = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomAttribute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.CustomAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.CustomAttribute} CustomAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomAttribute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomAttribute message. + * @function verify + * @memberof google.cloud.talent.v4beta1.CustomAttribute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomAttribute.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stringValues != null && message.hasOwnProperty("stringValues")) { + if (!Array.isArray(message.stringValues)) + return "stringValues: array expected"; + for (var i = 0; i < message.stringValues.length; ++i) + if (!$util.isString(message.stringValues[i])) + return "stringValues: string[] expected"; + } + if (message.longValues != null && message.hasOwnProperty("longValues")) { + if (!Array.isArray(message.longValues)) + return "longValues: array expected"; + for (var i = 0; i < message.longValues.length; ++i) + if (!$util.isInteger(message.longValues[i]) && !(message.longValues[i] && $util.isInteger(message.longValues[i].low) && $util.isInteger(message.longValues[i].high))) + return "longValues: integer|Long[] expected"; + } + if (message.filterable != null && message.hasOwnProperty("filterable")) + if (typeof message.filterable !== "boolean") + return "filterable: boolean expected"; + if (message.keywordSearchable != null && message.hasOwnProperty("keywordSearchable")) + if (typeof message.keywordSearchable !== "boolean") + return "keywordSearchable: boolean expected"; + return null; + }; + + /** + * Creates a CustomAttribute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.CustomAttribute + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.CustomAttribute} CustomAttribute + */ + CustomAttribute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.CustomAttribute) + return object; + var message = new $root.google.cloud.talent.v4beta1.CustomAttribute(); + if (object.stringValues) { + if (!Array.isArray(object.stringValues)) + throw TypeError(".google.cloud.talent.v4beta1.CustomAttribute.stringValues: array expected"); + message.stringValues = []; + for (var i = 0; i < object.stringValues.length; ++i) + message.stringValues[i] = String(object.stringValues[i]); + } + if (object.longValues) { + if (!Array.isArray(object.longValues)) + throw TypeError(".google.cloud.talent.v4beta1.CustomAttribute.longValues: array expected"); + message.longValues = []; + for (var i = 0; i < object.longValues.length; ++i) + if ($util.Long) + (message.longValues[i] = $util.Long.fromValue(object.longValues[i])).unsigned = false; + else if (typeof object.longValues[i] === "string") + message.longValues[i] = parseInt(object.longValues[i], 10); + else if (typeof object.longValues[i] === "number") + message.longValues[i] = object.longValues[i]; + else if (typeof object.longValues[i] === "object") + message.longValues[i] = new $util.LongBits(object.longValues[i].low >>> 0, object.longValues[i].high >>> 0).toNumber(); + } + if (object.filterable != null) + message.filterable = Boolean(object.filterable); + if (object.keywordSearchable != null) + message.keywordSearchable = Boolean(object.keywordSearchable); + return message; + }; + + /** + * Creates a plain object from a CustomAttribute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.CustomAttribute + * @static + * @param {google.cloud.talent.v4beta1.CustomAttribute} message CustomAttribute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomAttribute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.stringValues = []; + object.longValues = []; + } + if (options.defaults) { + object.filterable = false; + object.keywordSearchable = false; + } + if (message.stringValues && message.stringValues.length) { + object.stringValues = []; + for (var j = 0; j < message.stringValues.length; ++j) + object.stringValues[j] = message.stringValues[j]; + } + if (message.longValues && message.longValues.length) { + object.longValues = []; + for (var j = 0; j < message.longValues.length; ++j) + if (typeof message.longValues[j] === "number") + object.longValues[j] = options.longs === String ? String(message.longValues[j]) : message.longValues[j]; + else + object.longValues[j] = options.longs === String ? $util.Long.prototype.toString.call(message.longValues[j]) : options.longs === Number ? new $util.LongBits(message.longValues[j].low >>> 0, message.longValues[j].high >>> 0).toNumber() : message.longValues[j]; + } + if (message.filterable != null && message.hasOwnProperty("filterable")) + object.filterable = message.filterable; + if (message.keywordSearchable != null && message.hasOwnProperty("keywordSearchable")) + object.keywordSearchable = message.keywordSearchable; + return object; + }; + + /** + * Converts this CustomAttribute to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.CustomAttribute + * @instance + * @returns {Object.} JSON object + */ + CustomAttribute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomAttribute + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.CustomAttribute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomAttribute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.CustomAttribute"; + }; + + return CustomAttribute; + })(); + + v4beta1.SpellingCorrection = (function() { + + /** + * Properties of a SpellingCorrection. + * @memberof google.cloud.talent.v4beta1 + * @interface ISpellingCorrection + * @property {boolean|null} [corrected] SpellingCorrection corrected + * @property {string|null} [correctedText] SpellingCorrection correctedText + * @property {string|null} [correctedHtml] SpellingCorrection correctedHtml + */ + + /** + * Constructs a new SpellingCorrection. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a SpellingCorrection. + * @implements ISpellingCorrection + * @constructor + * @param {google.cloud.talent.v4beta1.ISpellingCorrection=} [properties] Properties to set + */ + function SpellingCorrection(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpellingCorrection corrected. + * @member {boolean} corrected + * @memberof google.cloud.talent.v4beta1.SpellingCorrection + * @instance + */ + SpellingCorrection.prototype.corrected = false; + + /** + * SpellingCorrection correctedText. + * @member {string} correctedText + * @memberof google.cloud.talent.v4beta1.SpellingCorrection + * @instance + */ + SpellingCorrection.prototype.correctedText = ""; + + /** + * SpellingCorrection correctedHtml. + * @member {string} correctedHtml + * @memberof google.cloud.talent.v4beta1.SpellingCorrection + * @instance + */ + SpellingCorrection.prototype.correctedHtml = ""; + + /** + * Creates a new SpellingCorrection instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.SpellingCorrection + * @static + * @param {google.cloud.talent.v4beta1.ISpellingCorrection=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.SpellingCorrection} SpellingCorrection instance + */ + SpellingCorrection.create = function create(properties) { + return new SpellingCorrection(properties); + }; + + /** + * Encodes the specified SpellingCorrection message. Does not implicitly {@link google.cloud.talent.v4beta1.SpellingCorrection.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.SpellingCorrection + * @static + * @param {google.cloud.talent.v4beta1.ISpellingCorrection} message SpellingCorrection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpellingCorrection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.corrected != null && Object.hasOwnProperty.call(message, "corrected")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.corrected); + if (message.correctedText != null && Object.hasOwnProperty.call(message, "correctedText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.correctedText); + if (message.correctedHtml != null && Object.hasOwnProperty.call(message, "correctedHtml")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.correctedHtml); + return writer; + }; + + /** + * Encodes the specified SpellingCorrection message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.SpellingCorrection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.SpellingCorrection + * @static + * @param {google.cloud.talent.v4beta1.ISpellingCorrection} message SpellingCorrection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpellingCorrection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpellingCorrection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.SpellingCorrection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.SpellingCorrection} SpellingCorrection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpellingCorrection.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.SpellingCorrection(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.corrected = reader.bool(); + break; + } + case 2: { + message.correctedText = reader.string(); + break; + } + case 3: { + message.correctedHtml = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpellingCorrection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.SpellingCorrection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.SpellingCorrection} SpellingCorrection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpellingCorrection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpellingCorrection message. + * @function verify + * @memberof google.cloud.talent.v4beta1.SpellingCorrection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpellingCorrection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.corrected != null && message.hasOwnProperty("corrected")) + if (typeof message.corrected !== "boolean") + return "corrected: boolean expected"; + if (message.correctedText != null && message.hasOwnProperty("correctedText")) + if (!$util.isString(message.correctedText)) + return "correctedText: string expected"; + if (message.correctedHtml != null && message.hasOwnProperty("correctedHtml")) + if (!$util.isString(message.correctedHtml)) + return "correctedHtml: string expected"; + return null; + }; + + /** + * Creates a SpellingCorrection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.SpellingCorrection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.SpellingCorrection} SpellingCorrection + */ + SpellingCorrection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.SpellingCorrection) + return object; + var message = new $root.google.cloud.talent.v4beta1.SpellingCorrection(); + if (object.corrected != null) + message.corrected = Boolean(object.corrected); + if (object.correctedText != null) + message.correctedText = String(object.correctedText); + if (object.correctedHtml != null) + message.correctedHtml = String(object.correctedHtml); + return message; + }; + + /** + * Creates a plain object from a SpellingCorrection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.SpellingCorrection + * @static + * @param {google.cloud.talent.v4beta1.SpellingCorrection} message SpellingCorrection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpellingCorrection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.corrected = false; + object.correctedText = ""; + object.correctedHtml = ""; + } + if (message.corrected != null && message.hasOwnProperty("corrected")) + object.corrected = message.corrected; + if (message.correctedText != null && message.hasOwnProperty("correctedText")) + object.correctedText = message.correctedText; + if (message.correctedHtml != null && message.hasOwnProperty("correctedHtml")) + object.correctedHtml = message.correctedHtml; + return object; + }; + + /** + * Converts this SpellingCorrection to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.SpellingCorrection + * @instance + * @returns {Object.} JSON object + */ + SpellingCorrection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpellingCorrection + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.SpellingCorrection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpellingCorrection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.SpellingCorrection"; + }; + + return SpellingCorrection; + })(); + + v4beta1.CompensationInfo = (function() { + + /** + * Properties of a CompensationInfo. + * @memberof google.cloud.talent.v4beta1 + * @interface ICompensationInfo + * @property {Array.|null} [entries] CompensationInfo entries + * @property {google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange|null} [annualizedBaseCompensationRange] CompensationInfo annualizedBaseCompensationRange + * @property {google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange|null} [annualizedTotalCompensationRange] CompensationInfo annualizedTotalCompensationRange + */ + + /** + * Constructs a new CompensationInfo. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a CompensationInfo. + * @implements ICompensationInfo + * @constructor + * @param {google.cloud.talent.v4beta1.ICompensationInfo=} [properties] Properties to set + */ + function CompensationInfo(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompensationInfo entries. + * @member {Array.} entries + * @memberof google.cloud.talent.v4beta1.CompensationInfo + * @instance + */ + CompensationInfo.prototype.entries = $util.emptyArray; + + /** + * CompensationInfo annualizedBaseCompensationRange. + * @member {google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange|null|undefined} annualizedBaseCompensationRange + * @memberof google.cloud.talent.v4beta1.CompensationInfo + * @instance + */ + CompensationInfo.prototype.annualizedBaseCompensationRange = null; + + /** + * CompensationInfo annualizedTotalCompensationRange. + * @member {google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange|null|undefined} annualizedTotalCompensationRange + * @memberof google.cloud.talent.v4beta1.CompensationInfo + * @instance + */ + CompensationInfo.prototype.annualizedTotalCompensationRange = null; + + /** + * Creates a new CompensationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.CompensationInfo + * @static + * @param {google.cloud.talent.v4beta1.ICompensationInfo=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.CompensationInfo} CompensationInfo instance + */ + CompensationInfo.create = function create(properties) { + return new CompensationInfo(properties); + }; + + /** + * Encodes the specified CompensationInfo message. Does not implicitly {@link google.cloud.talent.v4beta1.CompensationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.CompensationInfo + * @static + * @param {google.cloud.talent.v4beta1.ICompensationInfo} message CompensationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompensationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.annualizedBaseCompensationRange != null && Object.hasOwnProperty.call(message, "annualizedBaseCompensationRange")) + $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.encode(message.annualizedBaseCompensationRange, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.annualizedTotalCompensationRange != null && Object.hasOwnProperty.call(message, "annualizedTotalCompensationRange")) + $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.encode(message.annualizedTotalCompensationRange, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CompensationInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CompensationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.CompensationInfo + * @static + * @param {google.cloud.talent.v4beta1.ICompensationInfo} message CompensationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompensationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompensationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.CompensationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.CompensationInfo} CompensationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompensationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.CompensationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.decode(reader, reader.uint32())); + break; + } + case 2: { + message.annualizedBaseCompensationRange = $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.decode(reader, reader.uint32()); + break; + } + case 3: { + message.annualizedTotalCompensationRange = $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompensationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.CompensationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.CompensationInfo} CompensationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompensationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompensationInfo message. + * @function verify + * @memberof google.cloud.talent.v4beta1.CompensationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompensationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + if (message.annualizedBaseCompensationRange != null && message.hasOwnProperty("annualizedBaseCompensationRange")) { + var error = $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.verify(message.annualizedBaseCompensationRange); + if (error) + return "annualizedBaseCompensationRange." + error; + } + if (message.annualizedTotalCompensationRange != null && message.hasOwnProperty("annualizedTotalCompensationRange")) { + var error = $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.verify(message.annualizedTotalCompensationRange); + if (error) + return "annualizedTotalCompensationRange." + error; + } + return null; + }; + + /** + * Creates a CompensationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.CompensationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.CompensationInfo} CompensationInfo + */ + CompensationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.CompensationInfo) + return object; + var message = new $root.google.cloud.talent.v4beta1.CompensationInfo(); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".google.cloud.talent.v4beta1.CompensationInfo.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".google.cloud.talent.v4beta1.CompensationInfo.entries: object expected"); + message.entries[i] = $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.fromObject(object.entries[i]); + } + } + if (object.annualizedBaseCompensationRange != null) { + if (typeof object.annualizedBaseCompensationRange !== "object") + throw TypeError(".google.cloud.talent.v4beta1.CompensationInfo.annualizedBaseCompensationRange: object expected"); + message.annualizedBaseCompensationRange = $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.fromObject(object.annualizedBaseCompensationRange); + } + if (object.annualizedTotalCompensationRange != null) { + if (typeof object.annualizedTotalCompensationRange !== "object") + throw TypeError(".google.cloud.talent.v4beta1.CompensationInfo.annualizedTotalCompensationRange: object expected"); + message.annualizedTotalCompensationRange = $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.fromObject(object.annualizedTotalCompensationRange); + } + return message; + }; + + /** + * Creates a plain object from a CompensationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.CompensationInfo + * @static + * @param {google.cloud.talent.v4beta1.CompensationInfo} message CompensationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompensationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (options.defaults) { + object.annualizedBaseCompensationRange = null; + object.annualizedTotalCompensationRange = null; + } + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.toObject(message.entries[j], options); + } + if (message.annualizedBaseCompensationRange != null && message.hasOwnProperty("annualizedBaseCompensationRange")) + object.annualizedBaseCompensationRange = $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.toObject(message.annualizedBaseCompensationRange, options); + if (message.annualizedTotalCompensationRange != null && message.hasOwnProperty("annualizedTotalCompensationRange")) + object.annualizedTotalCompensationRange = $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.toObject(message.annualizedTotalCompensationRange, options); + return object; + }; + + /** + * Converts this CompensationInfo to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.CompensationInfo + * @instance + * @returns {Object.} JSON object + */ + CompensationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompensationInfo + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.CompensationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompensationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.CompensationInfo"; + }; + + CompensationInfo.CompensationEntry = (function() { + + /** + * Properties of a CompensationEntry. + * @memberof google.cloud.talent.v4beta1.CompensationInfo + * @interface ICompensationEntry + * @property {google.cloud.talent.v4beta1.CompensationInfo.CompensationType|null} [type] CompensationEntry type + * @property {google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit|null} [unit] CompensationEntry unit + * @property {google.type.IMoney|null} [amount] CompensationEntry amount + * @property {google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange|null} [range] CompensationEntry range + * @property {string|null} [description] CompensationEntry description + * @property {google.protobuf.IDoubleValue|null} [expectedUnitsPerYear] CompensationEntry expectedUnitsPerYear + */ + + /** + * Constructs a new CompensationEntry. + * @memberof google.cloud.talent.v4beta1.CompensationInfo + * @classdesc Represents a CompensationEntry. + * @implements ICompensationEntry + * @constructor + * @param {google.cloud.talent.v4beta1.CompensationInfo.ICompensationEntry=} [properties] Properties to set + */ + function CompensationEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompensationEntry type. + * @member {google.cloud.talent.v4beta1.CompensationInfo.CompensationType} type + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry + * @instance + */ + CompensationEntry.prototype.type = 0; + + /** + * CompensationEntry unit. + * @member {google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit} unit + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry + * @instance + */ + CompensationEntry.prototype.unit = 0; + + /** + * CompensationEntry amount. + * @member {google.type.IMoney|null|undefined} amount + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry + * @instance + */ + CompensationEntry.prototype.amount = null; + + /** + * CompensationEntry range. + * @member {google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange|null|undefined} range + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry + * @instance + */ + CompensationEntry.prototype.range = null; + + /** + * CompensationEntry description. + * @member {string} description + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry + * @instance + */ + CompensationEntry.prototype.description = ""; + + /** + * CompensationEntry expectedUnitsPerYear. + * @member {google.protobuf.IDoubleValue|null|undefined} expectedUnitsPerYear + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry + * @instance + */ + CompensationEntry.prototype.expectedUnitsPerYear = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CompensationEntry compensationAmount. + * @member {"amount"|"range"|undefined} compensationAmount + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry + * @instance + */ + Object.defineProperty(CompensationEntry.prototype, "compensationAmount", { + get: $util.oneOfGetter($oneOfFields = ["amount", "range"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CompensationEntry instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry + * @static + * @param {google.cloud.talent.v4beta1.CompensationInfo.ICompensationEntry=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry} CompensationEntry instance + */ + CompensationEntry.create = function create(properties) { + return new CompensationEntry(properties); + }; + + /** + * Encodes the specified CompensationEntry message. Does not implicitly {@link google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry + * @static + * @param {google.cloud.talent.v4beta1.CompensationInfo.ICompensationEntry} message CompensationEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompensationEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.unit); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + $root.google.type.Money.encode(message.amount, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.range != null && Object.hasOwnProperty.call(message, "range")) + $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.encode(message.range, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.expectedUnitsPerYear != null && Object.hasOwnProperty.call(message, "expectedUnitsPerYear")) + $root.google.protobuf.DoubleValue.encode(message.expectedUnitsPerYear, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CompensationEntry message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry + * @static + * @param {google.cloud.talent.v4beta1.CompensationInfo.ICompensationEntry} message CompensationEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompensationEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompensationEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry} CompensationEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompensationEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.unit = reader.int32(); + break; + } + case 3: { + message.amount = $root.google.type.Money.decode(reader, reader.uint32()); + break; + } + case 4: { + message.range = $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.decode(reader, reader.uint32()); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.expectedUnitsPerYear = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompensationEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry} CompensationEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompensationEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompensationEntry message. + * @function verify + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompensationEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.unit != null && message.hasOwnProperty("unit")) + switch (message.unit) { + default: + return "unit: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.amount != null && message.hasOwnProperty("amount")) { + properties.compensationAmount = 1; + { + var error = $root.google.type.Money.verify(message.amount); + if (error) + return "amount." + error; + } + } + if (message.range != null && message.hasOwnProperty("range")) { + if (properties.compensationAmount === 1) + return "compensationAmount: multiple values"; + properties.compensationAmount = 1; + { + var error = $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.verify(message.range); + if (error) + return "range." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.expectedUnitsPerYear != null && message.hasOwnProperty("expectedUnitsPerYear")) { + var error = $root.google.protobuf.DoubleValue.verify(message.expectedUnitsPerYear); + if (error) + return "expectedUnitsPerYear." + error; + } + return null; + }; + + /** + * Creates a CompensationEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry} CompensationEntry + */ + CompensationEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry) + return object; + var message = new $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "COMPENSATION_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "BASE": + case 1: + message.type = 1; + break; + case "BONUS": + case 2: + message.type = 2; + break; + case "SIGNING_BONUS": + case 3: + message.type = 3; + break; + case "EQUITY": + case 4: + message.type = 4; + break; + case "PROFIT_SHARING": + case 5: + message.type = 5; + break; + case "COMMISSIONS": + case 6: + message.type = 6; + break; + case "TIPS": + case 7: + message.type = 7; + break; + case "OTHER_COMPENSATION_TYPE": + case 8: + message.type = 8; + break; + } + switch (object.unit) { + default: + if (typeof object.unit === "number") { + message.unit = object.unit; + break; + } + break; + case "COMPENSATION_UNIT_UNSPECIFIED": + case 0: + message.unit = 0; + break; + case "HOURLY": + case 1: + message.unit = 1; + break; + case "DAILY": + case 2: + message.unit = 2; + break; + case "WEEKLY": + case 3: + message.unit = 3; + break; + case "MONTHLY": + case 4: + message.unit = 4; + break; + case "YEARLY": + case 5: + message.unit = 5; + break; + case "ONE_TIME": + case 6: + message.unit = 6; + break; + case "OTHER_COMPENSATION_UNIT": + case 7: + message.unit = 7; + break; + } + if (object.amount != null) { + if (typeof object.amount !== "object") + throw TypeError(".google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.amount: object expected"); + message.amount = $root.google.type.Money.fromObject(object.amount); + } + if (object.range != null) { + if (typeof object.range !== "object") + throw TypeError(".google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.range: object expected"); + message.range = $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.fromObject(object.range); + } + if (object.description != null) + message.description = String(object.description); + if (object.expectedUnitsPerYear != null) { + if (typeof object.expectedUnitsPerYear !== "object") + throw TypeError(".google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.expectedUnitsPerYear: object expected"); + message.expectedUnitsPerYear = $root.google.protobuf.DoubleValue.fromObject(object.expectedUnitsPerYear); + } + return message; + }; + + /** + * Creates a plain object from a CompensationEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry + * @static + * @param {google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry} message CompensationEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompensationEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "COMPENSATION_TYPE_UNSPECIFIED" : 0; + object.unit = options.enums === String ? "COMPENSATION_UNIT_UNSPECIFIED" : 0; + object.description = ""; + object.expectedUnitsPerYear = null; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationType[message.type] === undefined ? message.type : $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationType[message.type] : message.type; + if (message.unit != null && message.hasOwnProperty("unit")) + object.unit = options.enums === String ? $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit[message.unit] === undefined ? message.unit : $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit[message.unit] : message.unit; + if (message.amount != null && message.hasOwnProperty("amount")) { + object.amount = $root.google.type.Money.toObject(message.amount, options); + if (options.oneofs) + object.compensationAmount = "amount"; + } + if (message.range != null && message.hasOwnProperty("range")) { + object.range = $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.toObject(message.range, options); + if (options.oneofs) + object.compensationAmount = "range"; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.expectedUnitsPerYear != null && message.hasOwnProperty("expectedUnitsPerYear")) + object.expectedUnitsPerYear = $root.google.protobuf.DoubleValue.toObject(message.expectedUnitsPerYear, options); + return object; + }; + + /** + * Converts this CompensationEntry to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry + * @instance + * @returns {Object.} JSON object + */ + CompensationEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompensationEntry + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompensationEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry"; + }; + + return CompensationEntry; + })(); + + /** + * CompensationType enum. + * @name google.cloud.talent.v4beta1.CompensationInfo.CompensationType + * @enum {number} + * @property {number} COMPENSATION_TYPE_UNSPECIFIED=0 COMPENSATION_TYPE_UNSPECIFIED value + * @property {number} BASE=1 BASE value + * @property {number} BONUS=2 BONUS value + * @property {number} SIGNING_BONUS=3 SIGNING_BONUS value + * @property {number} EQUITY=4 EQUITY value + * @property {number} PROFIT_SHARING=5 PROFIT_SHARING value + * @property {number} COMMISSIONS=6 COMMISSIONS value + * @property {number} TIPS=7 TIPS value + * @property {number} OTHER_COMPENSATION_TYPE=8 OTHER_COMPENSATION_TYPE value + */ + CompensationInfo.CompensationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPENSATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASE"] = 1; + values[valuesById[2] = "BONUS"] = 2; + values[valuesById[3] = "SIGNING_BONUS"] = 3; + values[valuesById[4] = "EQUITY"] = 4; + values[valuesById[5] = "PROFIT_SHARING"] = 5; + values[valuesById[6] = "COMMISSIONS"] = 6; + values[valuesById[7] = "TIPS"] = 7; + values[valuesById[8] = "OTHER_COMPENSATION_TYPE"] = 8; + return values; + })(); + + /** + * CompensationUnit enum. + * @name google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit + * @enum {number} + * @property {number} COMPENSATION_UNIT_UNSPECIFIED=0 COMPENSATION_UNIT_UNSPECIFIED value + * @property {number} HOURLY=1 HOURLY value + * @property {number} DAILY=2 DAILY value + * @property {number} WEEKLY=3 WEEKLY value + * @property {number} MONTHLY=4 MONTHLY value + * @property {number} YEARLY=5 YEARLY value + * @property {number} ONE_TIME=6 ONE_TIME value + * @property {number} OTHER_COMPENSATION_UNIT=7 OTHER_COMPENSATION_UNIT value + */ + CompensationInfo.CompensationUnit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPENSATION_UNIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "HOURLY"] = 1; + values[valuesById[2] = "DAILY"] = 2; + values[valuesById[3] = "WEEKLY"] = 3; + values[valuesById[4] = "MONTHLY"] = 4; + values[valuesById[5] = "YEARLY"] = 5; + values[valuesById[6] = "ONE_TIME"] = 6; + values[valuesById[7] = "OTHER_COMPENSATION_UNIT"] = 7; + return values; + })(); + + CompensationInfo.CompensationRange = (function() { + + /** + * Properties of a CompensationRange. + * @memberof google.cloud.talent.v4beta1.CompensationInfo + * @interface ICompensationRange + * @property {google.type.IMoney|null} [maxCompensation] CompensationRange maxCompensation + * @property {google.type.IMoney|null} [minCompensation] CompensationRange minCompensation + */ + + /** + * Constructs a new CompensationRange. + * @memberof google.cloud.talent.v4beta1.CompensationInfo + * @classdesc Represents a CompensationRange. + * @implements ICompensationRange + * @constructor + * @param {google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange=} [properties] Properties to set + */ + function CompensationRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompensationRange maxCompensation. + * @member {google.type.IMoney|null|undefined} maxCompensation + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationRange + * @instance + */ + CompensationRange.prototype.maxCompensation = null; + + /** + * CompensationRange minCompensation. + * @member {google.type.IMoney|null|undefined} minCompensation + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationRange + * @instance + */ + CompensationRange.prototype.minCompensation = null; + + /** + * Creates a new CompensationRange instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationRange + * @static + * @param {google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.CompensationInfo.CompensationRange} CompensationRange instance + */ + CompensationRange.create = function create(properties) { + return new CompensationRange(properties); + }; + + /** + * Encodes the specified CompensationRange message. Does not implicitly {@link google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationRange + * @static + * @param {google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange} message CompensationRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompensationRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minCompensation != null && Object.hasOwnProperty.call(message, "minCompensation")) + $root.google.type.Money.encode(message.minCompensation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxCompensation != null && Object.hasOwnProperty.call(message, "maxCompensation")) + $root.google.type.Money.encode(message.maxCompensation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CompensationRange message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationRange + * @static + * @param {google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange} message CompensationRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompensationRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompensationRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.CompensationInfo.CompensationRange} CompensationRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompensationRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.maxCompensation = $root.google.type.Money.decode(reader, reader.uint32()); + break; + } + case 1: { + message.minCompensation = $root.google.type.Money.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompensationRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.CompensationInfo.CompensationRange} CompensationRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompensationRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompensationRange message. + * @function verify + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompensationRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxCompensation != null && message.hasOwnProperty("maxCompensation")) { + var error = $root.google.type.Money.verify(message.maxCompensation); + if (error) + return "maxCompensation." + error; + } + if (message.minCompensation != null && message.hasOwnProperty("minCompensation")) { + var error = $root.google.type.Money.verify(message.minCompensation); + if (error) + return "minCompensation." + error; + } + return null; + }; + + /** + * Creates a CompensationRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.CompensationInfo.CompensationRange} CompensationRange + */ + CompensationRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange) + return object; + var message = new $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange(); + if (object.maxCompensation != null) { + if (typeof object.maxCompensation !== "object") + throw TypeError(".google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.maxCompensation: object expected"); + message.maxCompensation = $root.google.type.Money.fromObject(object.maxCompensation); + } + if (object.minCompensation != null) { + if (typeof object.minCompensation !== "object") + throw TypeError(".google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.minCompensation: object expected"); + message.minCompensation = $root.google.type.Money.fromObject(object.minCompensation); + } + return message; + }; + + /** + * Creates a plain object from a CompensationRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationRange + * @static + * @param {google.cloud.talent.v4beta1.CompensationInfo.CompensationRange} message CompensationRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompensationRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minCompensation = null; + object.maxCompensation = null; + } + if (message.minCompensation != null && message.hasOwnProperty("minCompensation")) + object.minCompensation = $root.google.type.Money.toObject(message.minCompensation, options); + if (message.maxCompensation != null && message.hasOwnProperty("maxCompensation")) + object.maxCompensation = $root.google.type.Money.toObject(message.maxCompensation, options); + return object; + }; + + /** + * Converts this CompensationRange to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationRange + * @instance + * @returns {Object.} JSON object + */ + CompensationRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompensationRange + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.CompensationInfo.CompensationRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompensationRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.CompensationInfo.CompensationRange"; + }; + + return CompensationRange; + })(); + + return CompensationInfo; + })(); + + v4beta1.BatchOperationMetadata = (function() { + + /** + * Properties of a BatchOperationMetadata. + * @memberof google.cloud.talent.v4beta1 + * @interface IBatchOperationMetadata + * @property {google.cloud.talent.v4beta1.BatchOperationMetadata.State|null} [state] BatchOperationMetadata state + * @property {string|null} [stateDescription] BatchOperationMetadata stateDescription + * @property {number|null} [successCount] BatchOperationMetadata successCount + * @property {number|null} [failureCount] BatchOperationMetadata failureCount + * @property {number|null} [totalCount] BatchOperationMetadata totalCount + * @property {google.protobuf.ITimestamp|null} [createTime] BatchOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] BatchOperationMetadata updateTime + * @property {google.protobuf.ITimestamp|null} [endTime] BatchOperationMetadata endTime + */ + + /** + * Constructs a new BatchOperationMetadata. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a BatchOperationMetadata. + * @implements IBatchOperationMetadata + * @constructor + * @param {google.cloud.talent.v4beta1.IBatchOperationMetadata=} [properties] Properties to set + */ + function BatchOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchOperationMetadata state. + * @member {google.cloud.talent.v4beta1.BatchOperationMetadata.State} state + * @memberof google.cloud.talent.v4beta1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.state = 0; + + /** + * BatchOperationMetadata stateDescription. + * @member {string} stateDescription + * @memberof google.cloud.talent.v4beta1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.stateDescription = ""; + + /** + * BatchOperationMetadata successCount. + * @member {number} successCount + * @memberof google.cloud.talent.v4beta1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.successCount = 0; + + /** + * BatchOperationMetadata failureCount. + * @member {number} failureCount + * @memberof google.cloud.talent.v4beta1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.failureCount = 0; + + /** + * BatchOperationMetadata totalCount. + * @member {number} totalCount + * @memberof google.cloud.talent.v4beta1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.totalCount = 0; + + /** + * BatchOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.talent.v4beta1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.createTime = null; + + /** + * BatchOperationMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.talent.v4beta1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.updateTime = null; + + /** + * BatchOperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.talent.v4beta1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.endTime = null; + + /** + * Creates a new BatchOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.BatchOperationMetadata + * @static + * @param {google.cloud.talent.v4beta1.IBatchOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.BatchOperationMetadata} BatchOperationMetadata instance + */ + BatchOperationMetadata.create = function create(properties) { + return new BatchOperationMetadata(properties); + }; + + /** + * Encodes the specified BatchOperationMetadata message. Does not implicitly {@link google.cloud.talent.v4beta1.BatchOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.BatchOperationMetadata + * @static + * @param {google.cloud.talent.v4beta1.IBatchOperationMetadata} message BatchOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.stateDescription != null && Object.hasOwnProperty.call(message, "stateDescription")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateDescription); + if (message.successCount != null && Object.hasOwnProperty.call(message, "successCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.successCount); + if (message.failureCount != null && Object.hasOwnProperty.call(message, "failureCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.failureCount); + if (message.totalCount != null && Object.hasOwnProperty.call(message, "totalCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.totalCount); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.BatchOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.BatchOperationMetadata + * @static + * @param {google.cloud.talent.v4beta1.IBatchOperationMetadata} message BatchOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.BatchOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.BatchOperationMetadata} BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.BatchOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.stateDescription = reader.string(); + break; + } + case 3: { + message.successCount = reader.int32(); + break; + } + case 4: { + message.failureCount = reader.int32(); + break; + } + case 5: { + message.totalCount = reader.int32(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.BatchOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.BatchOperationMetadata} BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchOperationMetadata message. + * @function verify + * @memberof google.cloud.talent.v4beta1.BatchOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.stateDescription != null && message.hasOwnProperty("stateDescription")) + if (!$util.isString(message.stateDescription)) + return "stateDescription: string expected"; + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (!$util.isInteger(message.successCount)) + return "successCount: integer expected"; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (!$util.isInteger(message.failureCount)) + return "failureCount: integer expected"; + if (message.totalCount != null && message.hasOwnProperty("totalCount")) + if (!$util.isInteger(message.totalCount)) + return "totalCount: 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.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a BatchOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.BatchOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.BatchOperationMetadata} BatchOperationMetadata + */ + BatchOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.BatchOperationMetadata) + return object; + var message = new $root.google.cloud.talent.v4beta1.BatchOperationMetadata(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "INITIALIZING": + case 1: + message.state = 1; + break; + case "PROCESSING": + case 2: + message.state = 2; + break; + case "SUCCEEDED": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + case "CANCELLING": + case 5: + message.state = 5; + break; + case "CANCELLED": + case 6: + message.state = 6; + break; + } + if (object.stateDescription != null) + message.stateDescription = String(object.stateDescription); + if (object.successCount != null) + message.successCount = object.successCount | 0; + if (object.failureCount != null) + message.failureCount = object.failureCount | 0; + if (object.totalCount != null) + message.totalCount = object.totalCount | 0; + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.talent.v4beta1.BatchOperationMetadata.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.talent.v4beta1.BatchOperationMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.talent.v4beta1.BatchOperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a BatchOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.BatchOperationMetadata + * @static + * @param {google.cloud.talent.v4beta1.BatchOperationMetadata} message BatchOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateDescription = ""; + object.successCount = 0; + object.failureCount = 0; + object.totalCount = 0; + object.createTime = null; + object.updateTime = null; + object.endTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.talent.v4beta1.BatchOperationMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.talent.v4beta1.BatchOperationMetadata.State[message.state] : message.state; + if (message.stateDescription != null && message.hasOwnProperty("stateDescription")) + object.stateDescription = message.stateDescription; + if (message.successCount != null && message.hasOwnProperty("successCount")) + object.successCount = message.successCount; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + object.failureCount = message.failureCount; + if (message.totalCount != null && message.hasOwnProperty("totalCount")) + object.totalCount = message.totalCount; + 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.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this BatchOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.BatchOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.BatchOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.BatchOperationMetadata"; + }; + + /** + * State enum. + * @name google.cloud.talent.v4beta1.BatchOperationMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} INITIALIZING=1 INITIALIZING value + * @property {number} PROCESSING=2 PROCESSING value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + * @property {number} CANCELLING=5 CANCELLING value + * @property {number} CANCELLED=6 CANCELLED value + */ + BatchOperationMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INITIALIZING"] = 1; + values[valuesById[2] = "PROCESSING"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "CANCELLING"] = 5; + values[valuesById[6] = "CANCELLED"] = 6; + return values; + })(); + + return BatchOperationMetadata; + })(); + + v4beta1.Company = (function() { + + /** + * Properties of a Company. + * @memberof google.cloud.talent.v4beta1 + * @interface ICompany + * @property {string|null} [name] Company name + * @property {string|null} [displayName] Company displayName + * @property {string|null} [externalId] Company externalId + * @property {google.cloud.talent.v4beta1.CompanySize|null} [size] Company size + * @property {string|null} [headquartersAddress] Company headquartersAddress + * @property {boolean|null} [hiringAgency] Company hiringAgency + * @property {string|null} [eeoText] Company eeoText + * @property {string|null} [websiteUri] Company websiteUri + * @property {string|null} [careerSiteUri] Company careerSiteUri + * @property {string|null} [imageUri] Company imageUri + * @property {Array.|null} [keywordSearchableJobCustomAttributes] Company keywordSearchableJobCustomAttributes + * @property {google.cloud.talent.v4beta1.Company.IDerivedInfo|null} [derivedInfo] Company derivedInfo + * @property {boolean|null} [suspended] Company suspended + */ + + /** + * Constructs a new Company. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a Company. + * @implements ICompany + * @constructor + * @param {google.cloud.talent.v4beta1.ICompany=} [properties] Properties to set + */ + function Company(properties) { + this.keywordSearchableJobCustomAttributes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Company name. + * @member {string} name + * @memberof google.cloud.talent.v4beta1.Company + * @instance + */ + Company.prototype.name = ""; + + /** + * Company displayName. + * @member {string} displayName + * @memberof google.cloud.talent.v4beta1.Company + * @instance + */ + Company.prototype.displayName = ""; + + /** + * Company externalId. + * @member {string} externalId + * @memberof google.cloud.talent.v4beta1.Company + * @instance + */ + Company.prototype.externalId = ""; + + /** + * Company size. + * @member {google.cloud.talent.v4beta1.CompanySize} size + * @memberof google.cloud.talent.v4beta1.Company + * @instance + */ + Company.prototype.size = 0; + + /** + * Company headquartersAddress. + * @member {string} headquartersAddress + * @memberof google.cloud.talent.v4beta1.Company + * @instance + */ + Company.prototype.headquartersAddress = ""; + + /** + * Company hiringAgency. + * @member {boolean} hiringAgency + * @memberof google.cloud.talent.v4beta1.Company + * @instance + */ + Company.prototype.hiringAgency = false; + + /** + * Company eeoText. + * @member {string} eeoText + * @memberof google.cloud.talent.v4beta1.Company + * @instance + */ + Company.prototype.eeoText = ""; + + /** + * Company websiteUri. + * @member {string} websiteUri + * @memberof google.cloud.talent.v4beta1.Company + * @instance + */ + Company.prototype.websiteUri = ""; + + /** + * Company careerSiteUri. + * @member {string} careerSiteUri + * @memberof google.cloud.talent.v4beta1.Company + * @instance + */ + Company.prototype.careerSiteUri = ""; + + /** + * Company imageUri. + * @member {string} imageUri + * @memberof google.cloud.talent.v4beta1.Company + * @instance + */ + Company.prototype.imageUri = ""; + + /** + * Company keywordSearchableJobCustomAttributes. + * @member {Array.} keywordSearchableJobCustomAttributes + * @memberof google.cloud.talent.v4beta1.Company + * @instance + */ + Company.prototype.keywordSearchableJobCustomAttributes = $util.emptyArray; + + /** + * Company derivedInfo. + * @member {google.cloud.talent.v4beta1.Company.IDerivedInfo|null|undefined} derivedInfo + * @memberof google.cloud.talent.v4beta1.Company + * @instance + */ + Company.prototype.derivedInfo = null; + + /** + * Company suspended. + * @member {boolean} suspended + * @memberof google.cloud.talent.v4beta1.Company + * @instance + */ + Company.prototype.suspended = false; + + /** + * Creates a new Company instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.Company + * @static + * @param {google.cloud.talent.v4beta1.ICompany=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.Company} Company instance + */ + Company.create = function create(properties) { + return new Company(properties); + }; + + /** + * Encodes the specified Company message. Does not implicitly {@link google.cloud.talent.v4beta1.Company.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.Company + * @static + * @param {google.cloud.talent.v4beta1.ICompany} message Company message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Company.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.externalId != null && Object.hasOwnProperty.call(message, "externalId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalId); + if (message.size != null && Object.hasOwnProperty.call(message, "size")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.size); + if (message.headquartersAddress != null && Object.hasOwnProperty.call(message, "headquartersAddress")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.headquartersAddress); + if (message.hiringAgency != null && Object.hasOwnProperty.call(message, "hiringAgency")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.hiringAgency); + if (message.eeoText != null && Object.hasOwnProperty.call(message, "eeoText")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.eeoText); + if (message.websiteUri != null && Object.hasOwnProperty.call(message, "websiteUri")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.websiteUri); + if (message.careerSiteUri != null && Object.hasOwnProperty.call(message, "careerSiteUri")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.careerSiteUri); + if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.imageUri); + if (message.keywordSearchableJobCustomAttributes != null && message.keywordSearchableJobCustomAttributes.length) + for (var i = 0; i < message.keywordSearchableJobCustomAttributes.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.keywordSearchableJobCustomAttributes[i]); + if (message.derivedInfo != null && Object.hasOwnProperty.call(message, "derivedInfo")) + $root.google.cloud.talent.v4beta1.Company.DerivedInfo.encode(message.derivedInfo, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.suspended != null && Object.hasOwnProperty.call(message, "suspended")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.suspended); + return writer; + }; + + /** + * Encodes the specified Company message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.Company.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.Company + * @static + * @param {google.cloud.talent.v4beta1.ICompany} message Company message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Company.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Company message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.Company + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.Company} Company + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Company.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.Company(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.externalId = reader.string(); + break; + } + case 4: { + message.size = reader.int32(); + break; + } + case 5: { + message.headquartersAddress = reader.string(); + break; + } + case 6: { + message.hiringAgency = reader.bool(); + break; + } + case 7: { + message.eeoText = reader.string(); + break; + } + case 8: { + message.websiteUri = reader.string(); + break; + } + case 9: { + message.careerSiteUri = reader.string(); + break; + } + case 10: { + message.imageUri = reader.string(); + break; + } + case 11: { + if (!(message.keywordSearchableJobCustomAttributes && message.keywordSearchableJobCustomAttributes.length)) + message.keywordSearchableJobCustomAttributes = []; + message.keywordSearchableJobCustomAttributes.push(reader.string()); + break; + } + case 12: { + message.derivedInfo = $root.google.cloud.talent.v4beta1.Company.DerivedInfo.decode(reader, reader.uint32()); + break; + } + case 13: { + message.suspended = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Company message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.Company + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.Company} Company + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Company.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Company message. + * @function verify + * @memberof google.cloud.talent.v4beta1.Company + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Company.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.externalId != null && message.hasOwnProperty("externalId")) + if (!$util.isString(message.externalId)) + return "externalId: string expected"; + if (message.size != null && message.hasOwnProperty("size")) + switch (message.size) { + default: + return "size: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.headquartersAddress != null && message.hasOwnProperty("headquartersAddress")) + if (!$util.isString(message.headquartersAddress)) + return "headquartersAddress: string expected"; + if (message.hiringAgency != null && message.hasOwnProperty("hiringAgency")) + if (typeof message.hiringAgency !== "boolean") + return "hiringAgency: boolean expected"; + if (message.eeoText != null && message.hasOwnProperty("eeoText")) + if (!$util.isString(message.eeoText)) + return "eeoText: string expected"; + if (message.websiteUri != null && message.hasOwnProperty("websiteUri")) + if (!$util.isString(message.websiteUri)) + return "websiteUri: string expected"; + if (message.careerSiteUri != null && message.hasOwnProperty("careerSiteUri")) + if (!$util.isString(message.careerSiteUri)) + return "careerSiteUri: string expected"; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + if (message.keywordSearchableJobCustomAttributes != null && message.hasOwnProperty("keywordSearchableJobCustomAttributes")) { + if (!Array.isArray(message.keywordSearchableJobCustomAttributes)) + return "keywordSearchableJobCustomAttributes: array expected"; + for (var i = 0; i < message.keywordSearchableJobCustomAttributes.length; ++i) + if (!$util.isString(message.keywordSearchableJobCustomAttributes[i])) + return "keywordSearchableJobCustomAttributes: string[] expected"; + } + if (message.derivedInfo != null && message.hasOwnProperty("derivedInfo")) { + var error = $root.google.cloud.talent.v4beta1.Company.DerivedInfo.verify(message.derivedInfo); + if (error) + return "derivedInfo." + error; + } + if (message.suspended != null && message.hasOwnProperty("suspended")) + if (typeof message.suspended !== "boolean") + return "suspended: boolean expected"; + return null; + }; + + /** + * Creates a Company message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.Company + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.Company} Company + */ + Company.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.Company) + return object; + var message = new $root.google.cloud.talent.v4beta1.Company(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.externalId != null) + message.externalId = String(object.externalId); + switch (object.size) { + default: + if (typeof object.size === "number") { + message.size = object.size; + break; + } + break; + case "COMPANY_SIZE_UNSPECIFIED": + case 0: + message.size = 0; + break; + case "MINI": + case 1: + message.size = 1; + break; + case "SMALL": + case 2: + message.size = 2; + break; + case "SMEDIUM": + case 3: + message.size = 3; + break; + case "MEDIUM": + case 4: + message.size = 4; + break; + case "BIG": + case 5: + message.size = 5; + break; + case "BIGGER": + case 6: + message.size = 6; + break; + case "GIANT": + case 7: + message.size = 7; + break; + } + if (object.headquartersAddress != null) + message.headquartersAddress = String(object.headquartersAddress); + if (object.hiringAgency != null) + message.hiringAgency = Boolean(object.hiringAgency); + if (object.eeoText != null) + message.eeoText = String(object.eeoText); + if (object.websiteUri != null) + message.websiteUri = String(object.websiteUri); + if (object.careerSiteUri != null) + message.careerSiteUri = String(object.careerSiteUri); + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + if (object.keywordSearchableJobCustomAttributes) { + if (!Array.isArray(object.keywordSearchableJobCustomAttributes)) + throw TypeError(".google.cloud.talent.v4beta1.Company.keywordSearchableJobCustomAttributes: array expected"); + message.keywordSearchableJobCustomAttributes = []; + for (var i = 0; i < object.keywordSearchableJobCustomAttributes.length; ++i) + message.keywordSearchableJobCustomAttributes[i] = String(object.keywordSearchableJobCustomAttributes[i]); + } + if (object.derivedInfo != null) { + if (typeof object.derivedInfo !== "object") + throw TypeError(".google.cloud.talent.v4beta1.Company.derivedInfo: object expected"); + message.derivedInfo = $root.google.cloud.talent.v4beta1.Company.DerivedInfo.fromObject(object.derivedInfo); + } + if (object.suspended != null) + message.suspended = Boolean(object.suspended); + return message; + }; + + /** + * Creates a plain object from a Company message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.Company + * @static + * @param {google.cloud.talent.v4beta1.Company} message Company + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Company.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keywordSearchableJobCustomAttributes = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.externalId = ""; + object.size = options.enums === String ? "COMPANY_SIZE_UNSPECIFIED" : 0; + object.headquartersAddress = ""; + object.hiringAgency = false; + object.eeoText = ""; + object.websiteUri = ""; + object.careerSiteUri = ""; + object.imageUri = ""; + object.derivedInfo = null; + object.suspended = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.externalId != null && message.hasOwnProperty("externalId")) + object.externalId = message.externalId; + if (message.size != null && message.hasOwnProperty("size")) + object.size = options.enums === String ? $root.google.cloud.talent.v4beta1.CompanySize[message.size] === undefined ? message.size : $root.google.cloud.talent.v4beta1.CompanySize[message.size] : message.size; + if (message.headquartersAddress != null && message.hasOwnProperty("headquartersAddress")) + object.headquartersAddress = message.headquartersAddress; + if (message.hiringAgency != null && message.hasOwnProperty("hiringAgency")) + object.hiringAgency = message.hiringAgency; + if (message.eeoText != null && message.hasOwnProperty("eeoText")) + object.eeoText = message.eeoText; + if (message.websiteUri != null && message.hasOwnProperty("websiteUri")) + object.websiteUri = message.websiteUri; + if (message.careerSiteUri != null && message.hasOwnProperty("careerSiteUri")) + object.careerSiteUri = message.careerSiteUri; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + if (message.keywordSearchableJobCustomAttributes && message.keywordSearchableJobCustomAttributes.length) { + object.keywordSearchableJobCustomAttributes = []; + for (var j = 0; j < message.keywordSearchableJobCustomAttributes.length; ++j) + object.keywordSearchableJobCustomAttributes[j] = message.keywordSearchableJobCustomAttributes[j]; + } + if (message.derivedInfo != null && message.hasOwnProperty("derivedInfo")) + object.derivedInfo = $root.google.cloud.talent.v4beta1.Company.DerivedInfo.toObject(message.derivedInfo, options); + if (message.suspended != null && message.hasOwnProperty("suspended")) + object.suspended = message.suspended; + return object; + }; + + /** + * Converts this Company to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.Company + * @instance + * @returns {Object.} JSON object + */ + Company.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Company + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.Company + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Company.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.Company"; + }; + + Company.DerivedInfo = (function() { + + /** + * Properties of a DerivedInfo. + * @memberof google.cloud.talent.v4beta1.Company + * @interface IDerivedInfo + * @property {google.cloud.talent.v4beta1.ILocation|null} [headquartersLocation] DerivedInfo headquartersLocation + */ + + /** + * Constructs a new DerivedInfo. + * @memberof google.cloud.talent.v4beta1.Company + * @classdesc Represents a DerivedInfo. + * @implements IDerivedInfo + * @constructor + * @param {google.cloud.talent.v4beta1.Company.IDerivedInfo=} [properties] Properties to set + */ + function DerivedInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DerivedInfo headquartersLocation. + * @member {google.cloud.talent.v4beta1.ILocation|null|undefined} headquartersLocation + * @memberof google.cloud.talent.v4beta1.Company.DerivedInfo + * @instance + */ + DerivedInfo.prototype.headquartersLocation = null; + + /** + * Creates a new DerivedInfo instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.Company.DerivedInfo + * @static + * @param {google.cloud.talent.v4beta1.Company.IDerivedInfo=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.Company.DerivedInfo} DerivedInfo instance + */ + DerivedInfo.create = function create(properties) { + return new DerivedInfo(properties); + }; + + /** + * Encodes the specified DerivedInfo message. Does not implicitly {@link google.cloud.talent.v4beta1.Company.DerivedInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.Company.DerivedInfo + * @static + * @param {google.cloud.talent.v4beta1.Company.IDerivedInfo} message DerivedInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DerivedInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.headquartersLocation != null && Object.hasOwnProperty.call(message, "headquartersLocation")) + $root.google.cloud.talent.v4beta1.Location.encode(message.headquartersLocation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DerivedInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.Company.DerivedInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.Company.DerivedInfo + * @static + * @param {google.cloud.talent.v4beta1.Company.IDerivedInfo} message DerivedInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DerivedInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DerivedInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.Company.DerivedInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.Company.DerivedInfo} DerivedInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DerivedInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.Company.DerivedInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.headquartersLocation = $root.google.cloud.talent.v4beta1.Location.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DerivedInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.Company.DerivedInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.Company.DerivedInfo} DerivedInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DerivedInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DerivedInfo message. + * @function verify + * @memberof google.cloud.talent.v4beta1.Company.DerivedInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DerivedInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.headquartersLocation != null && message.hasOwnProperty("headquartersLocation")) { + var error = $root.google.cloud.talent.v4beta1.Location.verify(message.headquartersLocation); + if (error) + return "headquartersLocation." + error; + } + return null; + }; + + /** + * Creates a DerivedInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.Company.DerivedInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.Company.DerivedInfo} DerivedInfo + */ + DerivedInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.Company.DerivedInfo) + return object; + var message = new $root.google.cloud.talent.v4beta1.Company.DerivedInfo(); + if (object.headquartersLocation != null) { + if (typeof object.headquartersLocation !== "object") + throw TypeError(".google.cloud.talent.v4beta1.Company.DerivedInfo.headquartersLocation: object expected"); + message.headquartersLocation = $root.google.cloud.talent.v4beta1.Location.fromObject(object.headquartersLocation); + } + return message; + }; + + /** + * Creates a plain object from a DerivedInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.Company.DerivedInfo + * @static + * @param {google.cloud.talent.v4beta1.Company.DerivedInfo} message DerivedInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DerivedInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.headquartersLocation = null; + if (message.headquartersLocation != null && message.hasOwnProperty("headquartersLocation")) + object.headquartersLocation = $root.google.cloud.talent.v4beta1.Location.toObject(message.headquartersLocation, options); + return object; + }; + + /** + * Converts this DerivedInfo to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.Company.DerivedInfo + * @instance + * @returns {Object.} JSON object + */ + DerivedInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DerivedInfo + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.Company.DerivedInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DerivedInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.Company.DerivedInfo"; + }; + + return DerivedInfo; + })(); + + return Company; + })(); + + v4beta1.CompanyService = (function() { + + /** + * Constructs a new CompanyService service. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a CompanyService + * @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 CompanyService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CompanyService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CompanyService; + + /** + * Creates new CompanyService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.talent.v4beta1.CompanyService + * @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 {CompanyService} RPC service. Useful where requests and/or responses are streamed. + */ + CompanyService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.CompanyService|createCompany}. + * @memberof google.cloud.talent.v4beta1.CompanyService + * @typedef CreateCompanyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4beta1.Company} [response] Company + */ + + /** + * Calls CreateCompany. + * @function createCompany + * @memberof google.cloud.talent.v4beta1.CompanyService + * @instance + * @param {google.cloud.talent.v4beta1.ICreateCompanyRequest} request CreateCompanyRequest message or plain object + * @param {google.cloud.talent.v4beta1.CompanyService.CreateCompanyCallback} callback Node-style callback called with the error, if any, and Company + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CompanyService.prototype.createCompany = function createCompany(request, callback) { + return this.rpcCall(createCompany, $root.google.cloud.talent.v4beta1.CreateCompanyRequest, $root.google.cloud.talent.v4beta1.Company, request, callback); + }, "name", { value: "CreateCompany" }); + + /** + * Calls CreateCompany. + * @function createCompany + * @memberof google.cloud.talent.v4beta1.CompanyService + * @instance + * @param {google.cloud.talent.v4beta1.ICreateCompanyRequest} request CreateCompanyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.CompanyService|getCompany}. + * @memberof google.cloud.talent.v4beta1.CompanyService + * @typedef GetCompanyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4beta1.Company} [response] Company + */ + + /** + * Calls GetCompany. + * @function getCompany + * @memberof google.cloud.talent.v4beta1.CompanyService + * @instance + * @param {google.cloud.talent.v4beta1.IGetCompanyRequest} request GetCompanyRequest message or plain object + * @param {google.cloud.talent.v4beta1.CompanyService.GetCompanyCallback} callback Node-style callback called with the error, if any, and Company + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CompanyService.prototype.getCompany = function getCompany(request, callback) { + return this.rpcCall(getCompany, $root.google.cloud.talent.v4beta1.GetCompanyRequest, $root.google.cloud.talent.v4beta1.Company, request, callback); + }, "name", { value: "GetCompany" }); + + /** + * Calls GetCompany. + * @function getCompany + * @memberof google.cloud.talent.v4beta1.CompanyService + * @instance + * @param {google.cloud.talent.v4beta1.IGetCompanyRequest} request GetCompanyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.CompanyService|updateCompany}. + * @memberof google.cloud.talent.v4beta1.CompanyService + * @typedef UpdateCompanyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4beta1.Company} [response] Company + */ + + /** + * Calls UpdateCompany. + * @function updateCompany + * @memberof google.cloud.talent.v4beta1.CompanyService + * @instance + * @param {google.cloud.talent.v4beta1.IUpdateCompanyRequest} request UpdateCompanyRequest message or plain object + * @param {google.cloud.talent.v4beta1.CompanyService.UpdateCompanyCallback} callback Node-style callback called with the error, if any, and Company + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CompanyService.prototype.updateCompany = function updateCompany(request, callback) { + return this.rpcCall(updateCompany, $root.google.cloud.talent.v4beta1.UpdateCompanyRequest, $root.google.cloud.talent.v4beta1.Company, request, callback); + }, "name", { value: "UpdateCompany" }); + + /** + * Calls UpdateCompany. + * @function updateCompany + * @memberof google.cloud.talent.v4beta1.CompanyService + * @instance + * @param {google.cloud.talent.v4beta1.IUpdateCompanyRequest} request UpdateCompanyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.CompanyService|deleteCompany}. + * @memberof google.cloud.talent.v4beta1.CompanyService + * @typedef DeleteCompanyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteCompany. + * @function deleteCompany + * @memberof google.cloud.talent.v4beta1.CompanyService + * @instance + * @param {google.cloud.talent.v4beta1.IDeleteCompanyRequest} request DeleteCompanyRequest message or plain object + * @param {google.cloud.talent.v4beta1.CompanyService.DeleteCompanyCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CompanyService.prototype.deleteCompany = function deleteCompany(request, callback) { + return this.rpcCall(deleteCompany, $root.google.cloud.talent.v4beta1.DeleteCompanyRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteCompany" }); + + /** + * Calls DeleteCompany. + * @function deleteCompany + * @memberof google.cloud.talent.v4beta1.CompanyService + * @instance + * @param {google.cloud.talent.v4beta1.IDeleteCompanyRequest} request DeleteCompanyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.CompanyService|listCompanies}. + * @memberof google.cloud.talent.v4beta1.CompanyService + * @typedef ListCompaniesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4beta1.ListCompaniesResponse} [response] ListCompaniesResponse + */ + + /** + * Calls ListCompanies. + * @function listCompanies + * @memberof google.cloud.talent.v4beta1.CompanyService + * @instance + * @param {google.cloud.talent.v4beta1.IListCompaniesRequest} request ListCompaniesRequest message or plain object + * @param {google.cloud.talent.v4beta1.CompanyService.ListCompaniesCallback} callback Node-style callback called with the error, if any, and ListCompaniesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CompanyService.prototype.listCompanies = function listCompanies(request, callback) { + return this.rpcCall(listCompanies, $root.google.cloud.talent.v4beta1.ListCompaniesRequest, $root.google.cloud.talent.v4beta1.ListCompaniesResponse, request, callback); + }, "name", { value: "ListCompanies" }); + + /** + * Calls ListCompanies. + * @function listCompanies + * @memberof google.cloud.talent.v4beta1.CompanyService + * @instance + * @param {google.cloud.talent.v4beta1.IListCompaniesRequest} request ListCompaniesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CompanyService; + })(); + + v4beta1.CreateCompanyRequest = (function() { + + /** + * Properties of a CreateCompanyRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface ICreateCompanyRequest + * @property {string|null} [parent] CreateCompanyRequest parent + * @property {google.cloud.talent.v4beta1.ICompany|null} [company] CreateCompanyRequest company + */ + + /** + * Constructs a new CreateCompanyRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a CreateCompanyRequest. + * @implements ICreateCompanyRequest + * @constructor + * @param {google.cloud.talent.v4beta1.ICreateCompanyRequest=} [properties] Properties to set + */ + function CreateCompanyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCompanyRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4beta1.CreateCompanyRequest + * @instance + */ + CreateCompanyRequest.prototype.parent = ""; + + /** + * CreateCompanyRequest company. + * @member {google.cloud.talent.v4beta1.ICompany|null|undefined} company + * @memberof google.cloud.talent.v4beta1.CreateCompanyRequest + * @instance + */ + CreateCompanyRequest.prototype.company = null; + + /** + * Creates a new CreateCompanyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.CreateCompanyRequest + * @static + * @param {google.cloud.talent.v4beta1.ICreateCompanyRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.CreateCompanyRequest} CreateCompanyRequest instance + */ + CreateCompanyRequest.create = function create(properties) { + return new CreateCompanyRequest(properties); + }; + + /** + * Encodes the specified CreateCompanyRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.CreateCompanyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.CreateCompanyRequest + * @static + * @param {google.cloud.talent.v4beta1.ICreateCompanyRequest} message CreateCompanyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCompanyRequest.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.company != null && Object.hasOwnProperty.call(message, "company")) + $root.google.cloud.talent.v4beta1.Company.encode(message.company, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCompanyRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CreateCompanyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.CreateCompanyRequest + * @static + * @param {google.cloud.talent.v4beta1.ICreateCompanyRequest} message CreateCompanyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCompanyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCompanyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.CreateCompanyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.CreateCompanyRequest} CreateCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCompanyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.CreateCompanyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.company = $root.google.cloud.talent.v4beta1.Company.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCompanyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.CreateCompanyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.CreateCompanyRequest} CreateCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCompanyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCompanyRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.CreateCompanyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCompanyRequest.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.company != null && message.hasOwnProperty("company")) { + var error = $root.google.cloud.talent.v4beta1.Company.verify(message.company); + if (error) + return "company." + error; + } + return null; + }; + + /** + * Creates a CreateCompanyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.CreateCompanyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.CreateCompanyRequest} CreateCompanyRequest + */ + CreateCompanyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.CreateCompanyRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.CreateCompanyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.company != null) { + if (typeof object.company !== "object") + throw TypeError(".google.cloud.talent.v4beta1.CreateCompanyRequest.company: object expected"); + message.company = $root.google.cloud.talent.v4beta1.Company.fromObject(object.company); + } + return message; + }; + + /** + * Creates a plain object from a CreateCompanyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.CreateCompanyRequest + * @static + * @param {google.cloud.talent.v4beta1.CreateCompanyRequest} message CreateCompanyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCompanyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.company = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.company != null && message.hasOwnProperty("company")) + object.company = $root.google.cloud.talent.v4beta1.Company.toObject(message.company, options); + return object; + }; + + /** + * Converts this CreateCompanyRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.CreateCompanyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCompanyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCompanyRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.CreateCompanyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCompanyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.CreateCompanyRequest"; + }; + + return CreateCompanyRequest; + })(); + + v4beta1.GetCompanyRequest = (function() { + + /** + * Properties of a GetCompanyRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface IGetCompanyRequest + * @property {string|null} [name] GetCompanyRequest name + */ + + /** + * Constructs a new GetCompanyRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a GetCompanyRequest. + * @implements IGetCompanyRequest + * @constructor + * @param {google.cloud.talent.v4beta1.IGetCompanyRequest=} [properties] Properties to set + */ + function GetCompanyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCompanyRequest name. + * @member {string} name + * @memberof google.cloud.talent.v4beta1.GetCompanyRequest + * @instance + */ + GetCompanyRequest.prototype.name = ""; + + /** + * Creates a new GetCompanyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.GetCompanyRequest + * @static + * @param {google.cloud.talent.v4beta1.IGetCompanyRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.GetCompanyRequest} GetCompanyRequest instance + */ + GetCompanyRequest.create = function create(properties) { + return new GetCompanyRequest(properties); + }; + + /** + * Encodes the specified GetCompanyRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.GetCompanyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.GetCompanyRequest + * @static + * @param {google.cloud.talent.v4beta1.IGetCompanyRequest} message GetCompanyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCompanyRequest.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 GetCompanyRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.GetCompanyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.GetCompanyRequest + * @static + * @param {google.cloud.talent.v4beta1.IGetCompanyRequest} message GetCompanyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCompanyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCompanyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.GetCompanyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.GetCompanyRequest} GetCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCompanyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.GetCompanyRequest(); + 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 GetCompanyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.GetCompanyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.GetCompanyRequest} GetCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCompanyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCompanyRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.GetCompanyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCompanyRequest.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 GetCompanyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.GetCompanyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.GetCompanyRequest} GetCompanyRequest + */ + GetCompanyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.GetCompanyRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.GetCompanyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCompanyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.GetCompanyRequest + * @static + * @param {google.cloud.talent.v4beta1.GetCompanyRequest} message GetCompanyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCompanyRequest.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 GetCompanyRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.GetCompanyRequest + * @instance + * @returns {Object.} JSON object + */ + GetCompanyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCompanyRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.GetCompanyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCompanyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.GetCompanyRequest"; + }; + + return GetCompanyRequest; + })(); + + v4beta1.UpdateCompanyRequest = (function() { + + /** + * Properties of an UpdateCompanyRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface IUpdateCompanyRequest + * @property {google.cloud.talent.v4beta1.ICompany|null} [company] UpdateCompanyRequest company + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCompanyRequest updateMask + */ + + /** + * Constructs a new UpdateCompanyRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents an UpdateCompanyRequest. + * @implements IUpdateCompanyRequest + * @constructor + * @param {google.cloud.talent.v4beta1.IUpdateCompanyRequest=} [properties] Properties to set + */ + function UpdateCompanyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCompanyRequest company. + * @member {google.cloud.talent.v4beta1.ICompany|null|undefined} company + * @memberof google.cloud.talent.v4beta1.UpdateCompanyRequest + * @instance + */ + UpdateCompanyRequest.prototype.company = null; + + /** + * UpdateCompanyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.talent.v4beta1.UpdateCompanyRequest + * @instance + */ + UpdateCompanyRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCompanyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.UpdateCompanyRequest + * @static + * @param {google.cloud.talent.v4beta1.IUpdateCompanyRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.UpdateCompanyRequest} UpdateCompanyRequest instance + */ + UpdateCompanyRequest.create = function create(properties) { + return new UpdateCompanyRequest(properties); + }; + + /** + * Encodes the specified UpdateCompanyRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.UpdateCompanyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.UpdateCompanyRequest + * @static + * @param {google.cloud.talent.v4beta1.IUpdateCompanyRequest} message UpdateCompanyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCompanyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.company != null && Object.hasOwnProperty.call(message, "company")) + $root.google.cloud.talent.v4beta1.Company.encode(message.company, 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 UpdateCompanyRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.UpdateCompanyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.UpdateCompanyRequest + * @static + * @param {google.cloud.talent.v4beta1.IUpdateCompanyRequest} message UpdateCompanyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCompanyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCompanyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.UpdateCompanyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.UpdateCompanyRequest} UpdateCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCompanyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.UpdateCompanyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.company = $root.google.cloud.talent.v4beta1.Company.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 UpdateCompanyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.UpdateCompanyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.UpdateCompanyRequest} UpdateCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCompanyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCompanyRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.UpdateCompanyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCompanyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.company != null && message.hasOwnProperty("company")) { + var error = $root.google.cloud.talent.v4beta1.Company.verify(message.company); + if (error) + return "company." + 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 UpdateCompanyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.UpdateCompanyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.UpdateCompanyRequest} UpdateCompanyRequest + */ + UpdateCompanyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.UpdateCompanyRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.UpdateCompanyRequest(); + if (object.company != null) { + if (typeof object.company !== "object") + throw TypeError(".google.cloud.talent.v4beta1.UpdateCompanyRequest.company: object expected"); + message.company = $root.google.cloud.talent.v4beta1.Company.fromObject(object.company); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.talent.v4beta1.UpdateCompanyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCompanyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.UpdateCompanyRequest + * @static + * @param {google.cloud.talent.v4beta1.UpdateCompanyRequest} message UpdateCompanyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCompanyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.company = null; + object.updateMask = null; + } + if (message.company != null && message.hasOwnProperty("company")) + object.company = $root.google.cloud.talent.v4beta1.Company.toObject(message.company, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCompanyRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.UpdateCompanyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCompanyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCompanyRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.UpdateCompanyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCompanyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.UpdateCompanyRequest"; + }; + + return UpdateCompanyRequest; + })(); + + v4beta1.DeleteCompanyRequest = (function() { + + /** + * Properties of a DeleteCompanyRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface IDeleteCompanyRequest + * @property {string|null} [name] DeleteCompanyRequest name + */ + + /** + * Constructs a new DeleteCompanyRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a DeleteCompanyRequest. + * @implements IDeleteCompanyRequest + * @constructor + * @param {google.cloud.talent.v4beta1.IDeleteCompanyRequest=} [properties] Properties to set + */ + function DeleteCompanyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteCompanyRequest name. + * @member {string} name + * @memberof google.cloud.talent.v4beta1.DeleteCompanyRequest + * @instance + */ + DeleteCompanyRequest.prototype.name = ""; + + /** + * Creates a new DeleteCompanyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.DeleteCompanyRequest + * @static + * @param {google.cloud.talent.v4beta1.IDeleteCompanyRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.DeleteCompanyRequest} DeleteCompanyRequest instance + */ + DeleteCompanyRequest.create = function create(properties) { + return new DeleteCompanyRequest(properties); + }; + + /** + * Encodes the specified DeleteCompanyRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.DeleteCompanyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.DeleteCompanyRequest + * @static + * @param {google.cloud.talent.v4beta1.IDeleteCompanyRequest} message DeleteCompanyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCompanyRequest.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 DeleteCompanyRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.DeleteCompanyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.DeleteCompanyRequest + * @static + * @param {google.cloud.talent.v4beta1.IDeleteCompanyRequest} message DeleteCompanyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCompanyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCompanyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.DeleteCompanyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.DeleteCompanyRequest} DeleteCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCompanyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.DeleteCompanyRequest(); + 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 DeleteCompanyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.DeleteCompanyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.DeleteCompanyRequest} DeleteCompanyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCompanyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCompanyRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.DeleteCompanyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCompanyRequest.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 DeleteCompanyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.DeleteCompanyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.DeleteCompanyRequest} DeleteCompanyRequest + */ + DeleteCompanyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.DeleteCompanyRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.DeleteCompanyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteCompanyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.DeleteCompanyRequest + * @static + * @param {google.cloud.talent.v4beta1.DeleteCompanyRequest} message DeleteCompanyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCompanyRequest.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 DeleteCompanyRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.DeleteCompanyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCompanyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCompanyRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.DeleteCompanyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCompanyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.DeleteCompanyRequest"; + }; + + return DeleteCompanyRequest; + })(); + + v4beta1.ListCompaniesRequest = (function() { + + /** + * Properties of a ListCompaniesRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface IListCompaniesRequest + * @property {string|null} [parent] ListCompaniesRequest parent + * @property {string|null} [pageToken] ListCompaniesRequest pageToken + * @property {number|null} [pageSize] ListCompaniesRequest pageSize + * @property {boolean|null} [requireOpenJobs] ListCompaniesRequest requireOpenJobs + */ + + /** + * Constructs a new ListCompaniesRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a ListCompaniesRequest. + * @implements IListCompaniesRequest + * @constructor + * @param {google.cloud.talent.v4beta1.IListCompaniesRequest=} [properties] Properties to set + */ + function ListCompaniesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCompaniesRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4beta1.ListCompaniesRequest + * @instance + */ + ListCompaniesRequest.prototype.parent = ""; + + /** + * ListCompaniesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.talent.v4beta1.ListCompaniesRequest + * @instance + */ + ListCompaniesRequest.prototype.pageToken = ""; + + /** + * ListCompaniesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.talent.v4beta1.ListCompaniesRequest + * @instance + */ + ListCompaniesRequest.prototype.pageSize = 0; + + /** + * ListCompaniesRequest requireOpenJobs. + * @member {boolean} requireOpenJobs + * @memberof google.cloud.talent.v4beta1.ListCompaniesRequest + * @instance + */ + ListCompaniesRequest.prototype.requireOpenJobs = false; + + /** + * Creates a new ListCompaniesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.ListCompaniesRequest + * @static + * @param {google.cloud.talent.v4beta1.IListCompaniesRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.ListCompaniesRequest} ListCompaniesRequest instance + */ + ListCompaniesRequest.create = function create(properties) { + return new ListCompaniesRequest(properties); + }; + + /** + * Encodes the specified ListCompaniesRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.ListCompaniesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.ListCompaniesRequest + * @static + * @param {google.cloud.talent.v4beta1.IListCompaniesRequest} message ListCompaniesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCompaniesRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.requireOpenJobs != null && Object.hasOwnProperty.call(message, "requireOpenJobs")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.requireOpenJobs); + return writer; + }; + + /** + * Encodes the specified ListCompaniesRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.ListCompaniesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.ListCompaniesRequest + * @static + * @param {google.cloud.talent.v4beta1.IListCompaniesRequest} message ListCompaniesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCompaniesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCompaniesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.ListCompaniesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.ListCompaniesRequest} ListCompaniesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCompaniesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.ListCompaniesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.requireOpenJobs = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCompaniesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.ListCompaniesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.ListCompaniesRequest} ListCompaniesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCompaniesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCompaniesRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.ListCompaniesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCompaniesRequest.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.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.requireOpenJobs != null && message.hasOwnProperty("requireOpenJobs")) + if (typeof message.requireOpenJobs !== "boolean") + return "requireOpenJobs: boolean expected"; + return null; + }; + + /** + * Creates a ListCompaniesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.ListCompaniesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.ListCompaniesRequest} ListCompaniesRequest + */ + ListCompaniesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.ListCompaniesRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.ListCompaniesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.requireOpenJobs != null) + message.requireOpenJobs = Boolean(object.requireOpenJobs); + return message; + }; + + /** + * Creates a plain object from a ListCompaniesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.ListCompaniesRequest + * @static + * @param {google.cloud.talent.v4beta1.ListCompaniesRequest} message ListCompaniesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCompaniesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + object.requireOpenJobs = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.requireOpenJobs != null && message.hasOwnProperty("requireOpenJobs")) + object.requireOpenJobs = message.requireOpenJobs; + return object; + }; + + /** + * Converts this ListCompaniesRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.ListCompaniesRequest + * @instance + * @returns {Object.} JSON object + */ + ListCompaniesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCompaniesRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.ListCompaniesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCompaniesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.ListCompaniesRequest"; + }; + + return ListCompaniesRequest; + })(); + + v4beta1.ListCompaniesResponse = (function() { + + /** + * Properties of a ListCompaniesResponse. + * @memberof google.cloud.talent.v4beta1 + * @interface IListCompaniesResponse + * @property {Array.|null} [companies] ListCompaniesResponse companies + * @property {string|null} [nextPageToken] ListCompaniesResponse nextPageToken + * @property {google.cloud.talent.v4beta1.IResponseMetadata|null} [metadata] ListCompaniesResponse metadata + */ + + /** + * Constructs a new ListCompaniesResponse. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a ListCompaniesResponse. + * @implements IListCompaniesResponse + * @constructor + * @param {google.cloud.talent.v4beta1.IListCompaniesResponse=} [properties] Properties to set + */ + function ListCompaniesResponse(properties) { + this.companies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCompaniesResponse companies. + * @member {Array.} companies + * @memberof google.cloud.talent.v4beta1.ListCompaniesResponse + * @instance + */ + ListCompaniesResponse.prototype.companies = $util.emptyArray; + + /** + * ListCompaniesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.talent.v4beta1.ListCompaniesResponse + * @instance + */ + ListCompaniesResponse.prototype.nextPageToken = ""; + + /** + * ListCompaniesResponse metadata. + * @member {google.cloud.talent.v4beta1.IResponseMetadata|null|undefined} metadata + * @memberof google.cloud.talent.v4beta1.ListCompaniesResponse + * @instance + */ + ListCompaniesResponse.prototype.metadata = null; + + /** + * Creates a new ListCompaniesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.ListCompaniesResponse + * @static + * @param {google.cloud.talent.v4beta1.IListCompaniesResponse=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.ListCompaniesResponse} ListCompaniesResponse instance + */ + ListCompaniesResponse.create = function create(properties) { + return new ListCompaniesResponse(properties); + }; + + /** + * Encodes the specified ListCompaniesResponse message. Does not implicitly {@link google.cloud.talent.v4beta1.ListCompaniesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.ListCompaniesResponse + * @static + * @param {google.cloud.talent.v4beta1.IListCompaniesResponse} message ListCompaniesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCompaniesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.companies != null && message.companies.length) + for (var i = 0; i < message.companies.length; ++i) + $root.google.cloud.talent.v4beta1.Company.encode(message.companies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.talent.v4beta1.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListCompaniesResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.ListCompaniesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.ListCompaniesResponse + * @static + * @param {google.cloud.talent.v4beta1.IListCompaniesResponse} message ListCompaniesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCompaniesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCompaniesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.ListCompaniesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.ListCompaniesResponse} ListCompaniesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCompaniesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.ListCompaniesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.companies && message.companies.length)) + message.companies = []; + message.companies.push($root.google.cloud.talent.v4beta1.Company.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.metadata = $root.google.cloud.talent.v4beta1.ResponseMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCompaniesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.ListCompaniesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.ListCompaniesResponse} ListCompaniesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCompaniesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCompaniesResponse message. + * @function verify + * @memberof google.cloud.talent.v4beta1.ListCompaniesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCompaniesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.companies != null && message.hasOwnProperty("companies")) { + if (!Array.isArray(message.companies)) + return "companies: array expected"; + for (var i = 0; i < message.companies.length; ++i) { + var error = $root.google.cloud.talent.v4beta1.Company.verify(message.companies[i]); + if (error) + return "companies." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.talent.v4beta1.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a ListCompaniesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.ListCompaniesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.ListCompaniesResponse} ListCompaniesResponse + */ + ListCompaniesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.ListCompaniesResponse) + return object; + var message = new $root.google.cloud.talent.v4beta1.ListCompaniesResponse(); + if (object.companies) { + if (!Array.isArray(object.companies)) + throw TypeError(".google.cloud.talent.v4beta1.ListCompaniesResponse.companies: array expected"); + message.companies = []; + for (var i = 0; i < object.companies.length; ++i) { + if (typeof object.companies[i] !== "object") + throw TypeError(".google.cloud.talent.v4beta1.ListCompaniesResponse.companies: object expected"); + message.companies[i] = $root.google.cloud.talent.v4beta1.Company.fromObject(object.companies[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.talent.v4beta1.ListCompaniesResponse.metadata: object expected"); + message.metadata = $root.google.cloud.talent.v4beta1.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a ListCompaniesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.ListCompaniesResponse + * @static + * @param {google.cloud.talent.v4beta1.ListCompaniesResponse} message ListCompaniesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCompaniesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.companies = []; + if (options.defaults) { + object.nextPageToken = ""; + object.metadata = null; + } + if (message.companies && message.companies.length) { + object.companies = []; + for (var j = 0; j < message.companies.length; ++j) + object.companies[j] = $root.google.cloud.talent.v4beta1.Company.toObject(message.companies[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.talent.v4beta1.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this ListCompaniesResponse to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.ListCompaniesResponse + * @instance + * @returns {Object.} JSON object + */ + ListCompaniesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCompaniesResponse + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.ListCompaniesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCompaniesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.ListCompaniesResponse"; + }; + + return ListCompaniesResponse; + })(); + + v4beta1.Completion = (function() { + + /** + * Constructs a new Completion service. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a Completion + * @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 Completion(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Completion.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Completion; + + /** + * Creates new Completion service using the specified rpc implementation. + * @function create + * @memberof google.cloud.talent.v4beta1.Completion + * @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 {Completion} RPC service. Useful where requests and/or responses are streamed. + */ + Completion.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.Completion|completeQuery}. + * @memberof google.cloud.talent.v4beta1.Completion + * @typedef CompleteQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4beta1.CompleteQueryResponse} [response] CompleteQueryResponse + */ + + /** + * Calls CompleteQuery. + * @function completeQuery + * @memberof google.cloud.talent.v4beta1.Completion + * @instance + * @param {google.cloud.talent.v4beta1.ICompleteQueryRequest} request CompleteQueryRequest message or plain object + * @param {google.cloud.talent.v4beta1.Completion.CompleteQueryCallback} callback Node-style callback called with the error, if any, and CompleteQueryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Completion.prototype.completeQuery = function completeQuery(request, callback) { + return this.rpcCall(completeQuery, $root.google.cloud.talent.v4beta1.CompleteQueryRequest, $root.google.cloud.talent.v4beta1.CompleteQueryResponse, request, callback); + }, "name", { value: "CompleteQuery" }); + + /** + * Calls CompleteQuery. + * @function completeQuery + * @memberof google.cloud.talent.v4beta1.Completion + * @instance + * @param {google.cloud.talent.v4beta1.ICompleteQueryRequest} request CompleteQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Completion; + })(); + + v4beta1.CompleteQueryRequest = (function() { + + /** + * Properties of a CompleteQueryRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface ICompleteQueryRequest + * @property {string|null} [parent] CompleteQueryRequest parent + * @property {string|null} [query] CompleteQueryRequest query + * @property {Array.|null} [languageCodes] CompleteQueryRequest languageCodes + * @property {number|null} [pageSize] CompleteQueryRequest pageSize + * @property {string|null} [company] CompleteQueryRequest company + * @property {google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope|null} [scope] CompleteQueryRequest scope + * @property {google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType|null} [type] CompleteQueryRequest type + */ + + /** + * Constructs a new CompleteQueryRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a CompleteQueryRequest. + * @implements ICompleteQueryRequest + * @constructor + * @param {google.cloud.talent.v4beta1.ICompleteQueryRequest=} [properties] Properties to set + */ + function CompleteQueryRequest(properties) { + this.languageCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompleteQueryRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4beta1.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.parent = ""; + + /** + * CompleteQueryRequest query. + * @member {string} query + * @memberof google.cloud.talent.v4beta1.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.query = ""; + + /** + * CompleteQueryRequest languageCodes. + * @member {Array.} languageCodes + * @memberof google.cloud.talent.v4beta1.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.languageCodes = $util.emptyArray; + + /** + * CompleteQueryRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.talent.v4beta1.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.pageSize = 0; + + /** + * CompleteQueryRequest company. + * @member {string} company + * @memberof google.cloud.talent.v4beta1.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.company = ""; + + /** + * CompleteQueryRequest scope. + * @member {google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope} scope + * @memberof google.cloud.talent.v4beta1.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.scope = 0; + + /** + * CompleteQueryRequest type. + * @member {google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType} type + * @memberof google.cloud.talent.v4beta1.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.type = 0; + + /** + * Creates a new CompleteQueryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.CompleteQueryRequest + * @static + * @param {google.cloud.talent.v4beta1.ICompleteQueryRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.CompleteQueryRequest} CompleteQueryRequest instance + */ + CompleteQueryRequest.create = function create(properties) { + return new CompleteQueryRequest(properties); + }; + + /** + * Encodes the specified CompleteQueryRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.CompleteQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.CompleteQueryRequest + * @static + * @param {google.cloud.talent.v4beta1.ICompleteQueryRequest} message CompleteQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryRequest.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.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.languageCodes != null && message.languageCodes.length) + for (var i = 0; i < message.languageCodes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCodes[i]); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.company != null && Object.hasOwnProperty.call(message, "company")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.company); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.scope); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.type); + return writer; + }; + + /** + * Encodes the specified CompleteQueryRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CompleteQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.CompleteQueryRequest + * @static + * @param {google.cloud.talent.v4beta1.ICompleteQueryRequest} message CompleteQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompleteQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.CompleteQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.CompleteQueryRequest} CompleteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteQueryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.CompleteQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 3: { + if (!(message.languageCodes && message.languageCodes.length)) + message.languageCodes = []; + message.languageCodes.push(reader.string()); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.company = reader.string(); + break; + } + case 6: { + message.scope = reader.int32(); + break; + } + case 7: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompleteQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.CompleteQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.CompleteQueryRequest} CompleteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompleteQueryRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.CompleteQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompleteQueryRequest.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.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.languageCodes != null && message.hasOwnProperty("languageCodes")) { + if (!Array.isArray(message.languageCodes)) + return "languageCodes: array expected"; + for (var i = 0; i < message.languageCodes.length; ++i) + if (!$util.isString(message.languageCodes[i])) + return "languageCodes: string[] expected"; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.company != null && message.hasOwnProperty("company")) + if (!$util.isString(message.company)) + return "company: string expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + switch (message.scope) { + default: + return "scope: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a CompleteQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.CompleteQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.CompleteQueryRequest} CompleteQueryRequest + */ + CompleteQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.CompleteQueryRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.CompleteQueryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.query != null) + message.query = String(object.query); + if (object.languageCodes) { + if (!Array.isArray(object.languageCodes)) + throw TypeError(".google.cloud.talent.v4beta1.CompleteQueryRequest.languageCodes: array expected"); + message.languageCodes = []; + for (var i = 0; i < object.languageCodes.length; ++i) + message.languageCodes[i] = String(object.languageCodes[i]); + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.company != null) + message.company = String(object.company); + switch (object.scope) { + default: + if (typeof object.scope === "number") { + message.scope = object.scope; + break; + } + break; + case "COMPLETION_SCOPE_UNSPECIFIED": + case 0: + message.scope = 0; + break; + case "TENANT": + case 1: + message.scope = 1; + break; + case "PUBLIC": + case 2: + message.scope = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "COMPLETION_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "JOB_TITLE": + case 1: + message.type = 1; + break; + case "COMPANY_NAME": + case 2: + message.type = 2; + break; + case "COMBINED": + case 3: + message.type = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a CompleteQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.CompleteQueryRequest + * @static + * @param {google.cloud.talent.v4beta1.CompleteQueryRequest} message CompleteQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompleteQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languageCodes = []; + if (options.defaults) { + object.parent = ""; + object.query = ""; + object.pageSize = 0; + object.company = ""; + object.scope = options.enums === String ? "COMPLETION_SCOPE_UNSPECIFIED" : 0; + object.type = options.enums === String ? "COMPLETION_TYPE_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.languageCodes && message.languageCodes.length) { + object.languageCodes = []; + for (var j = 0; j < message.languageCodes.length; ++j) + object.languageCodes[j] = message.languageCodes[j]; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.company != null && message.hasOwnProperty("company")) + object.company = message.company; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = options.enums === String ? $root.google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope[message.scope] === undefined ? message.scope : $root.google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope[message.scope] : message.scope; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType[message.type] === undefined ? message.type : $root.google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType[message.type] : message.type; + return object; + }; + + /** + * Converts this CompleteQueryRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.CompleteQueryRequest + * @instance + * @returns {Object.} JSON object + */ + CompleteQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompleteQueryRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.CompleteQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompleteQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.CompleteQueryRequest"; + }; + + /** + * CompletionScope enum. + * @name google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope + * @enum {number} + * @property {number} COMPLETION_SCOPE_UNSPECIFIED=0 COMPLETION_SCOPE_UNSPECIFIED value + * @property {number} TENANT=1 TENANT value + * @property {number} PUBLIC=2 PUBLIC value + */ + CompleteQueryRequest.CompletionScope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPLETION_SCOPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TENANT"] = 1; + values[valuesById[2] = "PUBLIC"] = 2; + return values; + })(); + + /** + * CompletionType enum. + * @name google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType + * @enum {number} + * @property {number} COMPLETION_TYPE_UNSPECIFIED=0 COMPLETION_TYPE_UNSPECIFIED value + * @property {number} JOB_TITLE=1 JOB_TITLE value + * @property {number} COMPANY_NAME=2 COMPANY_NAME value + * @property {number} COMBINED=3 COMBINED value + */ + CompleteQueryRequest.CompletionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPLETION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "JOB_TITLE"] = 1; + values[valuesById[2] = "COMPANY_NAME"] = 2; + values[valuesById[3] = "COMBINED"] = 3; + return values; + })(); + + return CompleteQueryRequest; + })(); + + v4beta1.CompleteQueryResponse = (function() { + + /** + * Properties of a CompleteQueryResponse. + * @memberof google.cloud.talent.v4beta1 + * @interface ICompleteQueryResponse + * @property {Array.|null} [completionResults] CompleteQueryResponse completionResults + * @property {google.cloud.talent.v4beta1.IResponseMetadata|null} [metadata] CompleteQueryResponse metadata + */ + + /** + * Constructs a new CompleteQueryResponse. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a CompleteQueryResponse. + * @implements ICompleteQueryResponse + * @constructor + * @param {google.cloud.talent.v4beta1.ICompleteQueryResponse=} [properties] Properties to set + */ + function CompleteQueryResponse(properties) { + this.completionResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompleteQueryResponse completionResults. + * @member {Array.} completionResults + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse + * @instance + */ + CompleteQueryResponse.prototype.completionResults = $util.emptyArray; + + /** + * CompleteQueryResponse metadata. + * @member {google.cloud.talent.v4beta1.IResponseMetadata|null|undefined} metadata + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse + * @instance + */ + CompleteQueryResponse.prototype.metadata = null; + + /** + * Creates a new CompleteQueryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse + * @static + * @param {google.cloud.talent.v4beta1.ICompleteQueryResponse=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.CompleteQueryResponse} CompleteQueryResponse instance + */ + CompleteQueryResponse.create = function create(properties) { + return new CompleteQueryResponse(properties); + }; + + /** + * Encodes the specified CompleteQueryResponse message. Does not implicitly {@link google.cloud.talent.v4beta1.CompleteQueryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse + * @static + * @param {google.cloud.talent.v4beta1.ICompleteQueryResponse} message CompleteQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.completionResults != null && message.completionResults.length) + for (var i = 0; i < message.completionResults.length; ++i) + $root.google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult.encode(message.completionResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.talent.v4beta1.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CompleteQueryResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CompleteQueryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse + * @static + * @param {google.cloud.talent.v4beta1.ICompleteQueryResponse} message CompleteQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompleteQueryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.CompleteQueryResponse} CompleteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteQueryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.CompleteQueryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.completionResults && message.completionResults.length)) + message.completionResults = []; + message.completionResults.push($root.google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.metadata = $root.google.cloud.talent.v4beta1.ResponseMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompleteQueryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.CompleteQueryResponse} CompleteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteQueryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompleteQueryResponse message. + * @function verify + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompleteQueryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.completionResults != null && message.hasOwnProperty("completionResults")) { + if (!Array.isArray(message.completionResults)) + return "completionResults: array expected"; + for (var i = 0; i < message.completionResults.length; ++i) { + var error = $root.google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult.verify(message.completionResults[i]); + if (error) + return "completionResults." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.talent.v4beta1.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a CompleteQueryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.CompleteQueryResponse} CompleteQueryResponse + */ + CompleteQueryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.CompleteQueryResponse) + return object; + var message = new $root.google.cloud.talent.v4beta1.CompleteQueryResponse(); + if (object.completionResults) { + if (!Array.isArray(object.completionResults)) + throw TypeError(".google.cloud.talent.v4beta1.CompleteQueryResponse.completionResults: array expected"); + message.completionResults = []; + for (var i = 0; i < object.completionResults.length; ++i) { + if (typeof object.completionResults[i] !== "object") + throw TypeError(".google.cloud.talent.v4beta1.CompleteQueryResponse.completionResults: object expected"); + message.completionResults[i] = $root.google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult.fromObject(object.completionResults[i]); + } + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.talent.v4beta1.CompleteQueryResponse.metadata: object expected"); + message.metadata = $root.google.cloud.talent.v4beta1.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a CompleteQueryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse + * @static + * @param {google.cloud.talent.v4beta1.CompleteQueryResponse} message CompleteQueryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompleteQueryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.completionResults = []; + if (options.defaults) + object.metadata = null; + if (message.completionResults && message.completionResults.length) { + object.completionResults = []; + for (var j = 0; j < message.completionResults.length; ++j) + object.completionResults[j] = $root.google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult.toObject(message.completionResults[j], options); + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.talent.v4beta1.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this CompleteQueryResponse to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse + * @instance + * @returns {Object.} JSON object + */ + CompleteQueryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompleteQueryResponse + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompleteQueryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.CompleteQueryResponse"; + }; + + CompleteQueryResponse.CompletionResult = (function() { + + /** + * Properties of a CompletionResult. + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse + * @interface ICompletionResult + * @property {string|null} [suggestion] CompletionResult suggestion + * @property {google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType|null} [type] CompletionResult type + * @property {string|null} [imageUri] CompletionResult imageUri + */ + + /** + * Constructs a new CompletionResult. + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse + * @classdesc Represents a CompletionResult. + * @implements ICompletionResult + * @constructor + * @param {google.cloud.talent.v4beta1.CompleteQueryResponse.ICompletionResult=} [properties] Properties to set + */ + function CompletionResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompletionResult suggestion. + * @member {string} suggestion + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult + * @instance + */ + CompletionResult.prototype.suggestion = ""; + + /** + * CompletionResult type. + * @member {google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType} type + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult + * @instance + */ + CompletionResult.prototype.type = 0; + + /** + * CompletionResult imageUri. + * @member {string} imageUri + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult + * @instance + */ + CompletionResult.prototype.imageUri = ""; + + /** + * Creates a new CompletionResult instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult + * @static + * @param {google.cloud.talent.v4beta1.CompleteQueryResponse.ICompletionResult=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult} CompletionResult instance + */ + CompletionResult.create = function create(properties) { + return new CompletionResult(properties); + }; + + /** + * Encodes the specified CompletionResult message. Does not implicitly {@link google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult + * @static + * @param {google.cloud.talent.v4beta1.CompleteQueryResponse.ICompletionResult} message CompletionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompletionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.suggestion != null && Object.hasOwnProperty.call(message, "suggestion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.suggestion); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.imageUri); + return writer; + }; + + /** + * Encodes the specified CompletionResult message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult + * @static + * @param {google.cloud.talent.v4beta1.CompleteQueryResponse.ICompletionResult} message CompletionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompletionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompletionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult} CompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompletionResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.suggestion = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + message.imageUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompletionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult} CompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompletionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompletionResult message. + * @function verify + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompletionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.suggestion != null && message.hasOwnProperty("suggestion")) + if (!$util.isString(message.suggestion)) + return "suggestion: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + return null; + }; + + /** + * Creates a CompletionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult} CompletionResult + */ + CompletionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult) + return object; + var message = new $root.google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult(); + if (object.suggestion != null) + message.suggestion = String(object.suggestion); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "COMPLETION_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "JOB_TITLE": + case 1: + message.type = 1; + break; + case "COMPANY_NAME": + case 2: + message.type = 2; + break; + case "COMBINED": + case 3: + message.type = 3; + break; + } + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + return message; + }; + + /** + * Creates a plain object from a CompletionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult + * @static + * @param {google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult} message CompletionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompletionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.suggestion = ""; + object.type = options.enums === String ? "COMPLETION_TYPE_UNSPECIFIED" : 0; + object.imageUri = ""; + } + if (message.suggestion != null && message.hasOwnProperty("suggestion")) + object.suggestion = message.suggestion; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType[message.type] === undefined ? message.type : $root.google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType[message.type] : message.type; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + return object; + }; + + /** + * Converts this CompletionResult to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult + * @instance + * @returns {Object.} JSON object + */ + CompletionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompletionResult + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompletionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult"; + }; + + return CompletionResult; + })(); + + return CompleteQueryResponse; + })(); + + v4beta1.ClientEvent = (function() { + + /** + * Properties of a ClientEvent. + * @memberof google.cloud.talent.v4beta1 + * @interface IClientEvent + * @property {string|null} [requestId] ClientEvent requestId + * @property {string|null} [eventId] ClientEvent eventId + * @property {google.protobuf.ITimestamp|null} [createTime] ClientEvent createTime + * @property {google.cloud.talent.v4beta1.IJobEvent|null} [jobEvent] ClientEvent jobEvent + * @property {string|null} [eventNotes] ClientEvent eventNotes + */ + + /** + * Constructs a new ClientEvent. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a ClientEvent. + * @implements IClientEvent + * @constructor + * @param {google.cloud.talent.v4beta1.IClientEvent=} [properties] Properties to set + */ + function ClientEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientEvent requestId. + * @member {string} requestId + * @memberof google.cloud.talent.v4beta1.ClientEvent + * @instance + */ + ClientEvent.prototype.requestId = ""; + + /** + * ClientEvent eventId. + * @member {string} eventId + * @memberof google.cloud.talent.v4beta1.ClientEvent + * @instance + */ + ClientEvent.prototype.eventId = ""; + + /** + * ClientEvent createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.talent.v4beta1.ClientEvent + * @instance + */ + ClientEvent.prototype.createTime = null; + + /** + * ClientEvent jobEvent. + * @member {google.cloud.talent.v4beta1.IJobEvent|null|undefined} jobEvent + * @memberof google.cloud.talent.v4beta1.ClientEvent + * @instance + */ + ClientEvent.prototype.jobEvent = null; + + /** + * ClientEvent eventNotes. + * @member {string} eventNotes + * @memberof google.cloud.talent.v4beta1.ClientEvent + * @instance + */ + ClientEvent.prototype.eventNotes = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ClientEvent event. + * @member {"jobEvent"|undefined} event + * @memberof google.cloud.talent.v4beta1.ClientEvent + * @instance + */ + Object.defineProperty(ClientEvent.prototype, "event", { + get: $util.oneOfGetter($oneOfFields = ["jobEvent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ClientEvent instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.ClientEvent + * @static + * @param {google.cloud.talent.v4beta1.IClientEvent=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.ClientEvent} ClientEvent instance + */ + ClientEvent.create = function create(properties) { + return new ClientEvent(properties); + }; + + /** + * Encodes the specified ClientEvent message. Does not implicitly {@link google.cloud.talent.v4beta1.ClientEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.ClientEvent + * @static + * @param {google.cloud.talent.v4beta1.IClientEvent} message ClientEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.requestId); + if (message.eventId != null && Object.hasOwnProperty.call(message, "eventId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.eventId); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.jobEvent != null && Object.hasOwnProperty.call(message, "jobEvent")) + $root.google.cloud.talent.v4beta1.JobEvent.encode(message.jobEvent, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.eventNotes != null && Object.hasOwnProperty.call(message, "eventNotes")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.eventNotes); + return writer; + }; + + /** + * Encodes the specified ClientEvent message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.ClientEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.ClientEvent + * @static + * @param {google.cloud.talent.v4beta1.IClientEvent} message ClientEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.ClientEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.ClientEvent} ClientEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.ClientEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.requestId = reader.string(); + break; + } + case 2: { + message.eventId = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.jobEvent = $root.google.cloud.talent.v4beta1.JobEvent.decode(reader, reader.uint32()); + break; + } + case 9: { + message.eventNotes = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.ClientEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.ClientEvent} ClientEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientEvent message. + * @function verify + * @memberof google.cloud.talent.v4beta1.ClientEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.eventId != null && message.hasOwnProperty("eventId")) + if (!$util.isString(message.eventId)) + return "eventId: 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.jobEvent != null && message.hasOwnProperty("jobEvent")) { + properties.event = 1; + { + var error = $root.google.cloud.talent.v4beta1.JobEvent.verify(message.jobEvent); + if (error) + return "jobEvent." + error; + } + } + if (message.eventNotes != null && message.hasOwnProperty("eventNotes")) + if (!$util.isString(message.eventNotes)) + return "eventNotes: string expected"; + return null; + }; + + /** + * Creates a ClientEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.ClientEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.ClientEvent} ClientEvent + */ + ClientEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.ClientEvent) + return object; + var message = new $root.google.cloud.talent.v4beta1.ClientEvent(); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.eventId != null) + message.eventId = String(object.eventId); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.talent.v4beta1.ClientEvent.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.jobEvent != null) { + if (typeof object.jobEvent !== "object") + throw TypeError(".google.cloud.talent.v4beta1.ClientEvent.jobEvent: object expected"); + message.jobEvent = $root.google.cloud.talent.v4beta1.JobEvent.fromObject(object.jobEvent); + } + if (object.eventNotes != null) + message.eventNotes = String(object.eventNotes); + return message; + }; + + /** + * Creates a plain object from a ClientEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.ClientEvent + * @static + * @param {google.cloud.talent.v4beta1.ClientEvent} message ClientEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.requestId = ""; + object.eventId = ""; + object.createTime = null; + object.eventNotes = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.eventId != null && message.hasOwnProperty("eventId")) + object.eventId = message.eventId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.jobEvent != null && message.hasOwnProperty("jobEvent")) { + object.jobEvent = $root.google.cloud.talent.v4beta1.JobEvent.toObject(message.jobEvent, options); + if (options.oneofs) + object.event = "jobEvent"; + } + if (message.eventNotes != null && message.hasOwnProperty("eventNotes")) + object.eventNotes = message.eventNotes; + return object; + }; + + /** + * Converts this ClientEvent to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.ClientEvent + * @instance + * @returns {Object.} JSON object + */ + ClientEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientEvent + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.ClientEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.ClientEvent"; + }; + + return ClientEvent; + })(); + + v4beta1.JobEvent = (function() { + + /** + * Properties of a JobEvent. + * @memberof google.cloud.talent.v4beta1 + * @interface IJobEvent + * @property {google.cloud.talent.v4beta1.JobEvent.JobEventType|null} [type] JobEvent type + * @property {Array.|null} [jobs] JobEvent jobs + * @property {string|null} [profile] JobEvent profile + */ + + /** + * Constructs a new JobEvent. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a JobEvent. + * @implements IJobEvent + * @constructor + * @param {google.cloud.talent.v4beta1.IJobEvent=} [properties] Properties to set + */ + function JobEvent(properties) { + this.jobs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobEvent type. + * @member {google.cloud.talent.v4beta1.JobEvent.JobEventType} type + * @memberof google.cloud.talent.v4beta1.JobEvent + * @instance + */ + JobEvent.prototype.type = 0; + + /** + * JobEvent jobs. + * @member {Array.} jobs + * @memberof google.cloud.talent.v4beta1.JobEvent + * @instance + */ + JobEvent.prototype.jobs = $util.emptyArray; + + /** + * JobEvent profile. + * @member {string} profile + * @memberof google.cloud.talent.v4beta1.JobEvent + * @instance + */ + JobEvent.prototype.profile = ""; + + /** + * Creates a new JobEvent instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.JobEvent + * @static + * @param {google.cloud.talent.v4beta1.IJobEvent=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.JobEvent} JobEvent instance + */ + JobEvent.create = function create(properties) { + return new JobEvent(properties); + }; + + /** + * Encodes the specified JobEvent message. Does not implicitly {@link google.cloud.talent.v4beta1.JobEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.JobEvent + * @static + * @param {google.cloud.talent.v4beta1.IJobEvent} message JobEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobs[i]); + if (message.profile != null && Object.hasOwnProperty.call(message, "profile")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.profile); + return writer; + }; + + /** + * Encodes the specified JobEvent message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.JobEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.JobEvent + * @static + * @param {google.cloud.talent.v4beta1.IJobEvent} message JobEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.JobEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.JobEvent} JobEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.JobEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push(reader.string()); + break; + } + case 3: { + message.profile = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.JobEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.JobEvent} JobEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobEvent message. + * @function verify + * @memberof google.cloud.talent.v4beta1.JobEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + 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: + break; + } + if (message.jobs != null && message.hasOwnProperty("jobs")) { + if (!Array.isArray(message.jobs)) + return "jobs: array expected"; + for (var i = 0; i < message.jobs.length; ++i) + if (!$util.isString(message.jobs[i])) + return "jobs: string[] expected"; + } + if (message.profile != null && message.hasOwnProperty("profile")) + if (!$util.isString(message.profile)) + return "profile: string expected"; + return null; + }; + + /** + * Creates a JobEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.JobEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.JobEvent} JobEvent + */ + JobEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.JobEvent) + return object; + var message = new $root.google.cloud.talent.v4beta1.JobEvent(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "JOB_EVENT_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "IMPRESSION": + case 1: + message.type = 1; + break; + case "VIEW": + case 2: + message.type = 2; + break; + case "VIEW_REDIRECT": + case 3: + message.type = 3; + break; + case "APPLICATION_START": + case 4: + message.type = 4; + break; + case "APPLICATION_FINISH": + case 5: + message.type = 5; + break; + case "APPLICATION_QUICK_SUBMISSION": + case 6: + message.type = 6; + break; + case "APPLICATION_REDIRECT": + case 7: + message.type = 7; + break; + case "APPLICATION_START_FROM_SEARCH": + case 8: + message.type = 8; + break; + case "APPLICATION_REDIRECT_FROM_SEARCH": + case 9: + message.type = 9; + break; + case "APPLICATION_COMPANY_SUBMIT": + case 10: + message.type = 10; + break; + case "BOOKMARK": + case 11: + message.type = 11; + break; + case "NOTIFICATION": + case 12: + message.type = 12; + break; + case "HIRED": + case 13: + message.type = 13; + break; + case "SENT_CV": + case 14: + message.type = 14; + break; + case "INTERVIEW_GRANTED": + case 15: + message.type = 15; + break; + } + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.talent.v4beta1.JobEvent.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) + message.jobs[i] = String(object.jobs[i]); + } + if (object.profile != null) + message.profile = String(object.profile); + return message; + }; + + /** + * Creates a plain object from a JobEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.JobEvent + * @static + * @param {google.cloud.talent.v4beta1.JobEvent} message JobEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jobs = []; + if (options.defaults) { + object.type = options.enums === String ? "JOB_EVENT_TYPE_UNSPECIFIED" : 0; + object.profile = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.talent.v4beta1.JobEvent.JobEventType[message.type] === undefined ? message.type : $root.google.cloud.talent.v4beta1.JobEvent.JobEventType[message.type] : message.type; + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = message.jobs[j]; + } + if (message.profile != null && message.hasOwnProperty("profile")) + object.profile = message.profile; + return object; + }; + + /** + * Converts this JobEvent to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.JobEvent + * @instance + * @returns {Object.} JSON object + */ + JobEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobEvent + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.JobEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.JobEvent"; + }; + + /** + * JobEventType enum. + * @name google.cloud.talent.v4beta1.JobEvent.JobEventType + * @enum {number} + * @property {number} JOB_EVENT_TYPE_UNSPECIFIED=0 JOB_EVENT_TYPE_UNSPECIFIED value + * @property {number} IMPRESSION=1 IMPRESSION value + * @property {number} VIEW=2 VIEW value + * @property {number} VIEW_REDIRECT=3 VIEW_REDIRECT value + * @property {number} APPLICATION_START=4 APPLICATION_START value + * @property {number} APPLICATION_FINISH=5 APPLICATION_FINISH value + * @property {number} APPLICATION_QUICK_SUBMISSION=6 APPLICATION_QUICK_SUBMISSION value + * @property {number} APPLICATION_REDIRECT=7 APPLICATION_REDIRECT value + * @property {number} APPLICATION_START_FROM_SEARCH=8 APPLICATION_START_FROM_SEARCH value + * @property {number} APPLICATION_REDIRECT_FROM_SEARCH=9 APPLICATION_REDIRECT_FROM_SEARCH value + * @property {number} APPLICATION_COMPANY_SUBMIT=10 APPLICATION_COMPANY_SUBMIT value + * @property {number} BOOKMARK=11 BOOKMARK value + * @property {number} NOTIFICATION=12 NOTIFICATION value + * @property {number} HIRED=13 HIRED value + * @property {number} SENT_CV=14 SENT_CV value + * @property {number} INTERVIEW_GRANTED=15 INTERVIEW_GRANTED value + */ + JobEvent.JobEventType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_EVENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IMPRESSION"] = 1; + values[valuesById[2] = "VIEW"] = 2; + values[valuesById[3] = "VIEW_REDIRECT"] = 3; + values[valuesById[4] = "APPLICATION_START"] = 4; + values[valuesById[5] = "APPLICATION_FINISH"] = 5; + values[valuesById[6] = "APPLICATION_QUICK_SUBMISSION"] = 6; + values[valuesById[7] = "APPLICATION_REDIRECT"] = 7; + values[valuesById[8] = "APPLICATION_START_FROM_SEARCH"] = 8; + values[valuesById[9] = "APPLICATION_REDIRECT_FROM_SEARCH"] = 9; + values[valuesById[10] = "APPLICATION_COMPANY_SUBMIT"] = 10; + values[valuesById[11] = "BOOKMARK"] = 11; + values[valuesById[12] = "NOTIFICATION"] = 12; + values[valuesById[13] = "HIRED"] = 13; + values[valuesById[14] = "SENT_CV"] = 14; + values[valuesById[15] = "INTERVIEW_GRANTED"] = 15; + return values; + })(); + + return JobEvent; + })(); + + v4beta1.EventService = (function() { + + /** + * Constructs a new EventService service. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents an EventService + * @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 EventService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (EventService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = EventService; + + /** + * Creates new EventService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.talent.v4beta1.EventService + * @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 {EventService} RPC service. Useful where requests and/or responses are streamed. + */ + EventService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.EventService|createClientEvent}. + * @memberof google.cloud.talent.v4beta1.EventService + * @typedef CreateClientEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4beta1.ClientEvent} [response] ClientEvent + */ + + /** + * Calls CreateClientEvent. + * @function createClientEvent + * @memberof google.cloud.talent.v4beta1.EventService + * @instance + * @param {google.cloud.talent.v4beta1.ICreateClientEventRequest} request CreateClientEventRequest message or plain object + * @param {google.cloud.talent.v4beta1.EventService.CreateClientEventCallback} callback Node-style callback called with the error, if any, and ClientEvent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EventService.prototype.createClientEvent = function createClientEvent(request, callback) { + return this.rpcCall(createClientEvent, $root.google.cloud.talent.v4beta1.CreateClientEventRequest, $root.google.cloud.talent.v4beta1.ClientEvent, request, callback); + }, "name", { value: "CreateClientEvent" }); + + /** + * Calls CreateClientEvent. + * @function createClientEvent + * @memberof google.cloud.talent.v4beta1.EventService + * @instance + * @param {google.cloud.talent.v4beta1.ICreateClientEventRequest} request CreateClientEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return EventService; + })(); + + v4beta1.CreateClientEventRequest = (function() { + + /** + * Properties of a CreateClientEventRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface ICreateClientEventRequest + * @property {string|null} [parent] CreateClientEventRequest parent + * @property {google.cloud.talent.v4beta1.IClientEvent|null} [clientEvent] CreateClientEventRequest clientEvent + */ + + /** + * Constructs a new CreateClientEventRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a CreateClientEventRequest. + * @implements ICreateClientEventRequest + * @constructor + * @param {google.cloud.talent.v4beta1.ICreateClientEventRequest=} [properties] Properties to set + */ + function CreateClientEventRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateClientEventRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4beta1.CreateClientEventRequest + * @instance + */ + CreateClientEventRequest.prototype.parent = ""; + + /** + * CreateClientEventRequest clientEvent. + * @member {google.cloud.talent.v4beta1.IClientEvent|null|undefined} clientEvent + * @memberof google.cloud.talent.v4beta1.CreateClientEventRequest + * @instance + */ + CreateClientEventRequest.prototype.clientEvent = null; + + /** + * Creates a new CreateClientEventRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.CreateClientEventRequest + * @static + * @param {google.cloud.talent.v4beta1.ICreateClientEventRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.CreateClientEventRequest} CreateClientEventRequest instance + */ + CreateClientEventRequest.create = function create(properties) { + return new CreateClientEventRequest(properties); + }; + + /** + * Encodes the specified CreateClientEventRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.CreateClientEventRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.CreateClientEventRequest + * @static + * @param {google.cloud.talent.v4beta1.ICreateClientEventRequest} message CreateClientEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClientEventRequest.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.clientEvent != null && Object.hasOwnProperty.call(message, "clientEvent")) + $root.google.cloud.talent.v4beta1.ClientEvent.encode(message.clientEvent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateClientEventRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CreateClientEventRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.CreateClientEventRequest + * @static + * @param {google.cloud.talent.v4beta1.ICreateClientEventRequest} message CreateClientEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClientEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateClientEventRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.CreateClientEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.CreateClientEventRequest} CreateClientEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClientEventRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.CreateClientEventRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clientEvent = $root.google.cloud.talent.v4beta1.ClientEvent.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateClientEventRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.CreateClientEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.CreateClientEventRequest} CreateClientEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClientEventRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateClientEventRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.CreateClientEventRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateClientEventRequest.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.clientEvent != null && message.hasOwnProperty("clientEvent")) { + var error = $root.google.cloud.talent.v4beta1.ClientEvent.verify(message.clientEvent); + if (error) + return "clientEvent." + error; + } + return null; + }; + + /** + * Creates a CreateClientEventRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.CreateClientEventRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.CreateClientEventRequest} CreateClientEventRequest + */ + CreateClientEventRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.CreateClientEventRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.CreateClientEventRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.clientEvent != null) { + if (typeof object.clientEvent !== "object") + throw TypeError(".google.cloud.talent.v4beta1.CreateClientEventRequest.clientEvent: object expected"); + message.clientEvent = $root.google.cloud.talent.v4beta1.ClientEvent.fromObject(object.clientEvent); + } + return message; + }; + + /** + * Creates a plain object from a CreateClientEventRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.CreateClientEventRequest + * @static + * @param {google.cloud.talent.v4beta1.CreateClientEventRequest} message CreateClientEventRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateClientEventRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clientEvent = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clientEvent != null && message.hasOwnProperty("clientEvent")) + object.clientEvent = $root.google.cloud.talent.v4beta1.ClientEvent.toObject(message.clientEvent, options); + return object; + }; + + /** + * Converts this CreateClientEventRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.CreateClientEventRequest + * @instance + * @returns {Object.} JSON object + */ + CreateClientEventRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateClientEventRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.CreateClientEventRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateClientEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.CreateClientEventRequest"; + }; + + return CreateClientEventRequest; + })(); + + v4beta1.JobQuery = (function() { + + /** + * Properties of a JobQuery. + * @memberof google.cloud.talent.v4beta1 + * @interface IJobQuery + * @property {string|null} [query] JobQuery query + * @property {string|null} [queryLanguageCode] JobQuery queryLanguageCode + * @property {Array.|null} [companies] JobQuery companies + * @property {Array.|null} [locationFilters] JobQuery locationFilters + * @property {Array.|null} [jobCategories] JobQuery jobCategories + * @property {google.cloud.talent.v4beta1.ICommuteFilter|null} [commuteFilter] JobQuery commuteFilter + * @property {Array.|null} [companyDisplayNames] JobQuery companyDisplayNames + * @property {google.cloud.talent.v4beta1.ICompensationFilter|null} [compensationFilter] JobQuery compensationFilter + * @property {string|null} [customAttributeFilter] JobQuery customAttributeFilter + * @property {boolean|null} [disableSpellCheck] JobQuery disableSpellCheck + * @property {Array.|null} [employmentTypes] JobQuery employmentTypes + * @property {Array.|null} [languageCodes] JobQuery languageCodes + * @property {google.cloud.talent.v4beta1.ITimestampRange|null} [publishTimeRange] JobQuery publishTimeRange + * @property {Array.|null} [excludedJobs] JobQuery excludedJobs + */ + + /** + * Constructs a new JobQuery. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a JobQuery. + * @implements IJobQuery + * @constructor + * @param {google.cloud.talent.v4beta1.IJobQuery=} [properties] Properties to set + */ + function JobQuery(properties) { + this.companies = []; + this.locationFilters = []; + this.jobCategories = []; + this.companyDisplayNames = []; + this.employmentTypes = []; + this.languageCodes = []; + this.excludedJobs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobQuery query. + * @member {string} query + * @memberof google.cloud.talent.v4beta1.JobQuery + * @instance + */ + JobQuery.prototype.query = ""; + + /** + * JobQuery queryLanguageCode. + * @member {string} queryLanguageCode + * @memberof google.cloud.talent.v4beta1.JobQuery + * @instance + */ + JobQuery.prototype.queryLanguageCode = ""; + + /** + * JobQuery companies. + * @member {Array.} companies + * @memberof google.cloud.talent.v4beta1.JobQuery + * @instance + */ + JobQuery.prototype.companies = $util.emptyArray; + + /** + * JobQuery locationFilters. + * @member {Array.} locationFilters + * @memberof google.cloud.talent.v4beta1.JobQuery + * @instance + */ + JobQuery.prototype.locationFilters = $util.emptyArray; + + /** + * JobQuery jobCategories. + * @member {Array.} jobCategories + * @memberof google.cloud.talent.v4beta1.JobQuery + * @instance + */ + JobQuery.prototype.jobCategories = $util.emptyArray; + + /** + * JobQuery commuteFilter. + * @member {google.cloud.talent.v4beta1.ICommuteFilter|null|undefined} commuteFilter + * @memberof google.cloud.talent.v4beta1.JobQuery + * @instance + */ + JobQuery.prototype.commuteFilter = null; + + /** + * JobQuery companyDisplayNames. + * @member {Array.} companyDisplayNames + * @memberof google.cloud.talent.v4beta1.JobQuery + * @instance + */ + JobQuery.prototype.companyDisplayNames = $util.emptyArray; + + /** + * JobQuery compensationFilter. + * @member {google.cloud.talent.v4beta1.ICompensationFilter|null|undefined} compensationFilter + * @memberof google.cloud.talent.v4beta1.JobQuery + * @instance + */ + JobQuery.prototype.compensationFilter = null; + + /** + * JobQuery customAttributeFilter. + * @member {string} customAttributeFilter + * @memberof google.cloud.talent.v4beta1.JobQuery + * @instance + */ + JobQuery.prototype.customAttributeFilter = ""; + + /** + * JobQuery disableSpellCheck. + * @member {boolean} disableSpellCheck + * @memberof google.cloud.talent.v4beta1.JobQuery + * @instance + */ + JobQuery.prototype.disableSpellCheck = false; + + /** + * JobQuery employmentTypes. + * @member {Array.} employmentTypes + * @memberof google.cloud.talent.v4beta1.JobQuery + * @instance + */ + JobQuery.prototype.employmentTypes = $util.emptyArray; + + /** + * JobQuery languageCodes. + * @member {Array.} languageCodes + * @memberof google.cloud.talent.v4beta1.JobQuery + * @instance + */ + JobQuery.prototype.languageCodes = $util.emptyArray; + + /** + * JobQuery publishTimeRange. + * @member {google.cloud.talent.v4beta1.ITimestampRange|null|undefined} publishTimeRange + * @memberof google.cloud.talent.v4beta1.JobQuery + * @instance + */ + JobQuery.prototype.publishTimeRange = null; + + /** + * JobQuery excludedJobs. + * @member {Array.} excludedJobs + * @memberof google.cloud.talent.v4beta1.JobQuery + * @instance + */ + JobQuery.prototype.excludedJobs = $util.emptyArray; + + /** + * Creates a new JobQuery instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.JobQuery + * @static + * @param {google.cloud.talent.v4beta1.IJobQuery=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.JobQuery} JobQuery instance + */ + JobQuery.create = function create(properties) { + return new JobQuery(properties); + }; + + /** + * Encodes the specified JobQuery message. Does not implicitly {@link google.cloud.talent.v4beta1.JobQuery.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.JobQuery + * @static + * @param {google.cloud.talent.v4beta1.IJobQuery} message JobQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); + if (message.companies != null && message.companies.length) + for (var i = 0; i < message.companies.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.companies[i]); + if (message.locationFilters != null && message.locationFilters.length) + for (var i = 0; i < message.locationFilters.length; ++i) + $root.google.cloud.talent.v4beta1.LocationFilter.encode(message.locationFilters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.jobCategories != null && message.jobCategories.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.jobCategories.length; ++i) + writer.int32(message.jobCategories[i]); + writer.ldelim(); + } + if (message.commuteFilter != null && Object.hasOwnProperty.call(message, "commuteFilter")) + $root.google.cloud.talent.v4beta1.CommuteFilter.encode(message.commuteFilter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.companyDisplayNames != null && message.companyDisplayNames.length) + for (var i = 0; i < message.companyDisplayNames.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.companyDisplayNames[i]); + if (message.compensationFilter != null && Object.hasOwnProperty.call(message, "compensationFilter")) + $root.google.cloud.talent.v4beta1.CompensationFilter.encode(message.compensationFilter, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.customAttributeFilter != null && Object.hasOwnProperty.call(message, "customAttributeFilter")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.customAttributeFilter); + if (message.disableSpellCheck != null && Object.hasOwnProperty.call(message, "disableSpellCheck")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.disableSpellCheck); + if (message.employmentTypes != null && message.employmentTypes.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.employmentTypes.length; ++i) + writer.int32(message.employmentTypes[i]); + writer.ldelim(); + } + if (message.languageCodes != null && message.languageCodes.length) + for (var i = 0; i < message.languageCodes.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.languageCodes[i]); + if (message.publishTimeRange != null && Object.hasOwnProperty.call(message, "publishTimeRange")) + $root.google.cloud.talent.v4beta1.TimestampRange.encode(message.publishTimeRange, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.excludedJobs != null && message.excludedJobs.length) + for (var i = 0; i < message.excludedJobs.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.excludedJobs[i]); + if (message.queryLanguageCode != null && Object.hasOwnProperty.call(message, "queryLanguageCode")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.queryLanguageCode); + return writer; + }; + + /** + * Encodes the specified JobQuery message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.JobQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.JobQuery + * @static + * @param {google.cloud.talent.v4beta1.IJobQuery} message JobQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobQuery message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.JobQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.JobQuery} JobQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobQuery.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.JobQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.query = reader.string(); + break; + } + case 14: { + message.queryLanguageCode = reader.string(); + break; + } + case 2: { + if (!(message.companies && message.companies.length)) + message.companies = []; + message.companies.push(reader.string()); + break; + } + case 3: { + if (!(message.locationFilters && message.locationFilters.length)) + message.locationFilters = []; + message.locationFilters.push($root.google.cloud.talent.v4beta1.LocationFilter.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.jobCategories && message.jobCategories.length)) + message.jobCategories = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.jobCategories.push(reader.int32()); + } else + message.jobCategories.push(reader.int32()); + break; + } + case 5: { + message.commuteFilter = $root.google.cloud.talent.v4beta1.CommuteFilter.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.companyDisplayNames && message.companyDisplayNames.length)) + message.companyDisplayNames = []; + message.companyDisplayNames.push(reader.string()); + break; + } + case 7: { + message.compensationFilter = $root.google.cloud.talent.v4beta1.CompensationFilter.decode(reader, reader.uint32()); + break; + } + case 8: { + message.customAttributeFilter = reader.string(); + break; + } + case 9: { + message.disableSpellCheck = reader.bool(); + break; + } + case 10: { + if (!(message.employmentTypes && message.employmentTypes.length)) + message.employmentTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.employmentTypes.push(reader.int32()); + } else + message.employmentTypes.push(reader.int32()); + break; + } + case 11: { + if (!(message.languageCodes && message.languageCodes.length)) + message.languageCodes = []; + message.languageCodes.push(reader.string()); + break; + } + case 12: { + message.publishTimeRange = $root.google.cloud.talent.v4beta1.TimestampRange.decode(reader, reader.uint32()); + break; + } + case 13: { + if (!(message.excludedJobs && message.excludedJobs.length)) + message.excludedJobs = []; + message.excludedJobs.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.JobQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.JobQuery} JobQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobQuery message. + * @function verify + * @memberof google.cloud.talent.v4beta1.JobQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobQuery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.queryLanguageCode != null && message.hasOwnProperty("queryLanguageCode")) + if (!$util.isString(message.queryLanguageCode)) + return "queryLanguageCode: string expected"; + if (message.companies != null && message.hasOwnProperty("companies")) { + if (!Array.isArray(message.companies)) + return "companies: array expected"; + for (var i = 0; i < message.companies.length; ++i) + if (!$util.isString(message.companies[i])) + return "companies: string[] expected"; + } + if (message.locationFilters != null && message.hasOwnProperty("locationFilters")) { + if (!Array.isArray(message.locationFilters)) + return "locationFilters: array expected"; + for (var i = 0; i < message.locationFilters.length; ++i) { + var error = $root.google.cloud.talent.v4beta1.LocationFilter.verify(message.locationFilters[i]); + if (error) + return "locationFilters." + error; + } + } + if (message.jobCategories != null && message.hasOwnProperty("jobCategories")) { + if (!Array.isArray(message.jobCategories)) + return "jobCategories: array expected"; + for (var i = 0; i < message.jobCategories.length; ++i) + switch (message.jobCategories[i]) { + default: + return "jobCategories: enum value[] expected"; + case 0: + 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: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + break; + } + } + if (message.commuteFilter != null && message.hasOwnProperty("commuteFilter")) { + var error = $root.google.cloud.talent.v4beta1.CommuteFilter.verify(message.commuteFilter); + if (error) + return "commuteFilter." + error; + } + if (message.companyDisplayNames != null && message.hasOwnProperty("companyDisplayNames")) { + if (!Array.isArray(message.companyDisplayNames)) + return "companyDisplayNames: array expected"; + for (var i = 0; i < message.companyDisplayNames.length; ++i) + if (!$util.isString(message.companyDisplayNames[i])) + return "companyDisplayNames: string[] expected"; + } + if (message.compensationFilter != null && message.hasOwnProperty("compensationFilter")) { + var error = $root.google.cloud.talent.v4beta1.CompensationFilter.verify(message.compensationFilter); + if (error) + return "compensationFilter." + error; + } + if (message.customAttributeFilter != null && message.hasOwnProperty("customAttributeFilter")) + if (!$util.isString(message.customAttributeFilter)) + return "customAttributeFilter: string expected"; + if (message.disableSpellCheck != null && message.hasOwnProperty("disableSpellCheck")) + if (typeof message.disableSpellCheck !== "boolean") + return "disableSpellCheck: boolean expected"; + if (message.employmentTypes != null && message.hasOwnProperty("employmentTypes")) { + if (!Array.isArray(message.employmentTypes)) + return "employmentTypes: array expected"; + for (var i = 0; i < message.employmentTypes.length; ++i) + switch (message.employmentTypes[i]) { + default: + return "employmentTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + } + } + if (message.languageCodes != null && message.hasOwnProperty("languageCodes")) { + if (!Array.isArray(message.languageCodes)) + return "languageCodes: array expected"; + for (var i = 0; i < message.languageCodes.length; ++i) + if (!$util.isString(message.languageCodes[i])) + return "languageCodes: string[] expected"; + } + if (message.publishTimeRange != null && message.hasOwnProperty("publishTimeRange")) { + var error = $root.google.cloud.talent.v4beta1.TimestampRange.verify(message.publishTimeRange); + if (error) + return "publishTimeRange." + error; + } + if (message.excludedJobs != null && message.hasOwnProperty("excludedJobs")) { + if (!Array.isArray(message.excludedJobs)) + return "excludedJobs: array expected"; + for (var i = 0; i < message.excludedJobs.length; ++i) + if (!$util.isString(message.excludedJobs[i])) + return "excludedJobs: string[] expected"; + } + return null; + }; + + /** + * Creates a JobQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.JobQuery + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.JobQuery} JobQuery + */ + JobQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.JobQuery) + return object; + var message = new $root.google.cloud.talent.v4beta1.JobQuery(); + if (object.query != null) + message.query = String(object.query); + if (object.queryLanguageCode != null) + message.queryLanguageCode = String(object.queryLanguageCode); + if (object.companies) { + if (!Array.isArray(object.companies)) + throw TypeError(".google.cloud.talent.v4beta1.JobQuery.companies: array expected"); + message.companies = []; + for (var i = 0; i < object.companies.length; ++i) + message.companies[i] = String(object.companies[i]); + } + if (object.locationFilters) { + if (!Array.isArray(object.locationFilters)) + throw TypeError(".google.cloud.talent.v4beta1.JobQuery.locationFilters: array expected"); + message.locationFilters = []; + for (var i = 0; i < object.locationFilters.length; ++i) { + if (typeof object.locationFilters[i] !== "object") + throw TypeError(".google.cloud.talent.v4beta1.JobQuery.locationFilters: object expected"); + message.locationFilters[i] = $root.google.cloud.talent.v4beta1.LocationFilter.fromObject(object.locationFilters[i]); + } + } + if (object.jobCategories) { + if (!Array.isArray(object.jobCategories)) + throw TypeError(".google.cloud.talent.v4beta1.JobQuery.jobCategories: array expected"); + message.jobCategories = []; + for (var i = 0; i < object.jobCategories.length; ++i) + switch (object.jobCategories[i]) { + default: + if (typeof object.jobCategories[i] === "number") { + message.jobCategories[i] = object.jobCategories[i]; + break; + } + case "JOB_CATEGORY_UNSPECIFIED": + case 0: + message.jobCategories[i] = 0; + break; + case "ACCOUNTING_AND_FINANCE": + case 1: + message.jobCategories[i] = 1; + break; + case "ADMINISTRATIVE_AND_OFFICE": + case 2: + message.jobCategories[i] = 2; + break; + case "ADVERTISING_AND_MARKETING": + case 3: + message.jobCategories[i] = 3; + break; + case "ANIMAL_CARE": + case 4: + message.jobCategories[i] = 4; + break; + case "ART_FASHION_AND_DESIGN": + case 5: + message.jobCategories[i] = 5; + break; + case "BUSINESS_OPERATIONS": + case 6: + message.jobCategories[i] = 6; + break; + case "CLEANING_AND_FACILITIES": + case 7: + message.jobCategories[i] = 7; + break; + case "COMPUTER_AND_IT": + case 8: + message.jobCategories[i] = 8; + break; + case "CONSTRUCTION": + case 9: + message.jobCategories[i] = 9; + break; + case "CUSTOMER_SERVICE": + case 10: + message.jobCategories[i] = 10; + break; + case "EDUCATION": + case 11: + message.jobCategories[i] = 11; + break; + case "ENTERTAINMENT_AND_TRAVEL": + case 12: + message.jobCategories[i] = 12; + break; + case "FARMING_AND_OUTDOORS": + case 13: + message.jobCategories[i] = 13; + break; + case "HEALTHCARE": + case 14: + message.jobCategories[i] = 14; + break; + case "HUMAN_RESOURCES": + case 15: + message.jobCategories[i] = 15; + break; + case "INSTALLATION_MAINTENANCE_AND_REPAIR": + case 16: + message.jobCategories[i] = 16; + break; + case "LEGAL": + case 17: + message.jobCategories[i] = 17; + break; + case "MANAGEMENT": + case 18: + message.jobCategories[i] = 18; + break; + case "MANUFACTURING_AND_WAREHOUSE": + case 19: + message.jobCategories[i] = 19; + break; + case "MEDIA_COMMUNICATIONS_AND_WRITING": + case 20: + message.jobCategories[i] = 20; + break; + case "OIL_GAS_AND_MINING": + case 21: + message.jobCategories[i] = 21; + break; + case "PERSONAL_CARE_AND_SERVICES": + case 22: + message.jobCategories[i] = 22; + break; + case "PROTECTIVE_SERVICES": + case 23: + message.jobCategories[i] = 23; + break; + case "REAL_ESTATE": + case 24: + message.jobCategories[i] = 24; + break; + case "RESTAURANT_AND_HOSPITALITY": + case 25: + message.jobCategories[i] = 25; + break; + case "SALES_AND_RETAIL": + case 26: + message.jobCategories[i] = 26; + break; + case "SCIENCE_AND_ENGINEERING": + case 27: + message.jobCategories[i] = 27; + break; + case "SOCIAL_SERVICES_AND_NON_PROFIT": + case 28: + message.jobCategories[i] = 28; + break; + case "SPORTS_FITNESS_AND_RECREATION": + case 29: + message.jobCategories[i] = 29; + break; + case "TRANSPORTATION_AND_LOGISTICS": + case 30: + message.jobCategories[i] = 30; + break; + } + } + if (object.commuteFilter != null) { + if (typeof object.commuteFilter !== "object") + throw TypeError(".google.cloud.talent.v4beta1.JobQuery.commuteFilter: object expected"); + message.commuteFilter = $root.google.cloud.talent.v4beta1.CommuteFilter.fromObject(object.commuteFilter); + } + if (object.companyDisplayNames) { + if (!Array.isArray(object.companyDisplayNames)) + throw TypeError(".google.cloud.talent.v4beta1.JobQuery.companyDisplayNames: array expected"); + message.companyDisplayNames = []; + for (var i = 0; i < object.companyDisplayNames.length; ++i) + message.companyDisplayNames[i] = String(object.companyDisplayNames[i]); + } + if (object.compensationFilter != null) { + if (typeof object.compensationFilter !== "object") + throw TypeError(".google.cloud.talent.v4beta1.JobQuery.compensationFilter: object expected"); + message.compensationFilter = $root.google.cloud.talent.v4beta1.CompensationFilter.fromObject(object.compensationFilter); + } + if (object.customAttributeFilter != null) + message.customAttributeFilter = String(object.customAttributeFilter); + if (object.disableSpellCheck != null) + message.disableSpellCheck = Boolean(object.disableSpellCheck); + if (object.employmentTypes) { + if (!Array.isArray(object.employmentTypes)) + throw TypeError(".google.cloud.talent.v4beta1.JobQuery.employmentTypes: array expected"); + message.employmentTypes = []; + for (var i = 0; i < object.employmentTypes.length; ++i) + switch (object.employmentTypes[i]) { + default: + if (typeof object.employmentTypes[i] === "number") { + message.employmentTypes[i] = object.employmentTypes[i]; + break; + } + case "EMPLOYMENT_TYPE_UNSPECIFIED": + case 0: + message.employmentTypes[i] = 0; + break; + case "FULL_TIME": + case 1: + message.employmentTypes[i] = 1; + break; + case "PART_TIME": + case 2: + message.employmentTypes[i] = 2; + break; + case "CONTRACTOR": + case 3: + message.employmentTypes[i] = 3; + break; + case "CONTRACT_TO_HIRE": + case 4: + message.employmentTypes[i] = 4; + break; + case "TEMPORARY": + case 5: + message.employmentTypes[i] = 5; + break; + case "INTERN": + case 6: + message.employmentTypes[i] = 6; + break; + case "VOLUNTEER": + case 7: + message.employmentTypes[i] = 7; + break; + case "PER_DIEM": + case 8: + message.employmentTypes[i] = 8; + break; + case "FLY_IN_FLY_OUT": + case 9: + message.employmentTypes[i] = 9; + break; + case "OTHER_EMPLOYMENT_TYPE": + case 10: + message.employmentTypes[i] = 10; + break; + } + } + if (object.languageCodes) { + if (!Array.isArray(object.languageCodes)) + throw TypeError(".google.cloud.talent.v4beta1.JobQuery.languageCodes: array expected"); + message.languageCodes = []; + for (var i = 0; i < object.languageCodes.length; ++i) + message.languageCodes[i] = String(object.languageCodes[i]); + } + if (object.publishTimeRange != null) { + if (typeof object.publishTimeRange !== "object") + throw TypeError(".google.cloud.talent.v4beta1.JobQuery.publishTimeRange: object expected"); + message.publishTimeRange = $root.google.cloud.talent.v4beta1.TimestampRange.fromObject(object.publishTimeRange); + } + if (object.excludedJobs) { + if (!Array.isArray(object.excludedJobs)) + throw TypeError(".google.cloud.talent.v4beta1.JobQuery.excludedJobs: array expected"); + message.excludedJobs = []; + for (var i = 0; i < object.excludedJobs.length; ++i) + message.excludedJobs[i] = String(object.excludedJobs[i]); + } + return message; + }; + + /** + * Creates a plain object from a JobQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.JobQuery + * @static + * @param {google.cloud.talent.v4beta1.JobQuery} message JobQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.companies = []; + object.locationFilters = []; + object.jobCategories = []; + object.companyDisplayNames = []; + object.employmentTypes = []; + object.languageCodes = []; + object.excludedJobs = []; + } + if (options.defaults) { + object.query = ""; + object.commuteFilter = null; + object.compensationFilter = null; + object.customAttributeFilter = ""; + object.disableSpellCheck = false; + object.publishTimeRange = null; + object.queryLanguageCode = ""; + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.companies && message.companies.length) { + object.companies = []; + for (var j = 0; j < message.companies.length; ++j) + object.companies[j] = message.companies[j]; + } + if (message.locationFilters && message.locationFilters.length) { + object.locationFilters = []; + for (var j = 0; j < message.locationFilters.length; ++j) + object.locationFilters[j] = $root.google.cloud.talent.v4beta1.LocationFilter.toObject(message.locationFilters[j], options); + } + if (message.jobCategories && message.jobCategories.length) { + object.jobCategories = []; + for (var j = 0; j < message.jobCategories.length; ++j) + object.jobCategories[j] = options.enums === String ? $root.google.cloud.talent.v4beta1.JobCategory[message.jobCategories[j]] === undefined ? message.jobCategories[j] : $root.google.cloud.talent.v4beta1.JobCategory[message.jobCategories[j]] : message.jobCategories[j]; + } + if (message.commuteFilter != null && message.hasOwnProperty("commuteFilter")) + object.commuteFilter = $root.google.cloud.talent.v4beta1.CommuteFilter.toObject(message.commuteFilter, options); + if (message.companyDisplayNames && message.companyDisplayNames.length) { + object.companyDisplayNames = []; + for (var j = 0; j < message.companyDisplayNames.length; ++j) + object.companyDisplayNames[j] = message.companyDisplayNames[j]; + } + if (message.compensationFilter != null && message.hasOwnProperty("compensationFilter")) + object.compensationFilter = $root.google.cloud.talent.v4beta1.CompensationFilter.toObject(message.compensationFilter, options); + if (message.customAttributeFilter != null && message.hasOwnProperty("customAttributeFilter")) + object.customAttributeFilter = message.customAttributeFilter; + if (message.disableSpellCheck != null && message.hasOwnProperty("disableSpellCheck")) + object.disableSpellCheck = message.disableSpellCheck; + if (message.employmentTypes && message.employmentTypes.length) { + object.employmentTypes = []; + for (var j = 0; j < message.employmentTypes.length; ++j) + object.employmentTypes[j] = options.enums === String ? $root.google.cloud.talent.v4beta1.EmploymentType[message.employmentTypes[j]] === undefined ? message.employmentTypes[j] : $root.google.cloud.talent.v4beta1.EmploymentType[message.employmentTypes[j]] : message.employmentTypes[j]; + } + if (message.languageCodes && message.languageCodes.length) { + object.languageCodes = []; + for (var j = 0; j < message.languageCodes.length; ++j) + object.languageCodes[j] = message.languageCodes[j]; + } + if (message.publishTimeRange != null && message.hasOwnProperty("publishTimeRange")) + object.publishTimeRange = $root.google.cloud.talent.v4beta1.TimestampRange.toObject(message.publishTimeRange, options); + if (message.excludedJobs && message.excludedJobs.length) { + object.excludedJobs = []; + for (var j = 0; j < message.excludedJobs.length; ++j) + object.excludedJobs[j] = message.excludedJobs[j]; + } + if (message.queryLanguageCode != null && message.hasOwnProperty("queryLanguageCode")) + object.queryLanguageCode = message.queryLanguageCode; + return object; + }; + + /** + * Converts this JobQuery to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.JobQuery + * @instance + * @returns {Object.} JSON object + */ + JobQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobQuery + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.JobQuery + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.JobQuery"; + }; + + return JobQuery; + })(); + + v4beta1.LocationFilter = (function() { + + /** + * Properties of a LocationFilter. + * @memberof google.cloud.talent.v4beta1 + * @interface ILocationFilter + * @property {string|null} [address] LocationFilter address + * @property {string|null} [regionCode] LocationFilter regionCode + * @property {google.type.ILatLng|null} [latLng] LocationFilter latLng + * @property {number|null} [distanceInMiles] LocationFilter distanceInMiles + * @property {google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference|null} [telecommutePreference] LocationFilter telecommutePreference + * @property {boolean|null} [negated] LocationFilter negated + */ + + /** + * Constructs a new LocationFilter. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a LocationFilter. + * @implements ILocationFilter + * @constructor + * @param {google.cloud.talent.v4beta1.ILocationFilter=} [properties] Properties to set + */ + function LocationFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationFilter address. + * @member {string} address + * @memberof google.cloud.talent.v4beta1.LocationFilter + * @instance + */ + LocationFilter.prototype.address = ""; + + /** + * LocationFilter regionCode. + * @member {string} regionCode + * @memberof google.cloud.talent.v4beta1.LocationFilter + * @instance + */ + LocationFilter.prototype.regionCode = ""; + + /** + * LocationFilter latLng. + * @member {google.type.ILatLng|null|undefined} latLng + * @memberof google.cloud.talent.v4beta1.LocationFilter + * @instance + */ + LocationFilter.prototype.latLng = null; + + /** + * LocationFilter distanceInMiles. + * @member {number} distanceInMiles + * @memberof google.cloud.talent.v4beta1.LocationFilter + * @instance + */ + LocationFilter.prototype.distanceInMiles = 0; + + /** + * LocationFilter telecommutePreference. + * @member {google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference} telecommutePreference + * @memberof google.cloud.talent.v4beta1.LocationFilter + * @instance + */ + LocationFilter.prototype.telecommutePreference = 0; + + /** + * LocationFilter negated. + * @member {boolean} negated + * @memberof google.cloud.talent.v4beta1.LocationFilter + * @instance + */ + LocationFilter.prototype.negated = false; + + /** + * Creates a new LocationFilter instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.LocationFilter + * @static + * @param {google.cloud.talent.v4beta1.ILocationFilter=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.LocationFilter} LocationFilter instance + */ + LocationFilter.create = function create(properties) { + return new LocationFilter(properties); + }; + + /** + * Encodes the specified LocationFilter message. Does not implicitly {@link google.cloud.talent.v4beta1.LocationFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.LocationFilter + * @static + * @param {google.cloud.talent.v4beta1.ILocationFilter} message LocationFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.regionCode); + if (message.latLng != null && Object.hasOwnProperty.call(message, "latLng")) + $root.google.type.LatLng.encode(message.latLng, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.distanceInMiles != null && Object.hasOwnProperty.call(message, "distanceInMiles")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.distanceInMiles); + if (message.telecommutePreference != null && Object.hasOwnProperty.call(message, "telecommutePreference")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.telecommutePreference); + if (message.negated != null && Object.hasOwnProperty.call(message, "negated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.negated); + return writer; + }; + + /** + * Encodes the specified LocationFilter message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.LocationFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.LocationFilter + * @static + * @param {google.cloud.talent.v4beta1.ILocationFilter} message LocationFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.LocationFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.LocationFilter} LocationFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.LocationFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.address = reader.string(); + break; + } + case 2: { + message.regionCode = reader.string(); + break; + } + case 3: { + message.latLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + case 4: { + message.distanceInMiles = reader.double(); + break; + } + case 5: { + message.telecommutePreference = reader.int32(); + break; + } + case 6: { + message.negated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.LocationFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.LocationFilter} LocationFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationFilter message. + * @function verify + * @memberof google.cloud.talent.v4beta1.LocationFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.latLng != null && message.hasOwnProperty("latLng")) { + var error = $root.google.type.LatLng.verify(message.latLng); + if (error) + return "latLng." + error; + } + if (message.distanceInMiles != null && message.hasOwnProperty("distanceInMiles")) + if (typeof message.distanceInMiles !== "number") + return "distanceInMiles: number expected"; + if (message.telecommutePreference != null && message.hasOwnProperty("telecommutePreference")) + switch (message.telecommutePreference) { + default: + return "telecommutePreference: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.negated != null && message.hasOwnProperty("negated")) + if (typeof message.negated !== "boolean") + return "negated: boolean expected"; + return null; + }; + + /** + * Creates a LocationFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.LocationFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.LocationFilter} LocationFilter + */ + LocationFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.LocationFilter) + return object; + var message = new $root.google.cloud.talent.v4beta1.LocationFilter(); + if (object.address != null) + message.address = String(object.address); + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + if (object.latLng != null) { + if (typeof object.latLng !== "object") + throw TypeError(".google.cloud.talent.v4beta1.LocationFilter.latLng: object expected"); + message.latLng = $root.google.type.LatLng.fromObject(object.latLng); + } + if (object.distanceInMiles != null) + message.distanceInMiles = Number(object.distanceInMiles); + switch (object.telecommutePreference) { + default: + if (typeof object.telecommutePreference === "number") { + message.telecommutePreference = object.telecommutePreference; + break; + } + break; + case "TELECOMMUTE_PREFERENCE_UNSPECIFIED": + case 0: + message.telecommutePreference = 0; + break; + case "TELECOMMUTE_EXCLUDED": + case 1: + message.telecommutePreference = 1; + break; + case "TELECOMMUTE_ALLOWED": + case 2: + message.telecommutePreference = 2; + break; + case "TELECOMMUTE_JOBS_EXCLUDED": + case 3: + message.telecommutePreference = 3; + break; + } + if (object.negated != null) + message.negated = Boolean(object.negated); + return message; + }; + + /** + * Creates a plain object from a LocationFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.LocationFilter + * @static + * @param {google.cloud.talent.v4beta1.LocationFilter} message LocationFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.address = ""; + object.regionCode = ""; + object.latLng = null; + object.distanceInMiles = 0; + object.telecommutePreference = options.enums === String ? "TELECOMMUTE_PREFERENCE_UNSPECIFIED" : 0; + object.negated = false; + } + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.latLng != null && message.hasOwnProperty("latLng")) + object.latLng = $root.google.type.LatLng.toObject(message.latLng, options); + if (message.distanceInMiles != null && message.hasOwnProperty("distanceInMiles")) + object.distanceInMiles = options.json && !isFinite(message.distanceInMiles) ? String(message.distanceInMiles) : message.distanceInMiles; + if (message.telecommutePreference != null && message.hasOwnProperty("telecommutePreference")) + object.telecommutePreference = options.enums === String ? $root.google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference[message.telecommutePreference] === undefined ? message.telecommutePreference : $root.google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference[message.telecommutePreference] : message.telecommutePreference; + if (message.negated != null && message.hasOwnProperty("negated")) + object.negated = message.negated; + return object; + }; + + /** + * Converts this LocationFilter to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.LocationFilter + * @instance + * @returns {Object.} JSON object + */ + LocationFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationFilter + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.LocationFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.LocationFilter"; + }; + + /** + * TelecommutePreference enum. + * @name google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference + * @enum {number} + * @property {number} TELECOMMUTE_PREFERENCE_UNSPECIFIED=0 TELECOMMUTE_PREFERENCE_UNSPECIFIED value + * @property {number} TELECOMMUTE_EXCLUDED=1 TELECOMMUTE_EXCLUDED value + * @property {number} TELECOMMUTE_ALLOWED=2 TELECOMMUTE_ALLOWED value + * @property {number} TELECOMMUTE_JOBS_EXCLUDED=3 TELECOMMUTE_JOBS_EXCLUDED value + */ + LocationFilter.TelecommutePreference = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TELECOMMUTE_PREFERENCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TELECOMMUTE_EXCLUDED"] = 1; + values[valuesById[2] = "TELECOMMUTE_ALLOWED"] = 2; + values[valuesById[3] = "TELECOMMUTE_JOBS_EXCLUDED"] = 3; + return values; + })(); + + return LocationFilter; + })(); + + v4beta1.CompensationFilter = (function() { + + /** + * Properties of a CompensationFilter. + * @memberof google.cloud.talent.v4beta1 + * @interface ICompensationFilter + * @property {google.cloud.talent.v4beta1.CompensationFilter.FilterType|null} [type] CompensationFilter type + * @property {Array.|null} [units] CompensationFilter units + * @property {google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange|null} [range] CompensationFilter range + * @property {boolean|null} [includeJobsWithUnspecifiedCompensationRange] CompensationFilter includeJobsWithUnspecifiedCompensationRange + */ + + /** + * Constructs a new CompensationFilter. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a CompensationFilter. + * @implements ICompensationFilter + * @constructor + * @param {google.cloud.talent.v4beta1.ICompensationFilter=} [properties] Properties to set + */ + function CompensationFilter(properties) { + this.units = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompensationFilter type. + * @member {google.cloud.talent.v4beta1.CompensationFilter.FilterType} type + * @memberof google.cloud.talent.v4beta1.CompensationFilter + * @instance + */ + CompensationFilter.prototype.type = 0; + + /** + * CompensationFilter units. + * @member {Array.} units + * @memberof google.cloud.talent.v4beta1.CompensationFilter + * @instance + */ + CompensationFilter.prototype.units = $util.emptyArray; + + /** + * CompensationFilter range. + * @member {google.cloud.talent.v4beta1.CompensationInfo.ICompensationRange|null|undefined} range + * @memberof google.cloud.talent.v4beta1.CompensationFilter + * @instance + */ + CompensationFilter.prototype.range = null; + + /** + * CompensationFilter includeJobsWithUnspecifiedCompensationRange. + * @member {boolean} includeJobsWithUnspecifiedCompensationRange + * @memberof google.cloud.talent.v4beta1.CompensationFilter + * @instance + */ + CompensationFilter.prototype.includeJobsWithUnspecifiedCompensationRange = false; + + /** + * Creates a new CompensationFilter instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.CompensationFilter + * @static + * @param {google.cloud.talent.v4beta1.ICompensationFilter=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.CompensationFilter} CompensationFilter instance + */ + CompensationFilter.create = function create(properties) { + return new CompensationFilter(properties); + }; + + /** + * Encodes the specified CompensationFilter message. Does not implicitly {@link google.cloud.talent.v4beta1.CompensationFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.CompensationFilter + * @static + * @param {google.cloud.talent.v4beta1.ICompensationFilter} message CompensationFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompensationFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.units != null && message.units.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.units.length; ++i) + writer.int32(message.units[i]); + writer.ldelim(); + } + if (message.range != null && Object.hasOwnProperty.call(message, "range")) + $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.encode(message.range, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.includeJobsWithUnspecifiedCompensationRange != null && Object.hasOwnProperty.call(message, "includeJobsWithUnspecifiedCompensationRange")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.includeJobsWithUnspecifiedCompensationRange); + return writer; + }; + + /** + * Encodes the specified CompensationFilter message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CompensationFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.CompensationFilter + * @static + * @param {google.cloud.talent.v4beta1.ICompensationFilter} message CompensationFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompensationFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompensationFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.CompensationFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.CompensationFilter} CompensationFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompensationFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.CompensationFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + if (!(message.units && message.units.length)) + message.units = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.units.push(reader.int32()); + } else + message.units.push(reader.int32()); + break; + } + case 3: { + message.range = $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.decode(reader, reader.uint32()); + break; + } + case 4: { + message.includeJobsWithUnspecifiedCompensationRange = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompensationFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.CompensationFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.CompensationFilter} CompensationFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompensationFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompensationFilter message. + * @function verify + * @memberof google.cloud.talent.v4beta1.CompensationFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompensationFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.units != null && message.hasOwnProperty("units")) { + if (!Array.isArray(message.units)) + return "units: array expected"; + for (var i = 0; i < message.units.length; ++i) + switch (message.units[i]) { + default: + return "units: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message.range != null && message.hasOwnProperty("range")) { + var error = $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.verify(message.range); + if (error) + return "range." + error; + } + if (message.includeJobsWithUnspecifiedCompensationRange != null && message.hasOwnProperty("includeJobsWithUnspecifiedCompensationRange")) + if (typeof message.includeJobsWithUnspecifiedCompensationRange !== "boolean") + return "includeJobsWithUnspecifiedCompensationRange: boolean expected"; + return null; + }; + + /** + * Creates a CompensationFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.CompensationFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.CompensationFilter} CompensationFilter + */ + CompensationFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.CompensationFilter) + return object; + var message = new $root.google.cloud.talent.v4beta1.CompensationFilter(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "FILTER_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "UNIT_ONLY": + case 1: + message.type = 1; + break; + case "UNIT_AND_AMOUNT": + case 2: + message.type = 2; + break; + case "ANNUALIZED_BASE_AMOUNT": + case 3: + message.type = 3; + break; + case "ANNUALIZED_TOTAL_AMOUNT": + case 4: + message.type = 4; + break; + } + if (object.units) { + if (!Array.isArray(object.units)) + throw TypeError(".google.cloud.talent.v4beta1.CompensationFilter.units: array expected"); + message.units = []; + for (var i = 0; i < object.units.length; ++i) + switch (object.units[i]) { + default: + if (typeof object.units[i] === "number") { + message.units[i] = object.units[i]; + break; + } + case "COMPENSATION_UNIT_UNSPECIFIED": + case 0: + message.units[i] = 0; + break; + case "HOURLY": + case 1: + message.units[i] = 1; + break; + case "DAILY": + case 2: + message.units[i] = 2; + break; + case "WEEKLY": + case 3: + message.units[i] = 3; + break; + case "MONTHLY": + case 4: + message.units[i] = 4; + break; + case "YEARLY": + case 5: + message.units[i] = 5; + break; + case "ONE_TIME": + case 6: + message.units[i] = 6; + break; + case "OTHER_COMPENSATION_UNIT": + case 7: + message.units[i] = 7; + break; + } + } + if (object.range != null) { + if (typeof object.range !== "object") + throw TypeError(".google.cloud.talent.v4beta1.CompensationFilter.range: object expected"); + message.range = $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.fromObject(object.range); + } + if (object.includeJobsWithUnspecifiedCompensationRange != null) + message.includeJobsWithUnspecifiedCompensationRange = Boolean(object.includeJobsWithUnspecifiedCompensationRange); + return message; + }; + + /** + * Creates a plain object from a CompensationFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.CompensationFilter + * @static + * @param {google.cloud.talent.v4beta1.CompensationFilter} message CompensationFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompensationFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.units = []; + if (options.defaults) { + object.type = options.enums === String ? "FILTER_TYPE_UNSPECIFIED" : 0; + object.range = null; + object.includeJobsWithUnspecifiedCompensationRange = false; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.talent.v4beta1.CompensationFilter.FilterType[message.type] === undefined ? message.type : $root.google.cloud.talent.v4beta1.CompensationFilter.FilterType[message.type] : message.type; + if (message.units && message.units.length) { + object.units = []; + for (var j = 0; j < message.units.length; ++j) + object.units[j] = options.enums === String ? $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit[message.units[j]] === undefined ? message.units[j] : $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit[message.units[j]] : message.units[j]; + } + if (message.range != null && message.hasOwnProperty("range")) + object.range = $root.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.toObject(message.range, options); + if (message.includeJobsWithUnspecifiedCompensationRange != null && message.hasOwnProperty("includeJobsWithUnspecifiedCompensationRange")) + object.includeJobsWithUnspecifiedCompensationRange = message.includeJobsWithUnspecifiedCompensationRange; + return object; + }; + + /** + * Converts this CompensationFilter to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.CompensationFilter + * @instance + * @returns {Object.} JSON object + */ + CompensationFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompensationFilter + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.CompensationFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompensationFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.CompensationFilter"; + }; + + /** + * FilterType enum. + * @name google.cloud.talent.v4beta1.CompensationFilter.FilterType + * @enum {number} + * @property {number} FILTER_TYPE_UNSPECIFIED=0 FILTER_TYPE_UNSPECIFIED value + * @property {number} UNIT_ONLY=1 UNIT_ONLY value + * @property {number} UNIT_AND_AMOUNT=2 UNIT_AND_AMOUNT value + * @property {number} ANNUALIZED_BASE_AMOUNT=3 ANNUALIZED_BASE_AMOUNT value + * @property {number} ANNUALIZED_TOTAL_AMOUNT=4 ANNUALIZED_TOTAL_AMOUNT value + */ + CompensationFilter.FilterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FILTER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNIT_ONLY"] = 1; + values[valuesById[2] = "UNIT_AND_AMOUNT"] = 2; + values[valuesById[3] = "ANNUALIZED_BASE_AMOUNT"] = 3; + values[valuesById[4] = "ANNUALIZED_TOTAL_AMOUNT"] = 4; + return values; + })(); + + return CompensationFilter; + })(); + + v4beta1.CommuteFilter = (function() { + + /** + * Properties of a CommuteFilter. + * @memberof google.cloud.talent.v4beta1 + * @interface ICommuteFilter + * @property {google.cloud.talent.v4beta1.CommuteMethod|null} [commuteMethod] CommuteFilter commuteMethod + * @property {google.type.ILatLng|null} [startCoordinates] CommuteFilter startCoordinates + * @property {google.protobuf.IDuration|null} [travelDuration] CommuteFilter travelDuration + * @property {boolean|null} [allowImpreciseAddresses] CommuteFilter allowImpreciseAddresses + * @property {google.cloud.talent.v4beta1.CommuteFilter.RoadTraffic|null} [roadTraffic] CommuteFilter roadTraffic + * @property {google.type.ITimeOfDay|null} [departureTime] CommuteFilter departureTime + */ + + /** + * Constructs a new CommuteFilter. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a CommuteFilter. + * @implements ICommuteFilter + * @constructor + * @param {google.cloud.talent.v4beta1.ICommuteFilter=} [properties] Properties to set + */ + function CommuteFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommuteFilter commuteMethod. + * @member {google.cloud.talent.v4beta1.CommuteMethod} commuteMethod + * @memberof google.cloud.talent.v4beta1.CommuteFilter + * @instance + */ + CommuteFilter.prototype.commuteMethod = 0; + + /** + * CommuteFilter startCoordinates. + * @member {google.type.ILatLng|null|undefined} startCoordinates + * @memberof google.cloud.talent.v4beta1.CommuteFilter + * @instance + */ + CommuteFilter.prototype.startCoordinates = null; + + /** + * CommuteFilter travelDuration. + * @member {google.protobuf.IDuration|null|undefined} travelDuration + * @memberof google.cloud.talent.v4beta1.CommuteFilter + * @instance + */ + CommuteFilter.prototype.travelDuration = null; + + /** + * CommuteFilter allowImpreciseAddresses. + * @member {boolean} allowImpreciseAddresses + * @memberof google.cloud.talent.v4beta1.CommuteFilter + * @instance + */ + CommuteFilter.prototype.allowImpreciseAddresses = false; + + /** + * CommuteFilter roadTraffic. + * @member {google.cloud.talent.v4beta1.CommuteFilter.RoadTraffic|null|undefined} roadTraffic + * @memberof google.cloud.talent.v4beta1.CommuteFilter + * @instance + */ + CommuteFilter.prototype.roadTraffic = null; + + /** + * CommuteFilter departureTime. + * @member {google.type.ITimeOfDay|null|undefined} departureTime + * @memberof google.cloud.talent.v4beta1.CommuteFilter + * @instance + */ + CommuteFilter.prototype.departureTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CommuteFilter trafficOption. + * @member {"roadTraffic"|"departureTime"|undefined} trafficOption + * @memberof google.cloud.talent.v4beta1.CommuteFilter + * @instance + */ + Object.defineProperty(CommuteFilter.prototype, "trafficOption", { + get: $util.oneOfGetter($oneOfFields = ["roadTraffic", "departureTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CommuteFilter instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.CommuteFilter + * @static + * @param {google.cloud.talent.v4beta1.ICommuteFilter=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.CommuteFilter} CommuteFilter instance + */ + CommuteFilter.create = function create(properties) { + return new CommuteFilter(properties); + }; + + /** + * Encodes the specified CommuteFilter message. Does not implicitly {@link google.cloud.talent.v4beta1.CommuteFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.CommuteFilter + * @static + * @param {google.cloud.talent.v4beta1.ICommuteFilter} message CommuteFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommuteFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commuteMethod != null && Object.hasOwnProperty.call(message, "commuteMethod")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.commuteMethod); + if (message.startCoordinates != null && Object.hasOwnProperty.call(message, "startCoordinates")) + $root.google.type.LatLng.encode(message.startCoordinates, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.travelDuration != null && Object.hasOwnProperty.call(message, "travelDuration")) + $root.google.protobuf.Duration.encode(message.travelDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.allowImpreciseAddresses != null && Object.hasOwnProperty.call(message, "allowImpreciseAddresses")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowImpreciseAddresses); + if (message.roadTraffic != null && Object.hasOwnProperty.call(message, "roadTraffic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.roadTraffic); + if (message.departureTime != null && Object.hasOwnProperty.call(message, "departureTime")) + $root.google.type.TimeOfDay.encode(message.departureTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommuteFilter message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CommuteFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.CommuteFilter + * @static + * @param {google.cloud.talent.v4beta1.ICommuteFilter} message CommuteFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommuteFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommuteFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.CommuteFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.CommuteFilter} CommuteFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommuteFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.CommuteFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.commuteMethod = reader.int32(); + break; + } + case 2: { + message.startCoordinates = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + case 3: { + message.travelDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.allowImpreciseAddresses = reader.bool(); + break; + } + case 5: { + message.roadTraffic = reader.int32(); + break; + } + case 6: { + message.departureTime = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommuteFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.CommuteFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.CommuteFilter} CommuteFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommuteFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommuteFilter message. + * @function verify + * @memberof google.cloud.talent.v4beta1.CommuteFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommuteFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.commuteMethod != null && message.hasOwnProperty("commuteMethod")) + switch (message.commuteMethod) { + default: + return "commuteMethod: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.startCoordinates != null && message.hasOwnProperty("startCoordinates")) { + var error = $root.google.type.LatLng.verify(message.startCoordinates); + if (error) + return "startCoordinates." + error; + } + if (message.travelDuration != null && message.hasOwnProperty("travelDuration")) { + var error = $root.google.protobuf.Duration.verify(message.travelDuration); + if (error) + return "travelDuration." + error; + } + if (message.allowImpreciseAddresses != null && message.hasOwnProperty("allowImpreciseAddresses")) + if (typeof message.allowImpreciseAddresses !== "boolean") + return "allowImpreciseAddresses: boolean expected"; + if (message.roadTraffic != null && message.hasOwnProperty("roadTraffic")) { + properties.trafficOption = 1; + switch (message.roadTraffic) { + default: + return "roadTraffic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.departureTime != null && message.hasOwnProperty("departureTime")) { + if (properties.trafficOption === 1) + return "trafficOption: multiple values"; + properties.trafficOption = 1; + { + var error = $root.google.type.TimeOfDay.verify(message.departureTime); + if (error) + return "departureTime." + error; + } + } + return null; + }; + + /** + * Creates a CommuteFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.CommuteFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.CommuteFilter} CommuteFilter + */ + CommuteFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.CommuteFilter) + return object; + var message = new $root.google.cloud.talent.v4beta1.CommuteFilter(); + switch (object.commuteMethod) { + default: + if (typeof object.commuteMethod === "number") { + message.commuteMethod = object.commuteMethod; + break; + } + break; + case "COMMUTE_METHOD_UNSPECIFIED": + case 0: + message.commuteMethod = 0; + break; + case "DRIVING": + case 1: + message.commuteMethod = 1; + break; + case "TRANSIT": + case 2: + message.commuteMethod = 2; + break; + case "WALKING": + case 3: + message.commuteMethod = 3; + break; + case "CYCLING": + case 4: + message.commuteMethod = 4; + break; + } + if (object.startCoordinates != null) { + if (typeof object.startCoordinates !== "object") + throw TypeError(".google.cloud.talent.v4beta1.CommuteFilter.startCoordinates: object expected"); + message.startCoordinates = $root.google.type.LatLng.fromObject(object.startCoordinates); + } + if (object.travelDuration != null) { + if (typeof object.travelDuration !== "object") + throw TypeError(".google.cloud.talent.v4beta1.CommuteFilter.travelDuration: object expected"); + message.travelDuration = $root.google.protobuf.Duration.fromObject(object.travelDuration); + } + if (object.allowImpreciseAddresses != null) + message.allowImpreciseAddresses = Boolean(object.allowImpreciseAddresses); + switch (object.roadTraffic) { + default: + if (typeof object.roadTraffic === "number") { + message.roadTraffic = object.roadTraffic; + break; + } + break; + case "ROAD_TRAFFIC_UNSPECIFIED": + case 0: + message.roadTraffic = 0; + break; + case "TRAFFIC_FREE": + case 1: + message.roadTraffic = 1; + break; + case "BUSY_HOUR": + case 2: + message.roadTraffic = 2; + break; + } + if (object.departureTime != null) { + if (typeof object.departureTime !== "object") + throw TypeError(".google.cloud.talent.v4beta1.CommuteFilter.departureTime: object expected"); + message.departureTime = $root.google.type.TimeOfDay.fromObject(object.departureTime); + } + return message; + }; + + /** + * Creates a plain object from a CommuteFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.CommuteFilter + * @static + * @param {google.cloud.talent.v4beta1.CommuteFilter} message CommuteFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommuteFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.commuteMethod = options.enums === String ? "COMMUTE_METHOD_UNSPECIFIED" : 0; + object.startCoordinates = null; + object.travelDuration = null; + object.allowImpreciseAddresses = false; + } + if (message.commuteMethod != null && message.hasOwnProperty("commuteMethod")) + object.commuteMethod = options.enums === String ? $root.google.cloud.talent.v4beta1.CommuteMethod[message.commuteMethod] === undefined ? message.commuteMethod : $root.google.cloud.talent.v4beta1.CommuteMethod[message.commuteMethod] : message.commuteMethod; + if (message.startCoordinates != null && message.hasOwnProperty("startCoordinates")) + object.startCoordinates = $root.google.type.LatLng.toObject(message.startCoordinates, options); + if (message.travelDuration != null && message.hasOwnProperty("travelDuration")) + object.travelDuration = $root.google.protobuf.Duration.toObject(message.travelDuration, options); + if (message.allowImpreciseAddresses != null && message.hasOwnProperty("allowImpreciseAddresses")) + object.allowImpreciseAddresses = message.allowImpreciseAddresses; + if (message.roadTraffic != null && message.hasOwnProperty("roadTraffic")) { + object.roadTraffic = options.enums === String ? $root.google.cloud.talent.v4beta1.CommuteFilter.RoadTraffic[message.roadTraffic] === undefined ? message.roadTraffic : $root.google.cloud.talent.v4beta1.CommuteFilter.RoadTraffic[message.roadTraffic] : message.roadTraffic; + if (options.oneofs) + object.trafficOption = "roadTraffic"; + } + if (message.departureTime != null && message.hasOwnProperty("departureTime")) { + object.departureTime = $root.google.type.TimeOfDay.toObject(message.departureTime, options); + if (options.oneofs) + object.trafficOption = "departureTime"; + } + return object; + }; + + /** + * Converts this CommuteFilter to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.CommuteFilter + * @instance + * @returns {Object.} JSON object + */ + CommuteFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommuteFilter + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.CommuteFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommuteFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.CommuteFilter"; + }; + + /** + * RoadTraffic enum. + * @name google.cloud.talent.v4beta1.CommuteFilter.RoadTraffic + * @enum {number} + * @property {number} ROAD_TRAFFIC_UNSPECIFIED=0 ROAD_TRAFFIC_UNSPECIFIED value + * @property {number} TRAFFIC_FREE=1 TRAFFIC_FREE value + * @property {number} BUSY_HOUR=2 BUSY_HOUR value + */ + CommuteFilter.RoadTraffic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROAD_TRAFFIC_UNSPECIFIED"] = 0; + values[valuesById[1] = "TRAFFIC_FREE"] = 1; + values[valuesById[2] = "BUSY_HOUR"] = 2; + return values; + })(); + + return CommuteFilter; + })(); + + v4beta1.HistogramQuery = (function() { + + /** + * Properties of a HistogramQuery. + * @memberof google.cloud.talent.v4beta1 + * @interface IHistogramQuery + * @property {string|null} [histogramQuery] HistogramQuery histogramQuery + */ + + /** + * Constructs a new HistogramQuery. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a HistogramQuery. + * @implements IHistogramQuery + * @constructor + * @param {google.cloud.talent.v4beta1.IHistogramQuery=} [properties] Properties to set + */ + function HistogramQuery(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HistogramQuery histogramQuery. + * @member {string} histogramQuery + * @memberof google.cloud.talent.v4beta1.HistogramQuery + * @instance + */ + HistogramQuery.prototype.histogramQuery = ""; + + /** + * Creates a new HistogramQuery instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.HistogramQuery + * @static + * @param {google.cloud.talent.v4beta1.IHistogramQuery=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.HistogramQuery} HistogramQuery instance + */ + HistogramQuery.create = function create(properties) { + return new HistogramQuery(properties); + }; + + /** + * Encodes the specified HistogramQuery message. Does not implicitly {@link google.cloud.talent.v4beta1.HistogramQuery.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.HistogramQuery + * @static + * @param {google.cloud.talent.v4beta1.IHistogramQuery} message HistogramQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.histogramQuery != null && Object.hasOwnProperty.call(message, "histogramQuery")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.histogramQuery); + return writer; + }; + + /** + * Encodes the specified HistogramQuery message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.HistogramQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.HistogramQuery + * @static + * @param {google.cloud.talent.v4beta1.IHistogramQuery} message HistogramQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HistogramQuery message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.HistogramQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.HistogramQuery} HistogramQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramQuery.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.HistogramQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.histogramQuery = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HistogramQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.HistogramQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.HistogramQuery} HistogramQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HistogramQuery message. + * @function verify + * @memberof google.cloud.talent.v4beta1.HistogramQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HistogramQuery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.histogramQuery != null && message.hasOwnProperty("histogramQuery")) + if (!$util.isString(message.histogramQuery)) + return "histogramQuery: string expected"; + return null; + }; + + /** + * Creates a HistogramQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.HistogramQuery + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.HistogramQuery} HistogramQuery + */ + HistogramQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.HistogramQuery) + return object; + var message = new $root.google.cloud.talent.v4beta1.HistogramQuery(); + if (object.histogramQuery != null) + message.histogramQuery = String(object.histogramQuery); + return message; + }; + + /** + * Creates a plain object from a HistogramQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.HistogramQuery + * @static + * @param {google.cloud.talent.v4beta1.HistogramQuery} message HistogramQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HistogramQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.histogramQuery = ""; + if (message.histogramQuery != null && message.hasOwnProperty("histogramQuery")) + object.histogramQuery = message.histogramQuery; + return object; + }; + + /** + * Converts this HistogramQuery to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.HistogramQuery + * @instance + * @returns {Object.} JSON object + */ + HistogramQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HistogramQuery + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.HistogramQuery + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HistogramQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.HistogramQuery"; + }; + + return HistogramQuery; + })(); + + v4beta1.HistogramQueryResult = (function() { + + /** + * Properties of a HistogramQueryResult. + * @memberof google.cloud.talent.v4beta1 + * @interface IHistogramQueryResult + * @property {string|null} [histogramQuery] HistogramQueryResult histogramQuery + * @property {Object.|null} [histogram] HistogramQueryResult histogram + */ + + /** + * Constructs a new HistogramQueryResult. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a HistogramQueryResult. + * @implements IHistogramQueryResult + * @constructor + * @param {google.cloud.talent.v4beta1.IHistogramQueryResult=} [properties] Properties to set + */ + function HistogramQueryResult(properties) { + this.histogram = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HistogramQueryResult histogramQuery. + * @member {string} histogramQuery + * @memberof google.cloud.talent.v4beta1.HistogramQueryResult + * @instance + */ + HistogramQueryResult.prototype.histogramQuery = ""; + + /** + * HistogramQueryResult histogram. + * @member {Object.} histogram + * @memberof google.cloud.talent.v4beta1.HistogramQueryResult + * @instance + */ + HistogramQueryResult.prototype.histogram = $util.emptyObject; + + /** + * Creates a new HistogramQueryResult instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.HistogramQueryResult + * @static + * @param {google.cloud.talent.v4beta1.IHistogramQueryResult=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.HistogramQueryResult} HistogramQueryResult instance + */ + HistogramQueryResult.create = function create(properties) { + return new HistogramQueryResult(properties); + }; + + /** + * Encodes the specified HistogramQueryResult message. Does not implicitly {@link google.cloud.talent.v4beta1.HistogramQueryResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.HistogramQueryResult + * @static + * @param {google.cloud.talent.v4beta1.IHistogramQueryResult} message HistogramQueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramQueryResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.histogramQuery != null && Object.hasOwnProperty.call(message, "histogramQuery")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.histogramQuery); + if (message.histogram != null && Object.hasOwnProperty.call(message, "histogram")) + for (var keys = Object.keys(message.histogram), 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 0 =*/16).int64(message.histogram[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified HistogramQueryResult message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.HistogramQueryResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.HistogramQueryResult + * @static + * @param {google.cloud.talent.v4beta1.IHistogramQueryResult} message HistogramQueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramQueryResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HistogramQueryResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.HistogramQueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.HistogramQueryResult} HistogramQueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramQueryResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.HistogramQueryResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.histogramQuery = reader.string(); + break; + } + case 2: { + if (message.histogram === $util.emptyObject) + message.histogram = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.int64(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.histogram[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HistogramQueryResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.HistogramQueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.HistogramQueryResult} HistogramQueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramQueryResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HistogramQueryResult message. + * @function verify + * @memberof google.cloud.talent.v4beta1.HistogramQueryResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HistogramQueryResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.histogramQuery != null && message.hasOwnProperty("histogramQuery")) + if (!$util.isString(message.histogramQuery)) + return "histogramQuery: string expected"; + if (message.histogram != null && message.hasOwnProperty("histogram")) { + if (!$util.isObject(message.histogram)) + return "histogram: object expected"; + var key = Object.keys(message.histogram); + for (var i = 0; i < key.length; ++i) + if (!$util.isInteger(message.histogram[key[i]]) && !(message.histogram[key[i]] && $util.isInteger(message.histogram[key[i]].low) && $util.isInteger(message.histogram[key[i]].high))) + return "histogram: integer|Long{k:string} expected"; + } + return null; + }; + + /** + * Creates a HistogramQueryResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.HistogramQueryResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.HistogramQueryResult} HistogramQueryResult + */ + HistogramQueryResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.HistogramQueryResult) + return object; + var message = new $root.google.cloud.talent.v4beta1.HistogramQueryResult(); + if (object.histogramQuery != null) + message.histogramQuery = String(object.histogramQuery); + if (object.histogram) { + if (typeof object.histogram !== "object") + throw TypeError(".google.cloud.talent.v4beta1.HistogramQueryResult.histogram: object expected"); + message.histogram = {}; + for (var keys = Object.keys(object.histogram), i = 0; i < keys.length; ++i) + if ($util.Long) + (message.histogram[keys[i]] = $util.Long.fromValue(object.histogram[keys[i]])).unsigned = false; + else if (typeof object.histogram[keys[i]] === "string") + message.histogram[keys[i]] = parseInt(object.histogram[keys[i]], 10); + else if (typeof object.histogram[keys[i]] === "number") + message.histogram[keys[i]] = object.histogram[keys[i]]; + else if (typeof object.histogram[keys[i]] === "object") + message.histogram[keys[i]] = new $util.LongBits(object.histogram[keys[i]].low >>> 0, object.histogram[keys[i]].high >>> 0).toNumber(); + } + return message; + }; + + /** + * Creates a plain object from a HistogramQueryResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.HistogramQueryResult + * @static + * @param {google.cloud.talent.v4beta1.HistogramQueryResult} message HistogramQueryResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HistogramQueryResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.histogram = {}; + if (options.defaults) + object.histogramQuery = ""; + if (message.histogramQuery != null && message.hasOwnProperty("histogramQuery")) + object.histogramQuery = message.histogramQuery; + var keys2; + if (message.histogram && (keys2 = Object.keys(message.histogram)).length) { + object.histogram = {}; + for (var j = 0; j < keys2.length; ++j) + if (typeof message.histogram[keys2[j]] === "number") + object.histogram[keys2[j]] = options.longs === String ? String(message.histogram[keys2[j]]) : message.histogram[keys2[j]]; + else + object.histogram[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.histogram[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.histogram[keys2[j]].low >>> 0, message.histogram[keys2[j]].high >>> 0).toNumber() : message.histogram[keys2[j]]; + } + return object; + }; + + /** + * Converts this HistogramQueryResult to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.HistogramQueryResult + * @instance + * @returns {Object.} JSON object + */ + HistogramQueryResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HistogramQueryResult + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.HistogramQueryResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HistogramQueryResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.HistogramQueryResult"; + }; + + return HistogramQueryResult; + })(); + + v4beta1.Job = (function() { + + /** + * Properties of a Job. + * @memberof google.cloud.talent.v4beta1 + * @interface IJob + * @property {string|null} [name] Job name + * @property {string|null} [company] Job company + * @property {string|null} [requisitionId] Job requisitionId + * @property {string|null} [title] Job title + * @property {string|null} [description] Job description + * @property {Array.|null} [addresses] Job addresses + * @property {google.cloud.talent.v4beta1.Job.IApplicationInfo|null} [applicationInfo] Job applicationInfo + * @property {Array.|null} [jobBenefits] Job jobBenefits + * @property {google.cloud.talent.v4beta1.ICompensationInfo|null} [compensationInfo] Job compensationInfo + * @property {Object.|null} [customAttributes] Job customAttributes + * @property {Array.|null} [degreeTypes] Job degreeTypes + * @property {string|null} [department] Job department + * @property {Array.|null} [employmentTypes] Job employmentTypes + * @property {string|null} [incentives] Job incentives + * @property {string|null} [languageCode] Job languageCode + * @property {google.cloud.talent.v4beta1.JobLevel|null} [jobLevel] Job jobLevel + * @property {number|null} [promotionValue] Job promotionValue + * @property {string|null} [qualifications] Job qualifications + * @property {string|null} [responsibilities] Job responsibilities + * @property {google.cloud.talent.v4beta1.PostingRegion|null} [postingRegion] Job postingRegion + * @property {google.cloud.talent.v4beta1.Visibility|null} [visibility] Job visibility + * @property {google.protobuf.ITimestamp|null} [jobStartTime] Job jobStartTime + * @property {google.protobuf.ITimestamp|null} [jobEndTime] Job jobEndTime + * @property {google.protobuf.ITimestamp|null} [postingPublishTime] Job postingPublishTime + * @property {google.protobuf.ITimestamp|null} [postingExpireTime] Job postingExpireTime + * @property {google.protobuf.ITimestamp|null} [postingCreateTime] Job postingCreateTime + * @property {google.protobuf.ITimestamp|null} [postingUpdateTime] Job postingUpdateTime + * @property {string|null} [companyDisplayName] Job companyDisplayName + * @property {google.cloud.talent.v4beta1.Job.IDerivedInfo|null} [derivedInfo] Job derivedInfo + * @property {google.cloud.talent.v4beta1.Job.IProcessingOptions|null} [processingOptions] Job processingOptions + */ + + /** + * Constructs a new Job. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a Job. + * @implements IJob + * @constructor + * @param {google.cloud.talent.v4beta1.IJob=} [properties] Properties to set + */ + function Job(properties) { + this.addresses = []; + this.jobBenefits = []; + this.customAttributes = {}; + this.degreeTypes = []; + this.employmentTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Job name. + * @member {string} name + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.name = ""; + + /** + * Job company. + * @member {string} company + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.company = ""; + + /** + * Job requisitionId. + * @member {string} requisitionId + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.requisitionId = ""; + + /** + * Job title. + * @member {string} title + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.title = ""; + + /** + * Job description. + * @member {string} description + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.description = ""; + + /** + * Job addresses. + * @member {Array.} addresses + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.addresses = $util.emptyArray; + + /** + * Job applicationInfo. + * @member {google.cloud.talent.v4beta1.Job.IApplicationInfo|null|undefined} applicationInfo + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.applicationInfo = null; + + /** + * Job jobBenefits. + * @member {Array.} jobBenefits + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.jobBenefits = $util.emptyArray; + + /** + * Job compensationInfo. + * @member {google.cloud.talent.v4beta1.ICompensationInfo|null|undefined} compensationInfo + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.compensationInfo = null; + + /** + * Job customAttributes. + * @member {Object.} customAttributes + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.customAttributes = $util.emptyObject; + + /** + * Job degreeTypes. + * @member {Array.} degreeTypes + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.degreeTypes = $util.emptyArray; + + /** + * Job department. + * @member {string} department + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.department = ""; + + /** + * Job employmentTypes. + * @member {Array.} employmentTypes + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.employmentTypes = $util.emptyArray; + + /** + * Job incentives. + * @member {string} incentives + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.incentives = ""; + + /** + * Job languageCode. + * @member {string} languageCode + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.languageCode = ""; + + /** + * Job jobLevel. + * @member {google.cloud.talent.v4beta1.JobLevel} jobLevel + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.jobLevel = 0; + + /** + * Job promotionValue. + * @member {number} promotionValue + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.promotionValue = 0; + + /** + * Job qualifications. + * @member {string} qualifications + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.qualifications = ""; + + /** + * Job responsibilities. + * @member {string} responsibilities + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.responsibilities = ""; + + /** + * Job postingRegion. + * @member {google.cloud.talent.v4beta1.PostingRegion} postingRegion + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.postingRegion = 0; + + /** + * Job visibility. + * @member {google.cloud.talent.v4beta1.Visibility} visibility + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.visibility = 0; + + /** + * Job jobStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} jobStartTime + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.jobStartTime = null; + + /** + * Job jobEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} jobEndTime + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.jobEndTime = null; + + /** + * Job postingPublishTime. + * @member {google.protobuf.ITimestamp|null|undefined} postingPublishTime + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.postingPublishTime = null; + + /** + * Job postingExpireTime. + * @member {google.protobuf.ITimestamp|null|undefined} postingExpireTime + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.postingExpireTime = null; + + /** + * Job postingCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} postingCreateTime + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.postingCreateTime = null; + + /** + * Job postingUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} postingUpdateTime + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.postingUpdateTime = null; + + /** + * Job companyDisplayName. + * @member {string} companyDisplayName + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.companyDisplayName = ""; + + /** + * Job derivedInfo. + * @member {google.cloud.talent.v4beta1.Job.IDerivedInfo|null|undefined} derivedInfo + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.derivedInfo = null; + + /** + * Job processingOptions. + * @member {google.cloud.talent.v4beta1.Job.IProcessingOptions|null|undefined} processingOptions + * @memberof google.cloud.talent.v4beta1.Job + * @instance + */ + Job.prototype.processingOptions = null; + + /** + * Creates a new Job instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.Job + * @static + * @param {google.cloud.talent.v4beta1.IJob=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.Job} Job instance + */ + Job.create = function create(properties) { + return new Job(properties); + }; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.talent.v4beta1.Job.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.Job + * @static + * @param {google.cloud.talent.v4beta1.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.company != null && Object.hasOwnProperty.call(message, "company")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.company); + if (message.requisitionId != null && Object.hasOwnProperty.call(message, "requisitionId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requisitionId); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.addresses != null && message.addresses.length) + for (var i = 0; i < message.addresses.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.addresses[i]); + if (message.applicationInfo != null && Object.hasOwnProperty.call(message, "applicationInfo")) + $root.google.cloud.talent.v4beta1.Job.ApplicationInfo.encode(message.applicationInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.jobBenefits != null && message.jobBenefits.length) { + writer.uint32(/* id 8, wireType 2 =*/66).fork(); + for (var i = 0; i < message.jobBenefits.length; ++i) + writer.int32(message.jobBenefits[i]); + writer.ldelim(); + } + if (message.compensationInfo != null && Object.hasOwnProperty.call(message, "compensationInfo")) + $root.google.cloud.talent.v4beta1.CompensationInfo.encode(message.compensationInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.customAttributes != null && Object.hasOwnProperty.call(message, "customAttributes")) + for (var keys = Object.keys(message.customAttributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.talent.v4beta1.CustomAttribute.encode(message.customAttributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.degreeTypes != null && message.degreeTypes.length) { + writer.uint32(/* id 11, wireType 2 =*/90).fork(); + for (var i = 0; i < message.degreeTypes.length; ++i) + writer.int32(message.degreeTypes[i]); + writer.ldelim(); + } + if (message.department != null && Object.hasOwnProperty.call(message, "department")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.department); + if (message.employmentTypes != null && message.employmentTypes.length) { + writer.uint32(/* id 13, wireType 2 =*/106).fork(); + for (var i = 0; i < message.employmentTypes.length; ++i) + writer.int32(message.employmentTypes[i]); + writer.ldelim(); + } + if (message.incentives != null && Object.hasOwnProperty.call(message, "incentives")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.incentives); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.languageCode); + if (message.jobLevel != null && Object.hasOwnProperty.call(message, "jobLevel")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.jobLevel); + if (message.promotionValue != null && Object.hasOwnProperty.call(message, "promotionValue")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.promotionValue); + if (message.qualifications != null && Object.hasOwnProperty.call(message, "qualifications")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.qualifications); + if (message.responsibilities != null && Object.hasOwnProperty.call(message, "responsibilities")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.responsibilities); + if (message.postingRegion != null && Object.hasOwnProperty.call(message, "postingRegion")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.postingRegion); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.visibility); + if (message.jobStartTime != null && Object.hasOwnProperty.call(message, "jobStartTime")) + $root.google.protobuf.Timestamp.encode(message.jobStartTime, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.jobEndTime != null && Object.hasOwnProperty.call(message, "jobEndTime")) + $root.google.protobuf.Timestamp.encode(message.jobEndTime, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.postingPublishTime != null && Object.hasOwnProperty.call(message, "postingPublishTime")) + $root.google.protobuf.Timestamp.encode(message.postingPublishTime, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.postingExpireTime != null && Object.hasOwnProperty.call(message, "postingExpireTime")) + $root.google.protobuf.Timestamp.encode(message.postingExpireTime, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.postingCreateTime != null && Object.hasOwnProperty.call(message, "postingCreateTime")) + $root.google.protobuf.Timestamp.encode(message.postingCreateTime, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.postingUpdateTime != null && Object.hasOwnProperty.call(message, "postingUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.postingUpdateTime, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.companyDisplayName != null && Object.hasOwnProperty.call(message, "companyDisplayName")) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.companyDisplayName); + if (message.derivedInfo != null && Object.hasOwnProperty.call(message, "derivedInfo")) + $root.google.cloud.talent.v4beta1.Job.DerivedInfo.encode(message.derivedInfo, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.processingOptions != null && Object.hasOwnProperty.call(message, "processingOptions")) + $root.google.cloud.talent.v4beta1.Job.ProcessingOptions.encode(message.processingOptions, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.Job.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.Job + * @static + * @param {google.cloud.talent.v4beta1.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Job message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.Job(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.company = reader.string(); + break; + } + case 3: { + message.requisitionId = reader.string(); + break; + } + case 4: { + message.title = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + if (!(message.addresses && message.addresses.length)) + message.addresses = []; + message.addresses.push(reader.string()); + break; + } + case 7: { + message.applicationInfo = $root.google.cloud.talent.v4beta1.Job.ApplicationInfo.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.jobBenefits && message.jobBenefits.length)) + message.jobBenefits = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.jobBenefits.push(reader.int32()); + } else + message.jobBenefits.push(reader.int32()); + break; + } + case 9: { + message.compensationInfo = $root.google.cloud.talent.v4beta1.CompensationInfo.decode(reader, reader.uint32()); + break; + } + case 10: { + if (message.customAttributes === $util.emptyObject) + message.customAttributes = {}; + 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.talent.v4beta1.CustomAttribute.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.customAttributes[key] = value; + break; + } + case 11: { + if (!(message.degreeTypes && message.degreeTypes.length)) + message.degreeTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.degreeTypes.push(reader.int32()); + } else + message.degreeTypes.push(reader.int32()); + break; + } + case 12: { + message.department = reader.string(); + break; + } + case 13: { + if (!(message.employmentTypes && message.employmentTypes.length)) + message.employmentTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.employmentTypes.push(reader.int32()); + } else + message.employmentTypes.push(reader.int32()); + break; + } + case 14: { + message.incentives = reader.string(); + break; + } + case 15: { + message.languageCode = reader.string(); + break; + } + case 16: { + message.jobLevel = reader.int32(); + break; + } + case 17: { + message.promotionValue = reader.int32(); + break; + } + case 18: { + message.qualifications = reader.string(); + break; + } + case 19: { + message.responsibilities = reader.string(); + break; + } + case 20: { + message.postingRegion = reader.int32(); + break; + } + case 21: { + message.visibility = reader.int32(); + break; + } + case 22: { + message.jobStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 23: { + message.jobEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 24: { + message.postingPublishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 25: { + message.postingExpireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 26: { + message.postingCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 27: { + message.postingUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 28: { + message.companyDisplayName = reader.string(); + break; + } + case 29: { + message.derivedInfo = $root.google.cloud.talent.v4beta1.Job.DerivedInfo.decode(reader, reader.uint32()); + break; + } + case 30: { + message.processingOptions = $root.google.cloud.talent.v4beta1.Job.ProcessingOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Job message. + * @function verify + * @memberof google.cloud.talent.v4beta1.Job + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Job.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.company != null && message.hasOwnProperty("company")) + if (!$util.isString(message.company)) + return "company: string expected"; + if (message.requisitionId != null && message.hasOwnProperty("requisitionId")) + if (!$util.isString(message.requisitionId)) + return "requisitionId: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.addresses != null && message.hasOwnProperty("addresses")) { + if (!Array.isArray(message.addresses)) + return "addresses: array expected"; + for (var i = 0; i < message.addresses.length; ++i) + if (!$util.isString(message.addresses[i])) + return "addresses: string[] expected"; + } + if (message.applicationInfo != null && message.hasOwnProperty("applicationInfo")) { + var error = $root.google.cloud.talent.v4beta1.Job.ApplicationInfo.verify(message.applicationInfo); + if (error) + return "applicationInfo." + error; + } + if (message.jobBenefits != null && message.hasOwnProperty("jobBenefits")) { + if (!Array.isArray(message.jobBenefits)) + return "jobBenefits: array expected"; + for (var i = 0; i < message.jobBenefits.length; ++i) + switch (message.jobBenefits[i]) { + default: + return "jobBenefits: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + break; + } + } + if (message.compensationInfo != null && message.hasOwnProperty("compensationInfo")) { + var error = $root.google.cloud.talent.v4beta1.CompensationInfo.verify(message.compensationInfo); + if (error) + return "compensationInfo." + error; + } + if (message.customAttributes != null && message.hasOwnProperty("customAttributes")) { + if (!$util.isObject(message.customAttributes)) + return "customAttributes: object expected"; + var key = Object.keys(message.customAttributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.talent.v4beta1.CustomAttribute.verify(message.customAttributes[key[i]]); + if (error) + return "customAttributes." + error; + } + } + if (message.degreeTypes != null && message.hasOwnProperty("degreeTypes")) { + if (!Array.isArray(message.degreeTypes)) + return "degreeTypes: array expected"; + for (var i = 0; i < message.degreeTypes.length; ++i) + switch (message.degreeTypes[i]) { + default: + return "degreeTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message.department != null && message.hasOwnProperty("department")) + if (!$util.isString(message.department)) + return "department: string expected"; + if (message.employmentTypes != null && message.hasOwnProperty("employmentTypes")) { + if (!Array.isArray(message.employmentTypes)) + return "employmentTypes: array expected"; + for (var i = 0; i < message.employmentTypes.length; ++i) + switch (message.employmentTypes[i]) { + default: + return "employmentTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + } + } + if (message.incentives != null && message.hasOwnProperty("incentives")) + if (!$util.isString(message.incentives)) + return "incentives: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.jobLevel != null && message.hasOwnProperty("jobLevel")) + switch (message.jobLevel) { + default: + return "jobLevel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.promotionValue != null && message.hasOwnProperty("promotionValue")) + if (!$util.isInteger(message.promotionValue)) + return "promotionValue: integer expected"; + if (message.qualifications != null && message.hasOwnProperty("qualifications")) + if (!$util.isString(message.qualifications)) + return "qualifications: string expected"; + if (message.responsibilities != null && message.hasOwnProperty("responsibilities")) + if (!$util.isString(message.responsibilities)) + return "responsibilities: string expected"; + if (message.postingRegion != null && message.hasOwnProperty("postingRegion")) + switch (message.postingRegion) { + default: + return "postingRegion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.visibility != null && message.hasOwnProperty("visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.jobStartTime != null && message.hasOwnProperty("jobStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.jobStartTime); + if (error) + return "jobStartTime." + error; + } + if (message.jobEndTime != null && message.hasOwnProperty("jobEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.jobEndTime); + if (error) + return "jobEndTime." + error; + } + if (message.postingPublishTime != null && message.hasOwnProperty("postingPublishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.postingPublishTime); + if (error) + return "postingPublishTime." + error; + } + if (message.postingExpireTime != null && message.hasOwnProperty("postingExpireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.postingExpireTime); + if (error) + return "postingExpireTime." + error; + } + if (message.postingCreateTime != null && message.hasOwnProperty("postingCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.postingCreateTime); + if (error) + return "postingCreateTime." + error; + } + if (message.postingUpdateTime != null && message.hasOwnProperty("postingUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.postingUpdateTime); + if (error) + return "postingUpdateTime." + error; + } + if (message.companyDisplayName != null && message.hasOwnProperty("companyDisplayName")) + if (!$util.isString(message.companyDisplayName)) + return "companyDisplayName: string expected"; + if (message.derivedInfo != null && message.hasOwnProperty("derivedInfo")) { + var error = $root.google.cloud.talent.v4beta1.Job.DerivedInfo.verify(message.derivedInfo); + if (error) + return "derivedInfo." + error; + } + if (message.processingOptions != null && message.hasOwnProperty("processingOptions")) { + var error = $root.google.cloud.talent.v4beta1.Job.ProcessingOptions.verify(message.processingOptions); + if (error) + return "processingOptions." + error; + } + return null; + }; + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.Job + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.Job} Job + */ + Job.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.Job) + return object; + var message = new $root.google.cloud.talent.v4beta1.Job(); + if (object.name != null) + message.name = String(object.name); + if (object.company != null) + message.company = String(object.company); + if (object.requisitionId != null) + message.requisitionId = String(object.requisitionId); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.addresses) { + if (!Array.isArray(object.addresses)) + throw TypeError(".google.cloud.talent.v4beta1.Job.addresses: array expected"); + message.addresses = []; + for (var i = 0; i < object.addresses.length; ++i) + message.addresses[i] = String(object.addresses[i]); + } + if (object.applicationInfo != null) { + if (typeof object.applicationInfo !== "object") + throw TypeError(".google.cloud.talent.v4beta1.Job.applicationInfo: object expected"); + message.applicationInfo = $root.google.cloud.talent.v4beta1.Job.ApplicationInfo.fromObject(object.applicationInfo); + } + if (object.jobBenefits) { + if (!Array.isArray(object.jobBenefits)) + throw TypeError(".google.cloud.talent.v4beta1.Job.jobBenefits: array expected"); + message.jobBenefits = []; + for (var i = 0; i < object.jobBenefits.length; ++i) + switch (object.jobBenefits[i]) { + default: + if (typeof object.jobBenefits[i] === "number") { + message.jobBenefits[i] = object.jobBenefits[i]; + break; + } + case "JOB_BENEFIT_UNSPECIFIED": + case 0: + message.jobBenefits[i] = 0; + break; + case "CHILD_CARE": + case 1: + message.jobBenefits[i] = 1; + break; + case "DENTAL": + case 2: + message.jobBenefits[i] = 2; + break; + case "DOMESTIC_PARTNER": + case 3: + message.jobBenefits[i] = 3; + break; + case "FLEXIBLE_HOURS": + case 4: + message.jobBenefits[i] = 4; + break; + case "MEDICAL": + case 5: + message.jobBenefits[i] = 5; + break; + case "LIFE_INSURANCE": + case 6: + message.jobBenefits[i] = 6; + break; + case "PARENTAL_LEAVE": + case 7: + message.jobBenefits[i] = 7; + break; + case "RETIREMENT_PLAN": + case 8: + message.jobBenefits[i] = 8; + break; + case "SICK_DAYS": + case 9: + message.jobBenefits[i] = 9; + break; + case "VACATION": + case 10: + message.jobBenefits[i] = 10; + break; + case "VISION": + case 11: + message.jobBenefits[i] = 11; + break; + } + } + if (object.compensationInfo != null) { + if (typeof object.compensationInfo !== "object") + throw TypeError(".google.cloud.talent.v4beta1.Job.compensationInfo: object expected"); + message.compensationInfo = $root.google.cloud.talent.v4beta1.CompensationInfo.fromObject(object.compensationInfo); + } + if (object.customAttributes) { + if (typeof object.customAttributes !== "object") + throw TypeError(".google.cloud.talent.v4beta1.Job.customAttributes: object expected"); + message.customAttributes = {}; + for (var keys = Object.keys(object.customAttributes), i = 0; i < keys.length; ++i) { + if (typeof object.customAttributes[keys[i]] !== "object") + throw TypeError(".google.cloud.talent.v4beta1.Job.customAttributes: object expected"); + message.customAttributes[keys[i]] = $root.google.cloud.talent.v4beta1.CustomAttribute.fromObject(object.customAttributes[keys[i]]); + } + } + if (object.degreeTypes) { + if (!Array.isArray(object.degreeTypes)) + throw TypeError(".google.cloud.talent.v4beta1.Job.degreeTypes: array expected"); + message.degreeTypes = []; + for (var i = 0; i < object.degreeTypes.length; ++i) + switch (object.degreeTypes[i]) { + default: + if (typeof object.degreeTypes[i] === "number") { + message.degreeTypes[i] = object.degreeTypes[i]; + break; + } + case "DEGREE_TYPE_UNSPECIFIED": + case 0: + message.degreeTypes[i] = 0; + break; + case "PRIMARY_EDUCATION": + case 1: + message.degreeTypes[i] = 1; + break; + case "LOWER_SECONDARY_EDUCATION": + case 2: + message.degreeTypes[i] = 2; + break; + case "UPPER_SECONDARY_EDUCATION": + case 3: + message.degreeTypes[i] = 3; + break; + case "ADULT_REMEDIAL_EDUCATION": + case 4: + message.degreeTypes[i] = 4; + break; + case "ASSOCIATES_OR_EQUIVALENT": + case 5: + message.degreeTypes[i] = 5; + break; + case "BACHELORS_OR_EQUIVALENT": + case 6: + message.degreeTypes[i] = 6; + break; + case "MASTERS_OR_EQUIVALENT": + case 7: + message.degreeTypes[i] = 7; + break; + case "DOCTORAL_OR_EQUIVALENT": + case 8: + message.degreeTypes[i] = 8; + break; + } + } + if (object.department != null) + message.department = String(object.department); + if (object.employmentTypes) { + if (!Array.isArray(object.employmentTypes)) + throw TypeError(".google.cloud.talent.v4beta1.Job.employmentTypes: array expected"); + message.employmentTypes = []; + for (var i = 0; i < object.employmentTypes.length; ++i) + switch (object.employmentTypes[i]) { + default: + if (typeof object.employmentTypes[i] === "number") { + message.employmentTypes[i] = object.employmentTypes[i]; + break; + } + case "EMPLOYMENT_TYPE_UNSPECIFIED": + case 0: + message.employmentTypes[i] = 0; + break; + case "FULL_TIME": + case 1: + message.employmentTypes[i] = 1; + break; + case "PART_TIME": + case 2: + message.employmentTypes[i] = 2; + break; + case "CONTRACTOR": + case 3: + message.employmentTypes[i] = 3; + break; + case "CONTRACT_TO_HIRE": + case 4: + message.employmentTypes[i] = 4; + break; + case "TEMPORARY": + case 5: + message.employmentTypes[i] = 5; + break; + case "INTERN": + case 6: + message.employmentTypes[i] = 6; + break; + case "VOLUNTEER": + case 7: + message.employmentTypes[i] = 7; + break; + case "PER_DIEM": + case 8: + message.employmentTypes[i] = 8; + break; + case "FLY_IN_FLY_OUT": + case 9: + message.employmentTypes[i] = 9; + break; + case "OTHER_EMPLOYMENT_TYPE": + case 10: + message.employmentTypes[i] = 10; + break; + } + } + if (object.incentives != null) + message.incentives = String(object.incentives); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + switch (object.jobLevel) { + default: + if (typeof object.jobLevel === "number") { + message.jobLevel = object.jobLevel; + break; + } + break; + case "JOB_LEVEL_UNSPECIFIED": + case 0: + message.jobLevel = 0; + break; + case "ENTRY_LEVEL": + case 1: + message.jobLevel = 1; + break; + case "EXPERIENCED": + case 2: + message.jobLevel = 2; + break; + case "MANAGER": + case 3: + message.jobLevel = 3; + break; + case "DIRECTOR": + case 4: + message.jobLevel = 4; + break; + case "EXECUTIVE": + case 5: + message.jobLevel = 5; + break; + } + if (object.promotionValue != null) + message.promotionValue = object.promotionValue | 0; + if (object.qualifications != null) + message.qualifications = String(object.qualifications); + if (object.responsibilities != null) + message.responsibilities = String(object.responsibilities); + switch (object.postingRegion) { + default: + if (typeof object.postingRegion === "number") { + message.postingRegion = object.postingRegion; + break; + } + break; + case "POSTING_REGION_UNSPECIFIED": + case 0: + message.postingRegion = 0; + break; + case "ADMINISTRATIVE_AREA": + case 1: + message.postingRegion = 1; + break; + case "NATION": + case 2: + message.postingRegion = 2; + break; + case "TELECOMMUTE": + case 3: + message.postingRegion = 3; + break; + } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSPECIFIED": + case 0: + message.visibility = 0; + break; + case "ACCOUNT_ONLY": + case 1: + message.visibility = 1; + break; + case "SHARED_WITH_GOOGLE": + case 2: + message.visibility = 2; + break; + case "SHARED_WITH_PUBLIC": + case 3: + message.visibility = 3; + break; + } + if (object.jobStartTime != null) { + if (typeof object.jobStartTime !== "object") + throw TypeError(".google.cloud.talent.v4beta1.Job.jobStartTime: object expected"); + message.jobStartTime = $root.google.protobuf.Timestamp.fromObject(object.jobStartTime); + } + if (object.jobEndTime != null) { + if (typeof object.jobEndTime !== "object") + throw TypeError(".google.cloud.talent.v4beta1.Job.jobEndTime: object expected"); + message.jobEndTime = $root.google.protobuf.Timestamp.fromObject(object.jobEndTime); + } + if (object.postingPublishTime != null) { + if (typeof object.postingPublishTime !== "object") + throw TypeError(".google.cloud.talent.v4beta1.Job.postingPublishTime: object expected"); + message.postingPublishTime = $root.google.protobuf.Timestamp.fromObject(object.postingPublishTime); + } + if (object.postingExpireTime != null) { + if (typeof object.postingExpireTime !== "object") + throw TypeError(".google.cloud.talent.v4beta1.Job.postingExpireTime: object expected"); + message.postingExpireTime = $root.google.protobuf.Timestamp.fromObject(object.postingExpireTime); + } + if (object.postingCreateTime != null) { + if (typeof object.postingCreateTime !== "object") + throw TypeError(".google.cloud.talent.v4beta1.Job.postingCreateTime: object expected"); + message.postingCreateTime = $root.google.protobuf.Timestamp.fromObject(object.postingCreateTime); + } + if (object.postingUpdateTime != null) { + if (typeof object.postingUpdateTime !== "object") + throw TypeError(".google.cloud.talent.v4beta1.Job.postingUpdateTime: object expected"); + message.postingUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.postingUpdateTime); + } + if (object.companyDisplayName != null) + message.companyDisplayName = String(object.companyDisplayName); + if (object.derivedInfo != null) { + if (typeof object.derivedInfo !== "object") + throw TypeError(".google.cloud.talent.v4beta1.Job.derivedInfo: object expected"); + message.derivedInfo = $root.google.cloud.talent.v4beta1.Job.DerivedInfo.fromObject(object.derivedInfo); + } + if (object.processingOptions != null) { + if (typeof object.processingOptions !== "object") + throw TypeError(".google.cloud.talent.v4beta1.Job.processingOptions: object expected"); + message.processingOptions = $root.google.cloud.talent.v4beta1.Job.ProcessingOptions.fromObject(object.processingOptions); + } + return message; + }; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.Job + * @static + * @param {google.cloud.talent.v4beta1.Job} message Job + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Job.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.addresses = []; + object.jobBenefits = []; + object.degreeTypes = []; + object.employmentTypes = []; + } + if (options.objects || options.defaults) + object.customAttributes = {}; + if (options.defaults) { + object.name = ""; + object.company = ""; + object.requisitionId = ""; + object.title = ""; + object.description = ""; + object.applicationInfo = null; + object.compensationInfo = null; + object.department = ""; + object.incentives = ""; + object.languageCode = ""; + object.jobLevel = options.enums === String ? "JOB_LEVEL_UNSPECIFIED" : 0; + object.promotionValue = 0; + object.qualifications = ""; + object.responsibilities = ""; + object.postingRegion = options.enums === String ? "POSTING_REGION_UNSPECIFIED" : 0; + object.visibility = options.enums === String ? "VISIBILITY_UNSPECIFIED" : 0; + object.jobStartTime = null; + object.jobEndTime = null; + object.postingPublishTime = null; + object.postingExpireTime = null; + object.postingCreateTime = null; + object.postingUpdateTime = null; + object.companyDisplayName = ""; + object.derivedInfo = null; + object.processingOptions = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.company != null && message.hasOwnProperty("company")) + object.company = message.company; + if (message.requisitionId != null && message.hasOwnProperty("requisitionId")) + object.requisitionId = message.requisitionId; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.addresses && message.addresses.length) { + object.addresses = []; + for (var j = 0; j < message.addresses.length; ++j) + object.addresses[j] = message.addresses[j]; + } + if (message.applicationInfo != null && message.hasOwnProperty("applicationInfo")) + object.applicationInfo = $root.google.cloud.talent.v4beta1.Job.ApplicationInfo.toObject(message.applicationInfo, options); + if (message.jobBenefits && message.jobBenefits.length) { + object.jobBenefits = []; + for (var j = 0; j < message.jobBenefits.length; ++j) + object.jobBenefits[j] = options.enums === String ? $root.google.cloud.talent.v4beta1.JobBenefit[message.jobBenefits[j]] === undefined ? message.jobBenefits[j] : $root.google.cloud.talent.v4beta1.JobBenefit[message.jobBenefits[j]] : message.jobBenefits[j]; + } + if (message.compensationInfo != null && message.hasOwnProperty("compensationInfo")) + object.compensationInfo = $root.google.cloud.talent.v4beta1.CompensationInfo.toObject(message.compensationInfo, options); + var keys2; + if (message.customAttributes && (keys2 = Object.keys(message.customAttributes)).length) { + object.customAttributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.customAttributes[keys2[j]] = $root.google.cloud.talent.v4beta1.CustomAttribute.toObject(message.customAttributes[keys2[j]], options); + } + if (message.degreeTypes && message.degreeTypes.length) { + object.degreeTypes = []; + for (var j = 0; j < message.degreeTypes.length; ++j) + object.degreeTypes[j] = options.enums === String ? $root.google.cloud.talent.v4beta1.DegreeType[message.degreeTypes[j]] === undefined ? message.degreeTypes[j] : $root.google.cloud.talent.v4beta1.DegreeType[message.degreeTypes[j]] : message.degreeTypes[j]; + } + if (message.department != null && message.hasOwnProperty("department")) + object.department = message.department; + if (message.employmentTypes && message.employmentTypes.length) { + object.employmentTypes = []; + for (var j = 0; j < message.employmentTypes.length; ++j) + object.employmentTypes[j] = options.enums === String ? $root.google.cloud.talent.v4beta1.EmploymentType[message.employmentTypes[j]] === undefined ? message.employmentTypes[j] : $root.google.cloud.talent.v4beta1.EmploymentType[message.employmentTypes[j]] : message.employmentTypes[j]; + } + if (message.incentives != null && message.hasOwnProperty("incentives")) + object.incentives = message.incentives; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.jobLevel != null && message.hasOwnProperty("jobLevel")) + object.jobLevel = options.enums === String ? $root.google.cloud.talent.v4beta1.JobLevel[message.jobLevel] === undefined ? message.jobLevel : $root.google.cloud.talent.v4beta1.JobLevel[message.jobLevel] : message.jobLevel; + if (message.promotionValue != null && message.hasOwnProperty("promotionValue")) + object.promotionValue = message.promotionValue; + if (message.qualifications != null && message.hasOwnProperty("qualifications")) + object.qualifications = message.qualifications; + if (message.responsibilities != null && message.hasOwnProperty("responsibilities")) + object.responsibilities = message.responsibilities; + if (message.postingRegion != null && message.hasOwnProperty("postingRegion")) + object.postingRegion = options.enums === String ? $root.google.cloud.talent.v4beta1.PostingRegion[message.postingRegion] === undefined ? message.postingRegion : $root.google.cloud.talent.v4beta1.PostingRegion[message.postingRegion] : message.postingRegion; + if (message.visibility != null && message.hasOwnProperty("visibility")) + object.visibility = options.enums === String ? $root.google.cloud.talent.v4beta1.Visibility[message.visibility] === undefined ? message.visibility : $root.google.cloud.talent.v4beta1.Visibility[message.visibility] : message.visibility; + if (message.jobStartTime != null && message.hasOwnProperty("jobStartTime")) + object.jobStartTime = $root.google.protobuf.Timestamp.toObject(message.jobStartTime, options); + if (message.jobEndTime != null && message.hasOwnProperty("jobEndTime")) + object.jobEndTime = $root.google.protobuf.Timestamp.toObject(message.jobEndTime, options); + if (message.postingPublishTime != null && message.hasOwnProperty("postingPublishTime")) + object.postingPublishTime = $root.google.protobuf.Timestamp.toObject(message.postingPublishTime, options); + if (message.postingExpireTime != null && message.hasOwnProperty("postingExpireTime")) + object.postingExpireTime = $root.google.protobuf.Timestamp.toObject(message.postingExpireTime, options); + if (message.postingCreateTime != null && message.hasOwnProperty("postingCreateTime")) + object.postingCreateTime = $root.google.protobuf.Timestamp.toObject(message.postingCreateTime, options); + if (message.postingUpdateTime != null && message.hasOwnProperty("postingUpdateTime")) + object.postingUpdateTime = $root.google.protobuf.Timestamp.toObject(message.postingUpdateTime, options); + if (message.companyDisplayName != null && message.hasOwnProperty("companyDisplayName")) + object.companyDisplayName = message.companyDisplayName; + if (message.derivedInfo != null && message.hasOwnProperty("derivedInfo")) + object.derivedInfo = $root.google.cloud.talent.v4beta1.Job.DerivedInfo.toObject(message.derivedInfo, options); + if (message.processingOptions != null && message.hasOwnProperty("processingOptions")) + object.processingOptions = $root.google.cloud.talent.v4beta1.Job.ProcessingOptions.toObject(message.processingOptions, options); + return object; + }; + + /** + * Converts this Job to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.Job + * @instance + * @returns {Object.} JSON object + */ + Job.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Job + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.Job + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.Job"; + }; + + Job.ApplicationInfo = (function() { + + /** + * Properties of an ApplicationInfo. + * @memberof google.cloud.talent.v4beta1.Job + * @interface IApplicationInfo + * @property {Array.|null} [emails] ApplicationInfo emails + * @property {string|null} [instruction] ApplicationInfo instruction + * @property {Array.|null} [uris] ApplicationInfo uris + */ + + /** + * Constructs a new ApplicationInfo. + * @memberof google.cloud.talent.v4beta1.Job + * @classdesc Represents an ApplicationInfo. + * @implements IApplicationInfo + * @constructor + * @param {google.cloud.talent.v4beta1.Job.IApplicationInfo=} [properties] Properties to set + */ + function ApplicationInfo(properties) { + this.emails = []; + this.uris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApplicationInfo emails. + * @member {Array.} emails + * @memberof google.cloud.talent.v4beta1.Job.ApplicationInfo + * @instance + */ + ApplicationInfo.prototype.emails = $util.emptyArray; + + /** + * ApplicationInfo instruction. + * @member {string} instruction + * @memberof google.cloud.talent.v4beta1.Job.ApplicationInfo + * @instance + */ + ApplicationInfo.prototype.instruction = ""; + + /** + * ApplicationInfo uris. + * @member {Array.} uris + * @memberof google.cloud.talent.v4beta1.Job.ApplicationInfo + * @instance + */ + ApplicationInfo.prototype.uris = $util.emptyArray; + + /** + * Creates a new ApplicationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.Job.ApplicationInfo + * @static + * @param {google.cloud.talent.v4beta1.Job.IApplicationInfo=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.Job.ApplicationInfo} ApplicationInfo instance + */ + ApplicationInfo.create = function create(properties) { + return new ApplicationInfo(properties); + }; + + /** + * Encodes the specified ApplicationInfo message. Does not implicitly {@link google.cloud.talent.v4beta1.Job.ApplicationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.Job.ApplicationInfo + * @static + * @param {google.cloud.talent.v4beta1.Job.IApplicationInfo} message ApplicationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplicationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.emails != null && message.emails.length) + for (var i = 0; i < message.emails.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.emails[i]); + if (message.instruction != null && Object.hasOwnProperty.call(message, "instruction")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instruction); + if (message.uris != null && message.uris.length) + for (var i = 0; i < message.uris.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uris[i]); + return writer; + }; + + /** + * Encodes the specified ApplicationInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.Job.ApplicationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.Job.ApplicationInfo + * @static + * @param {google.cloud.talent.v4beta1.Job.IApplicationInfo} message ApplicationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplicationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApplicationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.Job.ApplicationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.Job.ApplicationInfo} ApplicationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplicationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.Job.ApplicationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.emails && message.emails.length)) + message.emails = []; + message.emails.push(reader.string()); + break; + } + case 2: { + message.instruction = reader.string(); + break; + } + case 3: { + if (!(message.uris && message.uris.length)) + message.uris = []; + message.uris.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApplicationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.Job.ApplicationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.Job.ApplicationInfo} ApplicationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplicationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApplicationInfo message. + * @function verify + * @memberof google.cloud.talent.v4beta1.Job.ApplicationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApplicationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.emails != null && message.hasOwnProperty("emails")) { + if (!Array.isArray(message.emails)) + return "emails: array expected"; + for (var i = 0; i < message.emails.length; ++i) + if (!$util.isString(message.emails[i])) + return "emails: string[] expected"; + } + if (message.instruction != null && message.hasOwnProperty("instruction")) + if (!$util.isString(message.instruction)) + return "instruction: string expected"; + if (message.uris != null && message.hasOwnProperty("uris")) { + if (!Array.isArray(message.uris)) + return "uris: array expected"; + for (var i = 0; i < message.uris.length; ++i) + if (!$util.isString(message.uris[i])) + return "uris: string[] expected"; + } + return null; + }; + + /** + * Creates an ApplicationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.Job.ApplicationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.Job.ApplicationInfo} ApplicationInfo + */ + ApplicationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.Job.ApplicationInfo) + return object; + var message = new $root.google.cloud.talent.v4beta1.Job.ApplicationInfo(); + if (object.emails) { + if (!Array.isArray(object.emails)) + throw TypeError(".google.cloud.talent.v4beta1.Job.ApplicationInfo.emails: array expected"); + message.emails = []; + for (var i = 0; i < object.emails.length; ++i) + message.emails[i] = String(object.emails[i]); + } + if (object.instruction != null) + message.instruction = String(object.instruction); + if (object.uris) { + if (!Array.isArray(object.uris)) + throw TypeError(".google.cloud.talent.v4beta1.Job.ApplicationInfo.uris: array expected"); + message.uris = []; + for (var i = 0; i < object.uris.length; ++i) + message.uris[i] = String(object.uris[i]); + } + return message; + }; + + /** + * Creates a plain object from an ApplicationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.Job.ApplicationInfo + * @static + * @param {google.cloud.talent.v4beta1.Job.ApplicationInfo} message ApplicationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApplicationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.emails = []; + object.uris = []; + } + if (options.defaults) + object.instruction = ""; + if (message.emails && message.emails.length) { + object.emails = []; + for (var j = 0; j < message.emails.length; ++j) + object.emails[j] = message.emails[j]; + } + if (message.instruction != null && message.hasOwnProperty("instruction")) + object.instruction = message.instruction; + if (message.uris && message.uris.length) { + object.uris = []; + for (var j = 0; j < message.uris.length; ++j) + object.uris[j] = message.uris[j]; + } + return object; + }; + + /** + * Converts this ApplicationInfo to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.Job.ApplicationInfo + * @instance + * @returns {Object.} JSON object + */ + ApplicationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApplicationInfo + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.Job.ApplicationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApplicationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.Job.ApplicationInfo"; + }; + + return ApplicationInfo; + })(); + + Job.DerivedInfo = (function() { + + /** + * Properties of a DerivedInfo. + * @memberof google.cloud.talent.v4beta1.Job + * @interface IDerivedInfo + * @property {Array.|null} [locations] DerivedInfo locations + * @property {Array.|null} [jobCategories] DerivedInfo jobCategories + */ + + /** + * Constructs a new DerivedInfo. + * @memberof google.cloud.talent.v4beta1.Job + * @classdesc Represents a DerivedInfo. + * @implements IDerivedInfo + * @constructor + * @param {google.cloud.talent.v4beta1.Job.IDerivedInfo=} [properties] Properties to set + */ + function DerivedInfo(properties) { + this.locations = []; + this.jobCategories = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DerivedInfo locations. + * @member {Array.} locations + * @memberof google.cloud.talent.v4beta1.Job.DerivedInfo + * @instance + */ + DerivedInfo.prototype.locations = $util.emptyArray; + + /** + * DerivedInfo jobCategories. + * @member {Array.} jobCategories + * @memberof google.cloud.talent.v4beta1.Job.DerivedInfo + * @instance + */ + DerivedInfo.prototype.jobCategories = $util.emptyArray; + + /** + * Creates a new DerivedInfo instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.Job.DerivedInfo + * @static + * @param {google.cloud.talent.v4beta1.Job.IDerivedInfo=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.Job.DerivedInfo} DerivedInfo instance + */ + DerivedInfo.create = function create(properties) { + return new DerivedInfo(properties); + }; + + /** + * Encodes the specified DerivedInfo message. Does not implicitly {@link google.cloud.talent.v4beta1.Job.DerivedInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.Job.DerivedInfo + * @static + * @param {google.cloud.talent.v4beta1.Job.IDerivedInfo} message DerivedInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DerivedInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.locations != null && message.locations.length) + for (var i = 0; i < message.locations.length; ++i) + $root.google.cloud.talent.v4beta1.Location.encode(message.locations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.jobCategories != null && message.jobCategories.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.jobCategories.length; ++i) + writer.int32(message.jobCategories[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified DerivedInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.Job.DerivedInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.Job.DerivedInfo + * @static + * @param {google.cloud.talent.v4beta1.Job.IDerivedInfo} message DerivedInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DerivedInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DerivedInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.Job.DerivedInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.Job.DerivedInfo} DerivedInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DerivedInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.Job.DerivedInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.locations && message.locations.length)) + message.locations = []; + message.locations.push($root.google.cloud.talent.v4beta1.Location.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.jobCategories && message.jobCategories.length)) + message.jobCategories = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.jobCategories.push(reader.int32()); + } else + message.jobCategories.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DerivedInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.Job.DerivedInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.Job.DerivedInfo} DerivedInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DerivedInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DerivedInfo message. + * @function verify + * @memberof google.cloud.talent.v4beta1.Job.DerivedInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DerivedInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.locations != null && message.hasOwnProperty("locations")) { + if (!Array.isArray(message.locations)) + return "locations: array expected"; + for (var i = 0; i < message.locations.length; ++i) { + var error = $root.google.cloud.talent.v4beta1.Location.verify(message.locations[i]); + if (error) + return "locations." + error; + } + } + if (message.jobCategories != null && message.hasOwnProperty("jobCategories")) { + if (!Array.isArray(message.jobCategories)) + return "jobCategories: array expected"; + for (var i = 0; i < message.jobCategories.length; ++i) + switch (message.jobCategories[i]) { + default: + return "jobCategories: enum value[] expected"; + case 0: + 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: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + break; + } + } + return null; + }; + + /** + * Creates a DerivedInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.Job.DerivedInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.Job.DerivedInfo} DerivedInfo + */ + DerivedInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.Job.DerivedInfo) + return object; + var message = new $root.google.cloud.talent.v4beta1.Job.DerivedInfo(); + if (object.locations) { + if (!Array.isArray(object.locations)) + throw TypeError(".google.cloud.talent.v4beta1.Job.DerivedInfo.locations: array expected"); + message.locations = []; + for (var i = 0; i < object.locations.length; ++i) { + if (typeof object.locations[i] !== "object") + throw TypeError(".google.cloud.talent.v4beta1.Job.DerivedInfo.locations: object expected"); + message.locations[i] = $root.google.cloud.talent.v4beta1.Location.fromObject(object.locations[i]); + } + } + if (object.jobCategories) { + if (!Array.isArray(object.jobCategories)) + throw TypeError(".google.cloud.talent.v4beta1.Job.DerivedInfo.jobCategories: array expected"); + message.jobCategories = []; + for (var i = 0; i < object.jobCategories.length; ++i) + switch (object.jobCategories[i]) { + default: + if (typeof object.jobCategories[i] === "number") { + message.jobCategories[i] = object.jobCategories[i]; + break; + } + case "JOB_CATEGORY_UNSPECIFIED": + case 0: + message.jobCategories[i] = 0; + break; + case "ACCOUNTING_AND_FINANCE": + case 1: + message.jobCategories[i] = 1; + break; + case "ADMINISTRATIVE_AND_OFFICE": + case 2: + message.jobCategories[i] = 2; + break; + case "ADVERTISING_AND_MARKETING": + case 3: + message.jobCategories[i] = 3; + break; + case "ANIMAL_CARE": + case 4: + message.jobCategories[i] = 4; + break; + case "ART_FASHION_AND_DESIGN": + case 5: + message.jobCategories[i] = 5; + break; + case "BUSINESS_OPERATIONS": + case 6: + message.jobCategories[i] = 6; + break; + case "CLEANING_AND_FACILITIES": + case 7: + message.jobCategories[i] = 7; + break; + case "COMPUTER_AND_IT": + case 8: + message.jobCategories[i] = 8; + break; + case "CONSTRUCTION": + case 9: + message.jobCategories[i] = 9; + break; + case "CUSTOMER_SERVICE": + case 10: + message.jobCategories[i] = 10; + break; + case "EDUCATION": + case 11: + message.jobCategories[i] = 11; + break; + case "ENTERTAINMENT_AND_TRAVEL": + case 12: + message.jobCategories[i] = 12; + break; + case "FARMING_AND_OUTDOORS": + case 13: + message.jobCategories[i] = 13; + break; + case "HEALTHCARE": + case 14: + message.jobCategories[i] = 14; + break; + case "HUMAN_RESOURCES": + case 15: + message.jobCategories[i] = 15; + break; + case "INSTALLATION_MAINTENANCE_AND_REPAIR": + case 16: + message.jobCategories[i] = 16; + break; + case "LEGAL": + case 17: + message.jobCategories[i] = 17; + break; + case "MANAGEMENT": + case 18: + message.jobCategories[i] = 18; + break; + case "MANUFACTURING_AND_WAREHOUSE": + case 19: + message.jobCategories[i] = 19; + break; + case "MEDIA_COMMUNICATIONS_AND_WRITING": + case 20: + message.jobCategories[i] = 20; + break; + case "OIL_GAS_AND_MINING": + case 21: + message.jobCategories[i] = 21; + break; + case "PERSONAL_CARE_AND_SERVICES": + case 22: + message.jobCategories[i] = 22; + break; + case "PROTECTIVE_SERVICES": + case 23: + message.jobCategories[i] = 23; + break; + case "REAL_ESTATE": + case 24: + message.jobCategories[i] = 24; + break; + case "RESTAURANT_AND_HOSPITALITY": + case 25: + message.jobCategories[i] = 25; + break; + case "SALES_AND_RETAIL": + case 26: + message.jobCategories[i] = 26; + break; + case "SCIENCE_AND_ENGINEERING": + case 27: + message.jobCategories[i] = 27; + break; + case "SOCIAL_SERVICES_AND_NON_PROFIT": + case 28: + message.jobCategories[i] = 28; + break; + case "SPORTS_FITNESS_AND_RECREATION": + case 29: + message.jobCategories[i] = 29; + break; + case "TRANSPORTATION_AND_LOGISTICS": + case 30: + message.jobCategories[i] = 30; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a DerivedInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.Job.DerivedInfo + * @static + * @param {google.cloud.talent.v4beta1.Job.DerivedInfo} message DerivedInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DerivedInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.locations = []; + object.jobCategories = []; + } + if (message.locations && message.locations.length) { + object.locations = []; + for (var j = 0; j < message.locations.length; ++j) + object.locations[j] = $root.google.cloud.talent.v4beta1.Location.toObject(message.locations[j], options); + } + if (message.jobCategories && message.jobCategories.length) { + object.jobCategories = []; + for (var j = 0; j < message.jobCategories.length; ++j) + object.jobCategories[j] = options.enums === String ? $root.google.cloud.talent.v4beta1.JobCategory[message.jobCategories[j]] === undefined ? message.jobCategories[j] : $root.google.cloud.talent.v4beta1.JobCategory[message.jobCategories[j]] : message.jobCategories[j]; + } + return object; + }; + + /** + * Converts this DerivedInfo to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.Job.DerivedInfo + * @instance + * @returns {Object.} JSON object + */ + DerivedInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DerivedInfo + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.Job.DerivedInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DerivedInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.Job.DerivedInfo"; + }; + + return DerivedInfo; + })(); + + Job.ProcessingOptions = (function() { + + /** + * Properties of a ProcessingOptions. + * @memberof google.cloud.talent.v4beta1.Job + * @interface IProcessingOptions + * @property {boolean|null} [disableStreetAddressResolution] ProcessingOptions disableStreetAddressResolution + * @property {google.cloud.talent.v4beta1.HtmlSanitization|null} [htmlSanitization] ProcessingOptions htmlSanitization + */ + + /** + * Constructs a new ProcessingOptions. + * @memberof google.cloud.talent.v4beta1.Job + * @classdesc Represents a ProcessingOptions. + * @implements IProcessingOptions + * @constructor + * @param {google.cloud.talent.v4beta1.Job.IProcessingOptions=} [properties] Properties to set + */ + function ProcessingOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProcessingOptions disableStreetAddressResolution. + * @member {boolean} disableStreetAddressResolution + * @memberof google.cloud.talent.v4beta1.Job.ProcessingOptions + * @instance + */ + ProcessingOptions.prototype.disableStreetAddressResolution = false; + + /** + * ProcessingOptions htmlSanitization. + * @member {google.cloud.talent.v4beta1.HtmlSanitization} htmlSanitization + * @memberof google.cloud.talent.v4beta1.Job.ProcessingOptions + * @instance + */ + ProcessingOptions.prototype.htmlSanitization = 0; + + /** + * Creates a new ProcessingOptions instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.Job.ProcessingOptions + * @static + * @param {google.cloud.talent.v4beta1.Job.IProcessingOptions=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.Job.ProcessingOptions} ProcessingOptions instance + */ + ProcessingOptions.create = function create(properties) { + return new ProcessingOptions(properties); + }; + + /** + * Encodes the specified ProcessingOptions message. Does not implicitly {@link google.cloud.talent.v4beta1.Job.ProcessingOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.Job.ProcessingOptions + * @static + * @param {google.cloud.talent.v4beta1.Job.IProcessingOptions} message ProcessingOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessingOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disableStreetAddressResolution != null && Object.hasOwnProperty.call(message, "disableStreetAddressResolution")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.disableStreetAddressResolution); + if (message.htmlSanitization != null && Object.hasOwnProperty.call(message, "htmlSanitization")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.htmlSanitization); + return writer; + }; + + /** + * Encodes the specified ProcessingOptions message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.Job.ProcessingOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.Job.ProcessingOptions + * @static + * @param {google.cloud.talent.v4beta1.Job.IProcessingOptions} message ProcessingOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessingOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessingOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.Job.ProcessingOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.Job.ProcessingOptions} ProcessingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessingOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.Job.ProcessingOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.disableStreetAddressResolution = reader.bool(); + break; + } + case 2: { + message.htmlSanitization = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessingOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.Job.ProcessingOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.Job.ProcessingOptions} ProcessingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessingOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessingOptions message. + * @function verify + * @memberof google.cloud.talent.v4beta1.Job.ProcessingOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessingOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.disableStreetAddressResolution != null && message.hasOwnProperty("disableStreetAddressResolution")) + if (typeof message.disableStreetAddressResolution !== "boolean") + return "disableStreetAddressResolution: boolean expected"; + if (message.htmlSanitization != null && message.hasOwnProperty("htmlSanitization")) + switch (message.htmlSanitization) { + default: + return "htmlSanitization: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ProcessingOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.Job.ProcessingOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.Job.ProcessingOptions} ProcessingOptions + */ + ProcessingOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.Job.ProcessingOptions) + return object; + var message = new $root.google.cloud.talent.v4beta1.Job.ProcessingOptions(); + if (object.disableStreetAddressResolution != null) + message.disableStreetAddressResolution = Boolean(object.disableStreetAddressResolution); + switch (object.htmlSanitization) { + default: + if (typeof object.htmlSanitization === "number") { + message.htmlSanitization = object.htmlSanitization; + break; + } + break; + case "HTML_SANITIZATION_UNSPECIFIED": + case 0: + message.htmlSanitization = 0; + break; + case "HTML_SANITIZATION_DISABLED": + case 1: + message.htmlSanitization = 1; + break; + case "SIMPLE_FORMATTING_ONLY": + case 2: + message.htmlSanitization = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ProcessingOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.Job.ProcessingOptions + * @static + * @param {google.cloud.talent.v4beta1.Job.ProcessingOptions} message ProcessingOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessingOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disableStreetAddressResolution = false; + object.htmlSanitization = options.enums === String ? "HTML_SANITIZATION_UNSPECIFIED" : 0; + } + if (message.disableStreetAddressResolution != null && message.hasOwnProperty("disableStreetAddressResolution")) + object.disableStreetAddressResolution = message.disableStreetAddressResolution; + if (message.htmlSanitization != null && message.hasOwnProperty("htmlSanitization")) + object.htmlSanitization = options.enums === String ? $root.google.cloud.talent.v4beta1.HtmlSanitization[message.htmlSanitization] === undefined ? message.htmlSanitization : $root.google.cloud.talent.v4beta1.HtmlSanitization[message.htmlSanitization] : message.htmlSanitization; + return object; + }; + + /** + * Converts this ProcessingOptions to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.Job.ProcessingOptions + * @instance + * @returns {Object.} JSON object + */ + ProcessingOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessingOptions + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.Job.ProcessingOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessingOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.Job.ProcessingOptions"; + }; + + return ProcessingOptions; + })(); + + return Job; + })(); + + v4beta1.JobService = (function() { + + /** + * Constructs a new JobService service. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a JobService + * @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 JobService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (JobService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = JobService; + + /** + * Creates new JobService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.talent.v4beta1.JobService + * @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 {JobService} RPC service. Useful where requests and/or responses are streamed. + */ + JobService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.JobService|createJob}. + * @memberof google.cloud.talent.v4beta1.JobService + * @typedef CreateJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4beta1.Job} [response] Job + */ + + /** + * Calls CreateJob. + * @function createJob + * @memberof google.cloud.talent.v4beta1.JobService + * @instance + * @param {google.cloud.talent.v4beta1.ICreateJobRequest} request CreateJobRequest message or plain object + * @param {google.cloud.talent.v4beta1.JobService.CreateJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.createJob = function createJob(request, callback) { + return this.rpcCall(createJob, $root.google.cloud.talent.v4beta1.CreateJobRequest, $root.google.cloud.talent.v4beta1.Job, request, callback); + }, "name", { value: "CreateJob" }); + + /** + * Calls CreateJob. + * @function createJob + * @memberof google.cloud.talent.v4beta1.JobService + * @instance + * @param {google.cloud.talent.v4beta1.ICreateJobRequest} request CreateJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.JobService|batchCreateJobs}. + * @memberof google.cloud.talent.v4beta1.JobService + * @typedef BatchCreateJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchCreateJobs. + * @function batchCreateJobs + * @memberof google.cloud.talent.v4beta1.JobService + * @instance + * @param {google.cloud.talent.v4beta1.IBatchCreateJobsRequest} request BatchCreateJobsRequest message or plain object + * @param {google.cloud.talent.v4beta1.JobService.BatchCreateJobsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.batchCreateJobs = function batchCreateJobs(request, callback) { + return this.rpcCall(batchCreateJobs, $root.google.cloud.talent.v4beta1.BatchCreateJobsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchCreateJobs" }); + + /** + * Calls BatchCreateJobs. + * @function batchCreateJobs + * @memberof google.cloud.talent.v4beta1.JobService + * @instance + * @param {google.cloud.talent.v4beta1.IBatchCreateJobsRequest} request BatchCreateJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.JobService|getJob}. + * @memberof google.cloud.talent.v4beta1.JobService + * @typedef GetJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4beta1.Job} [response] Job + */ + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.talent.v4beta1.JobService + * @instance + * @param {google.cloud.talent.v4beta1.IGetJobRequest} request GetJobRequest message or plain object + * @param {google.cloud.talent.v4beta1.JobService.GetJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.getJob = function getJob(request, callback) { + return this.rpcCall(getJob, $root.google.cloud.talent.v4beta1.GetJobRequest, $root.google.cloud.talent.v4beta1.Job, request, callback); + }, "name", { value: "GetJob" }); + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.talent.v4beta1.JobService + * @instance + * @param {google.cloud.talent.v4beta1.IGetJobRequest} request GetJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.JobService|updateJob}. + * @memberof google.cloud.talent.v4beta1.JobService + * @typedef UpdateJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4beta1.Job} [response] Job + */ + + /** + * Calls UpdateJob. + * @function updateJob + * @memberof google.cloud.talent.v4beta1.JobService + * @instance + * @param {google.cloud.talent.v4beta1.IUpdateJobRequest} request UpdateJobRequest message or plain object + * @param {google.cloud.talent.v4beta1.JobService.UpdateJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.updateJob = function updateJob(request, callback) { + return this.rpcCall(updateJob, $root.google.cloud.talent.v4beta1.UpdateJobRequest, $root.google.cloud.talent.v4beta1.Job, request, callback); + }, "name", { value: "UpdateJob" }); + + /** + * Calls UpdateJob. + * @function updateJob + * @memberof google.cloud.talent.v4beta1.JobService + * @instance + * @param {google.cloud.talent.v4beta1.IUpdateJobRequest} request UpdateJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.JobService|batchUpdateJobs}. + * @memberof google.cloud.talent.v4beta1.JobService + * @typedef BatchUpdateJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchUpdateJobs. + * @function batchUpdateJobs + * @memberof google.cloud.talent.v4beta1.JobService + * @instance + * @param {google.cloud.talent.v4beta1.IBatchUpdateJobsRequest} request BatchUpdateJobsRequest message or plain object + * @param {google.cloud.talent.v4beta1.JobService.BatchUpdateJobsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.batchUpdateJobs = function batchUpdateJobs(request, callback) { + return this.rpcCall(batchUpdateJobs, $root.google.cloud.talent.v4beta1.BatchUpdateJobsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchUpdateJobs" }); + + /** + * Calls BatchUpdateJobs. + * @function batchUpdateJobs + * @memberof google.cloud.talent.v4beta1.JobService + * @instance + * @param {google.cloud.talent.v4beta1.IBatchUpdateJobsRequest} request BatchUpdateJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.JobService|deleteJob}. + * @memberof google.cloud.talent.v4beta1.JobService + * @typedef DeleteJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteJob. + * @function deleteJob + * @memberof google.cloud.talent.v4beta1.JobService + * @instance + * @param {google.cloud.talent.v4beta1.IDeleteJobRequest} request DeleteJobRequest message or plain object + * @param {google.cloud.talent.v4beta1.JobService.DeleteJobCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.deleteJob = function deleteJob(request, callback) { + return this.rpcCall(deleteJob, $root.google.cloud.talent.v4beta1.DeleteJobRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteJob" }); + + /** + * Calls DeleteJob. + * @function deleteJob + * @memberof google.cloud.talent.v4beta1.JobService + * @instance + * @param {google.cloud.talent.v4beta1.IDeleteJobRequest} request DeleteJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.JobService|batchDeleteJobs}. + * @memberof google.cloud.talent.v4beta1.JobService + * @typedef BatchDeleteJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls BatchDeleteJobs. + * @function batchDeleteJobs + * @memberof google.cloud.talent.v4beta1.JobService + * @instance + * @param {google.cloud.talent.v4beta1.IBatchDeleteJobsRequest} request BatchDeleteJobsRequest message or plain object + * @param {google.cloud.talent.v4beta1.JobService.BatchDeleteJobsCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.batchDeleteJobs = function batchDeleteJobs(request, callback) { + return this.rpcCall(batchDeleteJobs, $root.google.cloud.talent.v4beta1.BatchDeleteJobsRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "BatchDeleteJobs" }); + + /** + * Calls BatchDeleteJobs. + * @function batchDeleteJobs + * @memberof google.cloud.talent.v4beta1.JobService + * @instance + * @param {google.cloud.talent.v4beta1.IBatchDeleteJobsRequest} request BatchDeleteJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.JobService|listJobs}. + * @memberof google.cloud.talent.v4beta1.JobService + * @typedef ListJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4beta1.ListJobsResponse} [response] ListJobsResponse + */ + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.talent.v4beta1.JobService + * @instance + * @param {google.cloud.talent.v4beta1.IListJobsRequest} request ListJobsRequest message or plain object + * @param {google.cloud.talent.v4beta1.JobService.ListJobsCallback} callback Node-style callback called with the error, if any, and ListJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.listJobs = function listJobs(request, callback) { + return this.rpcCall(listJobs, $root.google.cloud.talent.v4beta1.ListJobsRequest, $root.google.cloud.talent.v4beta1.ListJobsResponse, request, callback); + }, "name", { value: "ListJobs" }); + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.talent.v4beta1.JobService + * @instance + * @param {google.cloud.talent.v4beta1.IListJobsRequest} request ListJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.JobService|searchJobs}. + * @memberof google.cloud.talent.v4beta1.JobService + * @typedef SearchJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4beta1.SearchJobsResponse} [response] SearchJobsResponse + */ + + /** + * Calls SearchJobs. + * @function searchJobs + * @memberof google.cloud.talent.v4beta1.JobService + * @instance + * @param {google.cloud.talent.v4beta1.ISearchJobsRequest} request SearchJobsRequest message or plain object + * @param {google.cloud.talent.v4beta1.JobService.SearchJobsCallback} callback Node-style callback called with the error, if any, and SearchJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.searchJobs = function searchJobs(request, callback) { + return this.rpcCall(searchJobs, $root.google.cloud.talent.v4beta1.SearchJobsRequest, $root.google.cloud.talent.v4beta1.SearchJobsResponse, request, callback); + }, "name", { value: "SearchJobs" }); + + /** + * Calls SearchJobs. + * @function searchJobs + * @memberof google.cloud.talent.v4beta1.JobService + * @instance + * @param {google.cloud.talent.v4beta1.ISearchJobsRequest} request SearchJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.JobService|searchJobsForAlert}. + * @memberof google.cloud.talent.v4beta1.JobService + * @typedef SearchJobsForAlertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4beta1.SearchJobsResponse} [response] SearchJobsResponse + */ + + /** + * Calls SearchJobsForAlert. + * @function searchJobsForAlert + * @memberof google.cloud.talent.v4beta1.JobService + * @instance + * @param {google.cloud.talent.v4beta1.ISearchJobsRequest} request SearchJobsRequest message or plain object + * @param {google.cloud.talent.v4beta1.JobService.SearchJobsForAlertCallback} callback Node-style callback called with the error, if any, and SearchJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.searchJobsForAlert = function searchJobsForAlert(request, callback) { + return this.rpcCall(searchJobsForAlert, $root.google.cloud.talent.v4beta1.SearchJobsRequest, $root.google.cloud.talent.v4beta1.SearchJobsResponse, request, callback); + }, "name", { value: "SearchJobsForAlert" }); + + /** + * Calls SearchJobsForAlert. + * @function searchJobsForAlert + * @memberof google.cloud.talent.v4beta1.JobService + * @instance + * @param {google.cloud.talent.v4beta1.ISearchJobsRequest} request SearchJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return JobService; + })(); + + v4beta1.CreateJobRequest = (function() { + + /** + * Properties of a CreateJobRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface ICreateJobRequest + * @property {string|null} [parent] CreateJobRequest parent + * @property {google.cloud.talent.v4beta1.IJob|null} [job] CreateJobRequest job + */ + + /** + * Constructs a new CreateJobRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a CreateJobRequest. + * @implements ICreateJobRequest + * @constructor + * @param {google.cloud.talent.v4beta1.ICreateJobRequest=} [properties] Properties to set + */ + function CreateJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateJobRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4beta1.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.parent = ""; + + /** + * CreateJobRequest job. + * @member {google.cloud.talent.v4beta1.IJob|null|undefined} job + * @memberof google.cloud.talent.v4beta1.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.job = null; + + /** + * Creates a new CreateJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.CreateJobRequest + * @static + * @param {google.cloud.talent.v4beta1.ICreateJobRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.CreateJobRequest} CreateJobRequest instance + */ + CreateJobRequest.create = function create(properties) { + return new CreateJobRequest(properties); + }; + + /** + * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.CreateJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.CreateJobRequest + * @static + * @param {google.cloud.talent.v4beta1.ICreateJobRequest} message CreateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.talent.v4beta1.Job.encode(message.job, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CreateJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.CreateJobRequest + * @static + * @param {google.cloud.talent.v4beta1.ICreateJobRequest} message CreateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.CreateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.CreateJobRequest} CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.CreateJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.job = $root.google.cloud.talent.v4beta1.Job.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.CreateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.CreateJobRequest} CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateJobRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.CreateJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.cloud.talent.v4beta1.Job.verify(message.job); + if (error) + return "job." + error; + } + return null; + }; + + /** + * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.CreateJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.CreateJobRequest} CreateJobRequest + */ + CreateJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.CreateJobRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.CreateJobRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.talent.v4beta1.CreateJobRequest.job: object expected"); + message.job = $root.google.cloud.talent.v4beta1.Job.fromObject(object.job); + } + return message; + }; + + /** + * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.CreateJobRequest + * @static + * @param {google.cloud.talent.v4beta1.CreateJobRequest} message CreateJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.job = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.talent.v4beta1.Job.toObject(message.job, options); + return object; + }; + + /** + * Converts this CreateJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.CreateJobRequest + * @instance + * @returns {Object.} JSON object + */ + CreateJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateJobRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.CreateJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.CreateJobRequest"; + }; + + return CreateJobRequest; + })(); + + v4beta1.GetJobRequest = (function() { + + /** + * Properties of a GetJobRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface IGetJobRequest + * @property {string|null} [name] GetJobRequest name + */ + + /** + * Constructs a new GetJobRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a GetJobRequest. + * @implements IGetJobRequest + * @constructor + * @param {google.cloud.talent.v4beta1.IGetJobRequest=} [properties] Properties to set + */ + function GetJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetJobRequest name. + * @member {string} name + * @memberof google.cloud.talent.v4beta1.GetJobRequest + * @instance + */ + GetJobRequest.prototype.name = ""; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.GetJobRequest + * @static + * @param {google.cloud.talent.v4beta1.IGetJobRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.GetJobRequest} GetJobRequest instance + */ + GetJobRequest.create = function create(properties) { + return new GetJobRequest(properties); + }; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.GetJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.GetJobRequest + * @static + * @param {google.cloud.talent.v4beta1.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.GetJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.GetJobRequest + * @static + * @param {google.cloud.talent.v4beta1.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.GetJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetJobRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.GetJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.GetJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.GetJobRequest} GetJobRequest + */ + GetJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.GetJobRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.GetJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.GetJobRequest + * @static + * @param {google.cloud.talent.v4beta1.GetJobRequest} message GetJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.GetJobRequest + * @instance + * @returns {Object.} JSON object + */ + GetJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetJobRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.GetJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.GetJobRequest"; + }; + + return GetJobRequest; + })(); + + v4beta1.UpdateJobRequest = (function() { + + /** + * Properties of an UpdateJobRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface IUpdateJobRequest + * @property {google.cloud.talent.v4beta1.IJob|null} [job] UpdateJobRequest job + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateJobRequest updateMask + */ + + /** + * Constructs a new UpdateJobRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents an UpdateJobRequest. + * @implements IUpdateJobRequest + * @constructor + * @param {google.cloud.talent.v4beta1.IUpdateJobRequest=} [properties] Properties to set + */ + function UpdateJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateJobRequest job. + * @member {google.cloud.talent.v4beta1.IJob|null|undefined} job + * @memberof google.cloud.talent.v4beta1.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.job = null; + + /** + * UpdateJobRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.talent.v4beta1.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.UpdateJobRequest + * @static + * @param {google.cloud.talent.v4beta1.IUpdateJobRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.UpdateJobRequest} UpdateJobRequest instance + */ + UpdateJobRequest.create = function create(properties) { + return new UpdateJobRequest(properties); + }; + + /** + * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.UpdateJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.UpdateJobRequest + * @static + * @param {google.cloud.talent.v4beta1.IUpdateJobRequest} message UpdateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.talent.v4beta1.Job.encode(message.job, 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 UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.UpdateJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.UpdateJobRequest + * @static + * @param {google.cloud.talent.v4beta1.IUpdateJobRequest} message UpdateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.UpdateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.UpdateJobRequest} UpdateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.UpdateJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.job = $root.google.cloud.talent.v4beta1.Job.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 UpdateJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.UpdateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.UpdateJobRequest} UpdateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateJobRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.UpdateJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.cloud.talent.v4beta1.Job.verify(message.job); + if (error) + return "job." + 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 UpdateJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.UpdateJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.UpdateJobRequest} UpdateJobRequest + */ + UpdateJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.UpdateJobRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.UpdateJobRequest(); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.talent.v4beta1.UpdateJobRequest.job: object expected"); + message.job = $root.google.cloud.talent.v4beta1.Job.fromObject(object.job); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.talent.v4beta1.UpdateJobRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.UpdateJobRequest + * @static + * @param {google.cloud.talent.v4beta1.UpdateJobRequest} message UpdateJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.job = null; + object.updateMask = null; + } + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.talent.v4beta1.Job.toObject(message.job, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.UpdateJobRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateJobRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.UpdateJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.UpdateJobRequest"; + }; + + return UpdateJobRequest; + })(); + + v4beta1.DeleteJobRequest = (function() { + + /** + * Properties of a DeleteJobRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface IDeleteJobRequest + * @property {string|null} [name] DeleteJobRequest name + */ + + /** + * Constructs a new DeleteJobRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a DeleteJobRequest. + * @implements IDeleteJobRequest + * @constructor + * @param {google.cloud.talent.v4beta1.IDeleteJobRequest=} [properties] Properties to set + */ + function DeleteJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteJobRequest name. + * @member {string} name + * @memberof google.cloud.talent.v4beta1.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.name = ""; + + /** + * Creates a new DeleteJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.DeleteJobRequest + * @static + * @param {google.cloud.talent.v4beta1.IDeleteJobRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.DeleteJobRequest} DeleteJobRequest instance + */ + DeleteJobRequest.create = function create(properties) { + return new DeleteJobRequest(properties); + }; + + /** + * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.DeleteJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.DeleteJobRequest + * @static + * @param {google.cloud.talent.v4beta1.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.DeleteJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.DeleteJobRequest + * @static + * @param {google.cloud.talent.v4beta1.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.DeleteJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.DeleteJobRequest} DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.DeleteJobRequest(); + 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 DeleteJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.DeleteJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.DeleteJobRequest} DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteJobRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.DeleteJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.DeleteJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.DeleteJobRequest} DeleteJobRequest + */ + DeleteJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.DeleteJobRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.DeleteJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.DeleteJobRequest + * @static + * @param {google.cloud.talent.v4beta1.DeleteJobRequest} message DeleteJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.DeleteJobRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteJobRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.DeleteJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.DeleteJobRequest"; + }; + + return DeleteJobRequest; + })(); + + v4beta1.BatchDeleteJobsRequest = (function() { + + /** + * Properties of a BatchDeleteJobsRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface IBatchDeleteJobsRequest + * @property {string|null} [parent] BatchDeleteJobsRequest parent + * @property {string|null} [filter] BatchDeleteJobsRequest filter + */ + + /** + * Constructs a new BatchDeleteJobsRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a BatchDeleteJobsRequest. + * @implements IBatchDeleteJobsRequest + * @constructor + * @param {google.cloud.talent.v4beta1.IBatchDeleteJobsRequest=} [properties] Properties to set + */ + function BatchDeleteJobsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDeleteJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4beta1.BatchDeleteJobsRequest + * @instance + */ + BatchDeleteJobsRequest.prototype.parent = ""; + + /** + * BatchDeleteJobsRequest filter. + * @member {string} filter + * @memberof google.cloud.talent.v4beta1.BatchDeleteJobsRequest + * @instance + */ + BatchDeleteJobsRequest.prototype.filter = ""; + + /** + * Creates a new BatchDeleteJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.BatchDeleteJobsRequest + * @static + * @param {google.cloud.talent.v4beta1.IBatchDeleteJobsRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.BatchDeleteJobsRequest} BatchDeleteJobsRequest instance + */ + BatchDeleteJobsRequest.create = function create(properties) { + return new BatchDeleteJobsRequest(properties); + }; + + /** + * Encodes the specified BatchDeleteJobsRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.BatchDeleteJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.BatchDeleteJobsRequest + * @static + * @param {google.cloud.talent.v4beta1.IBatchDeleteJobsRequest} message BatchDeleteJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteJobsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + return writer; + }; + + /** + * Encodes the specified BatchDeleteJobsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.BatchDeleteJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.BatchDeleteJobsRequest + * @static + * @param {google.cloud.talent.v4beta1.IBatchDeleteJobsRequest} message BatchDeleteJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDeleteJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.BatchDeleteJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.BatchDeleteJobsRequest} BatchDeleteJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.BatchDeleteJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDeleteJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.BatchDeleteJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.BatchDeleteJobsRequest} BatchDeleteJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDeleteJobsRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.BatchDeleteJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteJobsRequest.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"; + return null; + }; + + /** + * Creates a BatchDeleteJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.BatchDeleteJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.BatchDeleteJobsRequest} BatchDeleteJobsRequest + */ + BatchDeleteJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.BatchDeleteJobsRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.BatchDeleteJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a BatchDeleteJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.BatchDeleteJobsRequest + * @static + * @param {google.cloud.talent.v4beta1.BatchDeleteJobsRequest} message BatchDeleteJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this BatchDeleteJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.BatchDeleteJobsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDeleteJobsRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.BatchDeleteJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDeleteJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.BatchDeleteJobsRequest"; + }; + + return BatchDeleteJobsRequest; + })(); + + /** + * JobView enum. + * @name google.cloud.talent.v4beta1.JobView + * @enum {number} + * @property {number} JOB_VIEW_UNSPECIFIED=0 JOB_VIEW_UNSPECIFIED value + * @property {number} JOB_VIEW_ID_ONLY=1 JOB_VIEW_ID_ONLY value + * @property {number} JOB_VIEW_MINIMAL=2 JOB_VIEW_MINIMAL value + * @property {number} JOB_VIEW_SMALL=3 JOB_VIEW_SMALL value + * @property {number} JOB_VIEW_FULL=4 JOB_VIEW_FULL value + */ + v4beta1.JobView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "JOB_VIEW_ID_ONLY"] = 1; + values[valuesById[2] = "JOB_VIEW_MINIMAL"] = 2; + values[valuesById[3] = "JOB_VIEW_SMALL"] = 3; + values[valuesById[4] = "JOB_VIEW_FULL"] = 4; + return values; + })(); + + v4beta1.ListJobsRequest = (function() { + + /** + * Properties of a ListJobsRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface IListJobsRequest + * @property {string|null} [parent] ListJobsRequest parent + * @property {string|null} [filter] ListJobsRequest filter + * @property {string|null} [pageToken] ListJobsRequest pageToken + * @property {number|null} [pageSize] ListJobsRequest pageSize + * @property {google.cloud.talent.v4beta1.JobView|null} [jobView] ListJobsRequest jobView + */ + + /** + * Constructs a new ListJobsRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a ListJobsRequest. + * @implements IListJobsRequest + * @constructor + * @param {google.cloud.talent.v4beta1.IListJobsRequest=} [properties] Properties to set + */ + function ListJobsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4beta1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.parent = ""; + + /** + * ListJobsRequest filter. + * @member {string} filter + * @memberof google.cloud.talent.v4beta1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.filter = ""; + + /** + * ListJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.talent.v4beta1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageToken = ""; + + /** + * ListJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.talent.v4beta1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageSize = 0; + + /** + * ListJobsRequest jobView. + * @member {google.cloud.talent.v4beta1.JobView} jobView + * @memberof google.cloud.talent.v4beta1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.jobView = 0; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.ListJobsRequest + * @static + * @param {google.cloud.talent.v4beta1.IListJobsRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.ListJobsRequest} ListJobsRequest instance + */ + ListJobsRequest.create = function create(properties) { + return new ListJobsRequest(properties); + }; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.ListJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.ListJobsRequest + * @static + * @param {google.cloud.talent.v4beta1.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.jobView != null && Object.hasOwnProperty.call(message, "jobView")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.jobView); + return writer; + }; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.ListJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.ListJobsRequest + * @static + * @param {google.cloud.talent.v4beta1.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.ListJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.jobView = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.ListJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.jobView != null && message.hasOwnProperty("jobView")) + switch (message.jobView) { + default: + return "jobView: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.ListJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.ListJobsRequest} ListJobsRequest + */ + ListJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.ListJobsRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.ListJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + switch (object.jobView) { + default: + if (typeof object.jobView === "number") { + message.jobView = object.jobView; + break; + } + break; + case "JOB_VIEW_UNSPECIFIED": + case 0: + message.jobView = 0; + break; + case "JOB_VIEW_ID_ONLY": + case 1: + message.jobView = 1; + break; + case "JOB_VIEW_MINIMAL": + case 2: + message.jobView = 2; + break; + case "JOB_VIEW_SMALL": + case 3: + message.jobView = 3; + break; + case "JOB_VIEW_FULL": + case 4: + message.jobView = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.ListJobsRequest + * @static + * @param {google.cloud.talent.v4beta1.ListJobsRequest} message ListJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageToken = ""; + object.pageSize = 0; + object.jobView = options.enums === String ? "JOB_VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.jobView != null && message.hasOwnProperty("jobView")) + object.jobView = options.enums === String ? $root.google.cloud.talent.v4beta1.JobView[message.jobView] === undefined ? message.jobView : $root.google.cloud.talent.v4beta1.JobView[message.jobView] : message.jobView; + return object; + }; + + /** + * Converts this ListJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.ListJobsRequest + * @instance + * @returns {Object.} JSON object + */ + ListJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.ListJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.ListJobsRequest"; + }; + + return ListJobsRequest; + })(); + + v4beta1.ListJobsResponse = (function() { + + /** + * Properties of a ListJobsResponse. + * @memberof google.cloud.talent.v4beta1 + * @interface IListJobsResponse + * @property {Array.|null} [jobs] ListJobsResponse jobs + * @property {string|null} [nextPageToken] ListJobsResponse nextPageToken + * @property {google.cloud.talent.v4beta1.IResponseMetadata|null} [metadata] ListJobsResponse metadata + */ + + /** + * Constructs a new ListJobsResponse. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a ListJobsResponse. + * @implements IListJobsResponse + * @constructor + * @param {google.cloud.talent.v4beta1.IListJobsResponse=} [properties] Properties to set + */ + function ListJobsResponse(properties) { + this.jobs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobsResponse jobs. + * @member {Array.} jobs + * @memberof google.cloud.talent.v4beta1.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.jobs = $util.emptyArray; + + /** + * ListJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.talent.v4beta1.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.nextPageToken = ""; + + /** + * ListJobsResponse metadata. + * @member {google.cloud.talent.v4beta1.IResponseMetadata|null|undefined} metadata + * @memberof google.cloud.talent.v4beta1.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.metadata = null; + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.ListJobsResponse + * @static + * @param {google.cloud.talent.v4beta1.IListJobsResponse=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.ListJobsResponse} ListJobsResponse instance + */ + ListJobsResponse.create = function create(properties) { + return new ListJobsResponse(properties); + }; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.talent.v4beta1.ListJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.ListJobsResponse + * @static + * @param {google.cloud.talent.v4beta1.IListJobsResponse} message ListJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + $root.google.cloud.talent.v4beta1.Job.encode(message.jobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.talent.v4beta1.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.ListJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.ListJobsResponse + * @static + * @param {google.cloud.talent.v4beta1.IListJobsResponse} message ListJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.ListJobsResponse} ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.ListJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push($root.google.cloud.talent.v4beta1.Job.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.metadata = $root.google.cloud.talent.v4beta1.ResponseMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.ListJobsResponse} ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsResponse message. + * @function verify + * @memberof google.cloud.talent.v4beta1.ListJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobs != null && message.hasOwnProperty("jobs")) { + if (!Array.isArray(message.jobs)) + return "jobs: array expected"; + for (var i = 0; i < message.jobs.length; ++i) { + var error = $root.google.cloud.talent.v4beta1.Job.verify(message.jobs[i]); + if (error) + return "jobs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.talent.v4beta1.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.ListJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.ListJobsResponse} ListJobsResponse + */ + ListJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.ListJobsResponse) + return object; + var message = new $root.google.cloud.talent.v4beta1.ListJobsResponse(); + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.talent.v4beta1.ListJobsResponse.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) { + if (typeof object.jobs[i] !== "object") + throw TypeError(".google.cloud.talent.v4beta1.ListJobsResponse.jobs: object expected"); + message.jobs[i] = $root.google.cloud.talent.v4beta1.Job.fromObject(object.jobs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.talent.v4beta1.ListJobsResponse.metadata: object expected"); + message.metadata = $root.google.cloud.talent.v4beta1.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.ListJobsResponse + * @static + * @param {google.cloud.talent.v4beta1.ListJobsResponse} message ListJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jobs = []; + if (options.defaults) { + object.nextPageToken = ""; + object.metadata = null; + } + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = $root.google.cloud.talent.v4beta1.Job.toObject(message.jobs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.talent.v4beta1.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this ListJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.ListJobsResponse + * @instance + * @returns {Object.} JSON object + */ + ListJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsResponse + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.ListJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.ListJobsResponse"; + }; + + return ListJobsResponse; + })(); + + v4beta1.SearchJobsRequest = (function() { + + /** + * Properties of a SearchJobsRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface ISearchJobsRequest + * @property {string|null} [parent] SearchJobsRequest parent + * @property {google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode|null} [searchMode] SearchJobsRequest searchMode + * @property {google.cloud.talent.v4beta1.IRequestMetadata|null} [requestMetadata] SearchJobsRequest requestMetadata + * @property {google.cloud.talent.v4beta1.IJobQuery|null} [jobQuery] SearchJobsRequest jobQuery + * @property {boolean|null} [enableBroadening] SearchJobsRequest enableBroadening + * @property {boolean|null} [requirePreciseResultSize] SearchJobsRequest requirePreciseResultSize + * @property {Array.|null} [histogramQueries] SearchJobsRequest histogramQueries + * @property {google.cloud.talent.v4beta1.JobView|null} [jobView] SearchJobsRequest jobView + * @property {number|null} [offset] SearchJobsRequest offset + * @property {number|null} [pageSize] SearchJobsRequest pageSize + * @property {string|null} [pageToken] SearchJobsRequest pageToken + * @property {string|null} [orderBy] SearchJobsRequest orderBy + * @property {google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel|null} [diversificationLevel] SearchJobsRequest diversificationLevel + * @property {google.cloud.talent.v4beta1.SearchJobsRequest.ICustomRankingInfo|null} [customRankingInfo] SearchJobsRequest customRankingInfo + * @property {boolean|null} [disableKeywordMatch] SearchJobsRequest disableKeywordMatch + * @property {google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode|null} [keywordMatchMode] SearchJobsRequest keywordMatchMode + */ + + /** + * Constructs a new SearchJobsRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a SearchJobsRequest. + * @implements ISearchJobsRequest + * @constructor + * @param {google.cloud.talent.v4beta1.ISearchJobsRequest=} [properties] Properties to set + */ + function SearchJobsRequest(properties) { + this.histogramQueries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.parent = ""; + + /** + * SearchJobsRequest searchMode. + * @member {google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode} searchMode + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.searchMode = 0; + + /** + * SearchJobsRequest requestMetadata. + * @member {google.cloud.talent.v4beta1.IRequestMetadata|null|undefined} requestMetadata + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.requestMetadata = null; + + /** + * SearchJobsRequest jobQuery. + * @member {google.cloud.talent.v4beta1.IJobQuery|null|undefined} jobQuery + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.jobQuery = null; + + /** + * SearchJobsRequest enableBroadening. + * @member {boolean} enableBroadening + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.enableBroadening = false; + + /** + * SearchJobsRequest requirePreciseResultSize. + * @member {boolean} requirePreciseResultSize + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.requirePreciseResultSize = false; + + /** + * SearchJobsRequest histogramQueries. + * @member {Array.} histogramQueries + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.histogramQueries = $util.emptyArray; + + /** + * SearchJobsRequest jobView. + * @member {google.cloud.talent.v4beta1.JobView} jobView + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.jobView = 0; + + /** + * SearchJobsRequest offset. + * @member {number} offset + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.offset = 0; + + /** + * SearchJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.pageSize = 0; + + /** + * SearchJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.pageToken = ""; + + /** + * SearchJobsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.orderBy = ""; + + /** + * SearchJobsRequest diversificationLevel. + * @member {google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel} diversificationLevel + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.diversificationLevel = 0; + + /** + * SearchJobsRequest customRankingInfo. + * @member {google.cloud.talent.v4beta1.SearchJobsRequest.ICustomRankingInfo|null|undefined} customRankingInfo + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.customRankingInfo = null; + + /** + * SearchJobsRequest disableKeywordMatch. + * @member {boolean} disableKeywordMatch + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.disableKeywordMatch = false; + + /** + * SearchJobsRequest keywordMatchMode. + * @member {google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode} keywordMatchMode + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @instance + */ + SearchJobsRequest.prototype.keywordMatchMode = 0; + + /** + * Creates a new SearchJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @static + * @param {google.cloud.talent.v4beta1.ISearchJobsRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.SearchJobsRequest} SearchJobsRequest instance + */ + SearchJobsRequest.create = function create(properties) { + return new SearchJobsRequest(properties); + }; + + /** + * Encodes the specified SearchJobsRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.SearchJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @static + * @param {google.cloud.talent.v4beta1.ISearchJobsRequest} message SearchJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchJobsRequest.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.searchMode != null && Object.hasOwnProperty.call(message, "searchMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.searchMode); + if (message.requestMetadata != null && Object.hasOwnProperty.call(message, "requestMetadata")) + $root.google.cloud.talent.v4beta1.RequestMetadata.encode(message.requestMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.jobQuery != null && Object.hasOwnProperty.call(message, "jobQuery")) + $root.google.cloud.talent.v4beta1.JobQuery.encode(message.jobQuery, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enableBroadening != null && Object.hasOwnProperty.call(message, "enableBroadening")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enableBroadening); + if (message.requirePreciseResultSize != null && Object.hasOwnProperty.call(message, "requirePreciseResultSize")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requirePreciseResultSize); + if (message.histogramQueries != null && message.histogramQueries.length) + for (var i = 0; i < message.histogramQueries.length; ++i) + $root.google.cloud.talent.v4beta1.HistogramQuery.encode(message.histogramQueries[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.jobView != null && Object.hasOwnProperty.call(message, "jobView")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.jobView); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.offset); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.pageToken); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.orderBy); + if (message.diversificationLevel != null && Object.hasOwnProperty.call(message, "diversificationLevel")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.diversificationLevel); + if (message.customRankingInfo != null && Object.hasOwnProperty.call(message, "customRankingInfo")) + $root.google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.encode(message.customRankingInfo, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.disableKeywordMatch != null && Object.hasOwnProperty.call(message, "disableKeywordMatch")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.disableKeywordMatch); + if (message.keywordMatchMode != null && Object.hasOwnProperty.call(message, "keywordMatchMode")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.keywordMatchMode); + return writer; + }; + + /** + * Encodes the specified SearchJobsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.SearchJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @static + * @param {google.cloud.talent.v4beta1.ISearchJobsRequest} message SearchJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.SearchJobsRequest} SearchJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.SearchJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.searchMode = reader.int32(); + break; + } + case 3: { + message.requestMetadata = $root.google.cloud.talent.v4beta1.RequestMetadata.decode(reader, reader.uint32()); + break; + } + case 4: { + message.jobQuery = $root.google.cloud.talent.v4beta1.JobQuery.decode(reader, reader.uint32()); + break; + } + case 5: { + message.enableBroadening = reader.bool(); + break; + } + case 6: { + message.requirePreciseResultSize = reader.bool(); + break; + } + case 7: { + if (!(message.histogramQueries && message.histogramQueries.length)) + message.histogramQueries = []; + message.histogramQueries.push($root.google.cloud.talent.v4beta1.HistogramQuery.decode(reader, reader.uint32())); + break; + } + case 8: { + message.jobView = reader.int32(); + break; + } + case 9: { + message.offset = reader.int32(); + break; + } + case 10: { + message.pageSize = reader.int32(); + break; + } + case 11: { + message.pageToken = reader.string(); + break; + } + case 12: { + message.orderBy = reader.string(); + break; + } + case 13: { + message.diversificationLevel = reader.int32(); + break; + } + case 14: { + message.customRankingInfo = $root.google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.decode(reader, reader.uint32()); + break; + } + case 16: { + message.disableKeywordMatch = reader.bool(); + break; + } + case 18: { + message.keywordMatchMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.SearchJobsRequest} SearchJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchJobsRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchJobsRequest.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.searchMode != null && message.hasOwnProperty("searchMode")) + switch (message.searchMode) { + default: + return "searchMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) { + var error = $root.google.cloud.talent.v4beta1.RequestMetadata.verify(message.requestMetadata); + if (error) + return "requestMetadata." + error; + } + if (message.jobQuery != null && message.hasOwnProperty("jobQuery")) { + var error = $root.google.cloud.talent.v4beta1.JobQuery.verify(message.jobQuery); + if (error) + return "jobQuery." + error; + } + if (message.enableBroadening != null && message.hasOwnProperty("enableBroadening")) + if (typeof message.enableBroadening !== "boolean") + return "enableBroadening: boolean expected"; + if (message.requirePreciseResultSize != null && message.hasOwnProperty("requirePreciseResultSize")) + if (typeof message.requirePreciseResultSize !== "boolean") + return "requirePreciseResultSize: boolean expected"; + if (message.histogramQueries != null && message.hasOwnProperty("histogramQueries")) { + if (!Array.isArray(message.histogramQueries)) + return "histogramQueries: array expected"; + for (var i = 0; i < message.histogramQueries.length; ++i) { + var error = $root.google.cloud.talent.v4beta1.HistogramQuery.verify(message.histogramQueries[i]); + if (error) + return "histogramQueries." + error; + } + } + if (message.jobView != null && message.hasOwnProperty("jobView")) + switch (message.jobView) { + default: + return "jobView: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset)) + return "offset: integer expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.diversificationLevel != null && message.hasOwnProperty("diversificationLevel")) + switch (message.diversificationLevel) { + default: + return "diversificationLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.customRankingInfo != null && message.hasOwnProperty("customRankingInfo")) { + var error = $root.google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.verify(message.customRankingInfo); + if (error) + return "customRankingInfo." + error; + } + if (message.disableKeywordMatch != null && message.hasOwnProperty("disableKeywordMatch")) + if (typeof message.disableKeywordMatch !== "boolean") + return "disableKeywordMatch: boolean expected"; + if (message.keywordMatchMode != null && message.hasOwnProperty("keywordMatchMode")) + switch (message.keywordMatchMode) { + default: + return "keywordMatchMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a SearchJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.SearchJobsRequest} SearchJobsRequest + */ + SearchJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.SearchJobsRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.SearchJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.searchMode) { + default: + if (typeof object.searchMode === "number") { + message.searchMode = object.searchMode; + break; + } + break; + case "SEARCH_MODE_UNSPECIFIED": + case 0: + message.searchMode = 0; + break; + case "JOB_SEARCH": + case 1: + message.searchMode = 1; + break; + case "FEATURED_JOB_SEARCH": + case 2: + message.searchMode = 2; + break; + } + if (object.requestMetadata != null) { + if (typeof object.requestMetadata !== "object") + throw TypeError(".google.cloud.talent.v4beta1.SearchJobsRequest.requestMetadata: object expected"); + message.requestMetadata = $root.google.cloud.talent.v4beta1.RequestMetadata.fromObject(object.requestMetadata); + } + if (object.jobQuery != null) { + if (typeof object.jobQuery !== "object") + throw TypeError(".google.cloud.talent.v4beta1.SearchJobsRequest.jobQuery: object expected"); + message.jobQuery = $root.google.cloud.talent.v4beta1.JobQuery.fromObject(object.jobQuery); + } + if (object.enableBroadening != null) + message.enableBroadening = Boolean(object.enableBroadening); + if (object.requirePreciseResultSize != null) + message.requirePreciseResultSize = Boolean(object.requirePreciseResultSize); + if (object.histogramQueries) { + if (!Array.isArray(object.histogramQueries)) + throw TypeError(".google.cloud.talent.v4beta1.SearchJobsRequest.histogramQueries: array expected"); + message.histogramQueries = []; + for (var i = 0; i < object.histogramQueries.length; ++i) { + if (typeof object.histogramQueries[i] !== "object") + throw TypeError(".google.cloud.talent.v4beta1.SearchJobsRequest.histogramQueries: object expected"); + message.histogramQueries[i] = $root.google.cloud.talent.v4beta1.HistogramQuery.fromObject(object.histogramQueries[i]); + } + } + switch (object.jobView) { + default: + if (typeof object.jobView === "number") { + message.jobView = object.jobView; + break; + } + break; + case "JOB_VIEW_UNSPECIFIED": + case 0: + message.jobView = 0; + break; + case "JOB_VIEW_ID_ONLY": + case 1: + message.jobView = 1; + break; + case "JOB_VIEW_MINIMAL": + case 2: + message.jobView = 2; + break; + case "JOB_VIEW_SMALL": + case 3: + message.jobView = 3; + break; + case "JOB_VIEW_FULL": + case 4: + message.jobView = 4; + break; + } + if (object.offset != null) + message.offset = object.offset | 0; + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + switch (object.diversificationLevel) { + default: + if (typeof object.diversificationLevel === "number") { + message.diversificationLevel = object.diversificationLevel; + break; + } + break; + case "DIVERSIFICATION_LEVEL_UNSPECIFIED": + case 0: + message.diversificationLevel = 0; + break; + case "DISABLED": + case 1: + message.diversificationLevel = 1; + break; + case "SIMPLE": + case 2: + message.diversificationLevel = 2; + break; + } + if (object.customRankingInfo != null) { + if (typeof object.customRankingInfo !== "object") + throw TypeError(".google.cloud.talent.v4beta1.SearchJobsRequest.customRankingInfo: object expected"); + message.customRankingInfo = $root.google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.fromObject(object.customRankingInfo); + } + if (object.disableKeywordMatch != null) + message.disableKeywordMatch = Boolean(object.disableKeywordMatch); + switch (object.keywordMatchMode) { + default: + if (typeof object.keywordMatchMode === "number") { + message.keywordMatchMode = object.keywordMatchMode; + break; + } + break; + case "KEYWORD_MATCH_MODE_UNSPECIFIED": + case 0: + message.keywordMatchMode = 0; + break; + case "KEYWORD_MATCH_DISABLED": + case 1: + message.keywordMatchMode = 1; + break; + case "KEYWORD_MATCH_ALL": + case 2: + message.keywordMatchMode = 2; + break; + case "KEYWORD_MATCH_TITLE_ONLY": + case 3: + message.keywordMatchMode = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a SearchJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @static + * @param {google.cloud.talent.v4beta1.SearchJobsRequest} message SearchJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.histogramQueries = []; + if (options.defaults) { + object.parent = ""; + object.searchMode = options.enums === String ? "SEARCH_MODE_UNSPECIFIED" : 0; + object.requestMetadata = null; + object.jobQuery = null; + object.enableBroadening = false; + object.requirePreciseResultSize = false; + object.jobView = options.enums === String ? "JOB_VIEW_UNSPECIFIED" : 0; + object.offset = 0; + object.pageSize = 0; + object.pageToken = ""; + object.orderBy = ""; + object.diversificationLevel = options.enums === String ? "DIVERSIFICATION_LEVEL_UNSPECIFIED" : 0; + object.customRankingInfo = null; + object.disableKeywordMatch = false; + object.keywordMatchMode = options.enums === String ? "KEYWORD_MATCH_MODE_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.searchMode != null && message.hasOwnProperty("searchMode")) + object.searchMode = options.enums === String ? $root.google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode[message.searchMode] === undefined ? message.searchMode : $root.google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode[message.searchMode] : message.searchMode; + if (message.requestMetadata != null && message.hasOwnProperty("requestMetadata")) + object.requestMetadata = $root.google.cloud.talent.v4beta1.RequestMetadata.toObject(message.requestMetadata, options); + if (message.jobQuery != null && message.hasOwnProperty("jobQuery")) + object.jobQuery = $root.google.cloud.talent.v4beta1.JobQuery.toObject(message.jobQuery, options); + if (message.enableBroadening != null && message.hasOwnProperty("enableBroadening")) + object.enableBroadening = message.enableBroadening; + if (message.requirePreciseResultSize != null && message.hasOwnProperty("requirePreciseResultSize")) + object.requirePreciseResultSize = message.requirePreciseResultSize; + if (message.histogramQueries && message.histogramQueries.length) { + object.histogramQueries = []; + for (var j = 0; j < message.histogramQueries.length; ++j) + object.histogramQueries[j] = $root.google.cloud.talent.v4beta1.HistogramQuery.toObject(message.histogramQueries[j], options); + } + if (message.jobView != null && message.hasOwnProperty("jobView")) + object.jobView = options.enums === String ? $root.google.cloud.talent.v4beta1.JobView[message.jobView] === undefined ? message.jobView : $root.google.cloud.talent.v4beta1.JobView[message.jobView] : message.jobView; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = message.offset; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.diversificationLevel != null && message.hasOwnProperty("diversificationLevel")) + object.diversificationLevel = options.enums === String ? $root.google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel[message.diversificationLevel] === undefined ? message.diversificationLevel : $root.google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel[message.diversificationLevel] : message.diversificationLevel; + if (message.customRankingInfo != null && message.hasOwnProperty("customRankingInfo")) + object.customRankingInfo = $root.google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.toObject(message.customRankingInfo, options); + if (message.disableKeywordMatch != null && message.hasOwnProperty("disableKeywordMatch")) + object.disableKeywordMatch = message.disableKeywordMatch; + if (message.keywordMatchMode != null && message.hasOwnProperty("keywordMatchMode")) + object.keywordMatchMode = options.enums === String ? $root.google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode[message.keywordMatchMode] === undefined ? message.keywordMatchMode : $root.google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode[message.keywordMatchMode] : message.keywordMatchMode; + return object; + }; + + /** + * Converts this SearchJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @instance + * @returns {Object.} JSON object + */ + SearchJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchJobsRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.SearchJobsRequest"; + }; + + /** + * SearchMode enum. + * @name google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode + * @enum {number} + * @property {number} SEARCH_MODE_UNSPECIFIED=0 SEARCH_MODE_UNSPECIFIED value + * @property {number} JOB_SEARCH=1 JOB_SEARCH value + * @property {number} FEATURED_JOB_SEARCH=2 FEATURED_JOB_SEARCH value + */ + SearchJobsRequest.SearchMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEARCH_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "JOB_SEARCH"] = 1; + values[valuesById[2] = "FEATURED_JOB_SEARCH"] = 2; + return values; + })(); + + /** + * DiversificationLevel enum. + * @name google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel + * @enum {number} + * @property {number} DIVERSIFICATION_LEVEL_UNSPECIFIED=0 DIVERSIFICATION_LEVEL_UNSPECIFIED value + * @property {number} DISABLED=1 DISABLED value + * @property {number} SIMPLE=2 SIMPLE value + */ + SearchJobsRequest.DiversificationLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DIVERSIFICATION_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISABLED"] = 1; + values[valuesById[2] = "SIMPLE"] = 2; + return values; + })(); + + /** + * KeywordMatchMode enum. + * @name google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode + * @enum {number} + * @property {number} KEYWORD_MATCH_MODE_UNSPECIFIED=0 KEYWORD_MATCH_MODE_UNSPECIFIED value + * @property {number} KEYWORD_MATCH_DISABLED=1 KEYWORD_MATCH_DISABLED value + * @property {number} KEYWORD_MATCH_ALL=2 KEYWORD_MATCH_ALL value + * @property {number} KEYWORD_MATCH_TITLE_ONLY=3 KEYWORD_MATCH_TITLE_ONLY value + */ + SearchJobsRequest.KeywordMatchMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KEYWORD_MATCH_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "KEYWORD_MATCH_DISABLED"] = 1; + values[valuesById[2] = "KEYWORD_MATCH_ALL"] = 2; + values[valuesById[3] = "KEYWORD_MATCH_TITLE_ONLY"] = 3; + return values; + })(); + + SearchJobsRequest.CustomRankingInfo = (function() { + + /** + * Properties of a CustomRankingInfo. + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @interface ICustomRankingInfo + * @property {google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ImportanceLevel|null} [importanceLevel] CustomRankingInfo importanceLevel + * @property {string|null} [rankingExpression] CustomRankingInfo rankingExpression + */ + + /** + * Constructs a new CustomRankingInfo. + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest + * @classdesc Represents a CustomRankingInfo. + * @implements ICustomRankingInfo + * @constructor + * @param {google.cloud.talent.v4beta1.SearchJobsRequest.ICustomRankingInfo=} [properties] Properties to set + */ + function CustomRankingInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomRankingInfo importanceLevel. + * @member {google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ImportanceLevel} importanceLevel + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo + * @instance + */ + CustomRankingInfo.prototype.importanceLevel = 0; + + /** + * CustomRankingInfo rankingExpression. + * @member {string} rankingExpression + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo + * @instance + */ + CustomRankingInfo.prototype.rankingExpression = ""; + + /** + * Creates a new CustomRankingInfo instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo + * @static + * @param {google.cloud.talent.v4beta1.SearchJobsRequest.ICustomRankingInfo=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo} CustomRankingInfo instance + */ + CustomRankingInfo.create = function create(properties) { + return new CustomRankingInfo(properties); + }; + + /** + * Encodes the specified CustomRankingInfo message. Does not implicitly {@link google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo + * @static + * @param {google.cloud.talent.v4beta1.SearchJobsRequest.ICustomRankingInfo} message CustomRankingInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomRankingInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.importanceLevel != null && Object.hasOwnProperty.call(message, "importanceLevel")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.importanceLevel); + if (message.rankingExpression != null && Object.hasOwnProperty.call(message, "rankingExpression")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rankingExpression); + return writer; + }; + + /** + * Encodes the specified CustomRankingInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo + * @static + * @param {google.cloud.talent.v4beta1.SearchJobsRequest.ICustomRankingInfo} message CustomRankingInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomRankingInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomRankingInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo} CustomRankingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomRankingInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.importanceLevel = reader.int32(); + break; + } + case 2: { + message.rankingExpression = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomRankingInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo} CustomRankingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomRankingInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomRankingInfo message. + * @function verify + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomRankingInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.importanceLevel != null && message.hasOwnProperty("importanceLevel")) + switch (message.importanceLevel) { + default: + return "importanceLevel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.rankingExpression != null && message.hasOwnProperty("rankingExpression")) + if (!$util.isString(message.rankingExpression)) + return "rankingExpression: string expected"; + return null; + }; + + /** + * Creates a CustomRankingInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo} CustomRankingInfo + */ + CustomRankingInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo) + return object; + var message = new $root.google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo(); + switch (object.importanceLevel) { + default: + if (typeof object.importanceLevel === "number") { + message.importanceLevel = object.importanceLevel; + break; + } + break; + case "IMPORTANCE_LEVEL_UNSPECIFIED": + case 0: + message.importanceLevel = 0; + break; + case "NONE": + case 1: + message.importanceLevel = 1; + break; + case "LOW": + case 2: + message.importanceLevel = 2; + break; + case "MILD": + case 3: + message.importanceLevel = 3; + break; + case "MEDIUM": + case 4: + message.importanceLevel = 4; + break; + case "HIGH": + case 5: + message.importanceLevel = 5; + break; + case "EXTREME": + case 6: + message.importanceLevel = 6; + break; + } + if (object.rankingExpression != null) + message.rankingExpression = String(object.rankingExpression); + return message; + }; + + /** + * Creates a plain object from a CustomRankingInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo + * @static + * @param {google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo} message CustomRankingInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomRankingInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.importanceLevel = options.enums === String ? "IMPORTANCE_LEVEL_UNSPECIFIED" : 0; + object.rankingExpression = ""; + } + if (message.importanceLevel != null && message.hasOwnProperty("importanceLevel")) + object.importanceLevel = options.enums === String ? $root.google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ImportanceLevel[message.importanceLevel] === undefined ? message.importanceLevel : $root.google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ImportanceLevel[message.importanceLevel] : message.importanceLevel; + if (message.rankingExpression != null && message.hasOwnProperty("rankingExpression")) + object.rankingExpression = message.rankingExpression; + return object; + }; + + /** + * Converts this CustomRankingInfo to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo + * @instance + * @returns {Object.} JSON object + */ + CustomRankingInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomRankingInfo + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomRankingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo"; + }; + + /** + * ImportanceLevel enum. + * @name google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ImportanceLevel + * @enum {number} + * @property {number} IMPORTANCE_LEVEL_UNSPECIFIED=0 IMPORTANCE_LEVEL_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} LOW=2 LOW value + * @property {number} MILD=3 MILD value + * @property {number} MEDIUM=4 MEDIUM value + * @property {number} HIGH=5 HIGH value + * @property {number} EXTREME=6 EXTREME value + */ + CustomRankingInfo.ImportanceLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IMPORTANCE_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "LOW"] = 2; + values[valuesById[3] = "MILD"] = 3; + values[valuesById[4] = "MEDIUM"] = 4; + values[valuesById[5] = "HIGH"] = 5; + values[valuesById[6] = "EXTREME"] = 6; + return values; + })(); + + return CustomRankingInfo; + })(); + + return SearchJobsRequest; + })(); + + v4beta1.SearchJobsResponse = (function() { + + /** + * Properties of a SearchJobsResponse. + * @memberof google.cloud.talent.v4beta1 + * @interface ISearchJobsResponse + * @property {Array.|null} [matchingJobs] SearchJobsResponse matchingJobs + * @property {Array.|null} [histogramQueryResults] SearchJobsResponse histogramQueryResults + * @property {string|null} [nextPageToken] SearchJobsResponse nextPageToken + * @property {Array.|null} [locationFilters] SearchJobsResponse locationFilters + * @property {number|null} [estimatedTotalSize] SearchJobsResponse estimatedTotalSize + * @property {number|null} [totalSize] SearchJobsResponse totalSize + * @property {google.cloud.talent.v4beta1.IResponseMetadata|null} [metadata] SearchJobsResponse metadata + * @property {number|null} [broadenedQueryJobsCount] SearchJobsResponse broadenedQueryJobsCount + * @property {google.cloud.talent.v4beta1.ISpellingCorrection|null} [spellCorrection] SearchJobsResponse spellCorrection + */ + + /** + * Constructs a new SearchJobsResponse. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a SearchJobsResponse. + * @implements ISearchJobsResponse + * @constructor + * @param {google.cloud.talent.v4beta1.ISearchJobsResponse=} [properties] Properties to set + */ + function SearchJobsResponse(properties) { + this.matchingJobs = []; + this.histogramQueryResults = []; + this.locationFilters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchJobsResponse matchingJobs. + * @member {Array.} matchingJobs + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @instance + */ + SearchJobsResponse.prototype.matchingJobs = $util.emptyArray; + + /** + * SearchJobsResponse histogramQueryResults. + * @member {Array.} histogramQueryResults + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @instance + */ + SearchJobsResponse.prototype.histogramQueryResults = $util.emptyArray; + + /** + * SearchJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @instance + */ + SearchJobsResponse.prototype.nextPageToken = ""; + + /** + * SearchJobsResponse locationFilters. + * @member {Array.} locationFilters + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @instance + */ + SearchJobsResponse.prototype.locationFilters = $util.emptyArray; + + /** + * SearchJobsResponse estimatedTotalSize. + * @member {number} estimatedTotalSize + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @instance + */ + SearchJobsResponse.prototype.estimatedTotalSize = 0; + + /** + * SearchJobsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @instance + */ + SearchJobsResponse.prototype.totalSize = 0; + + /** + * SearchJobsResponse metadata. + * @member {google.cloud.talent.v4beta1.IResponseMetadata|null|undefined} metadata + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @instance + */ + SearchJobsResponse.prototype.metadata = null; + + /** + * SearchJobsResponse broadenedQueryJobsCount. + * @member {number} broadenedQueryJobsCount + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @instance + */ + SearchJobsResponse.prototype.broadenedQueryJobsCount = 0; + + /** + * SearchJobsResponse spellCorrection. + * @member {google.cloud.talent.v4beta1.ISpellingCorrection|null|undefined} spellCorrection + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @instance + */ + SearchJobsResponse.prototype.spellCorrection = null; + + /** + * Creates a new SearchJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @static + * @param {google.cloud.talent.v4beta1.ISearchJobsResponse=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.SearchJobsResponse} SearchJobsResponse instance + */ + SearchJobsResponse.create = function create(properties) { + return new SearchJobsResponse(properties); + }; + + /** + * Encodes the specified SearchJobsResponse message. Does not implicitly {@link google.cloud.talent.v4beta1.SearchJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @static + * @param {google.cloud.talent.v4beta1.ISearchJobsResponse} message SearchJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.matchingJobs != null && message.matchingJobs.length) + for (var i = 0; i < message.matchingJobs.length; ++i) + $root.google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob.encode(message.matchingJobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.histogramQueryResults != null && message.histogramQueryResults.length) + for (var i = 0; i < message.histogramQueryResults.length; ++i) + $root.google.cloud.talent.v4beta1.HistogramQueryResult.encode(message.histogramQueryResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.locationFilters != null && message.locationFilters.length) + for (var i = 0; i < message.locationFilters.length; ++i) + $root.google.cloud.talent.v4beta1.Location.encode(message.locationFilters[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.estimatedTotalSize != null && Object.hasOwnProperty.call(message, "estimatedTotalSize")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.estimatedTotalSize); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.totalSize); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.talent.v4beta1.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.broadenedQueryJobsCount != null && Object.hasOwnProperty.call(message, "broadenedQueryJobsCount")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.broadenedQueryJobsCount); + if (message.spellCorrection != null && Object.hasOwnProperty.call(message, "spellCorrection")) + $root.google.cloud.talent.v4beta1.SpellingCorrection.encode(message.spellCorrection, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchJobsResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.SearchJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @static + * @param {google.cloud.talent.v4beta1.ISearchJobsResponse} message SearchJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.SearchJobsResponse} SearchJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchJobsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.SearchJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.matchingJobs && message.matchingJobs.length)) + message.matchingJobs = []; + message.matchingJobs.push($root.google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.histogramQueryResults && message.histogramQueryResults.length)) + message.histogramQueryResults = []; + message.histogramQueryResults.push($root.google.cloud.talent.v4beta1.HistogramQueryResult.decode(reader, reader.uint32())); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + if (!(message.locationFilters && message.locationFilters.length)) + message.locationFilters = []; + message.locationFilters.push($root.google.cloud.talent.v4beta1.Location.decode(reader, reader.uint32())); + break; + } + case 5: { + message.estimatedTotalSize = reader.int32(); + break; + } + case 6: { + message.totalSize = reader.int32(); + break; + } + case 7: { + message.metadata = $root.google.cloud.talent.v4beta1.ResponseMetadata.decode(reader, reader.uint32()); + break; + } + case 8: { + message.broadenedQueryJobsCount = reader.int32(); + break; + } + case 9: { + message.spellCorrection = $root.google.cloud.talent.v4beta1.SpellingCorrection.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.SearchJobsResponse} SearchJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchJobsResponse message. + * @function verify + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.matchingJobs != null && message.hasOwnProperty("matchingJobs")) { + if (!Array.isArray(message.matchingJobs)) + return "matchingJobs: array expected"; + for (var i = 0; i < message.matchingJobs.length; ++i) { + var error = $root.google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob.verify(message.matchingJobs[i]); + if (error) + return "matchingJobs." + error; + } + } + if (message.histogramQueryResults != null && message.hasOwnProperty("histogramQueryResults")) { + if (!Array.isArray(message.histogramQueryResults)) + return "histogramQueryResults: array expected"; + for (var i = 0; i < message.histogramQueryResults.length; ++i) { + var error = $root.google.cloud.talent.v4beta1.HistogramQueryResult.verify(message.histogramQueryResults[i]); + if (error) + return "histogramQueryResults." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.locationFilters != null && message.hasOwnProperty("locationFilters")) { + if (!Array.isArray(message.locationFilters)) + return "locationFilters: array expected"; + for (var i = 0; i < message.locationFilters.length; ++i) { + var error = $root.google.cloud.talent.v4beta1.Location.verify(message.locationFilters[i]); + if (error) + return "locationFilters." + error; + } + } + if (message.estimatedTotalSize != null && message.hasOwnProperty("estimatedTotalSize")) + if (!$util.isInteger(message.estimatedTotalSize)) + return "estimatedTotalSize: integer expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.talent.v4beta1.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.broadenedQueryJobsCount != null && message.hasOwnProperty("broadenedQueryJobsCount")) + if (!$util.isInteger(message.broadenedQueryJobsCount)) + return "broadenedQueryJobsCount: integer expected"; + if (message.spellCorrection != null && message.hasOwnProperty("spellCorrection")) { + var error = $root.google.cloud.talent.v4beta1.SpellingCorrection.verify(message.spellCorrection); + if (error) + return "spellCorrection." + error; + } + return null; + }; + + /** + * Creates a SearchJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.SearchJobsResponse} SearchJobsResponse + */ + SearchJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.SearchJobsResponse) + return object; + var message = new $root.google.cloud.talent.v4beta1.SearchJobsResponse(); + if (object.matchingJobs) { + if (!Array.isArray(object.matchingJobs)) + throw TypeError(".google.cloud.talent.v4beta1.SearchJobsResponse.matchingJobs: array expected"); + message.matchingJobs = []; + for (var i = 0; i < object.matchingJobs.length; ++i) { + if (typeof object.matchingJobs[i] !== "object") + throw TypeError(".google.cloud.talent.v4beta1.SearchJobsResponse.matchingJobs: object expected"); + message.matchingJobs[i] = $root.google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob.fromObject(object.matchingJobs[i]); + } + } + if (object.histogramQueryResults) { + if (!Array.isArray(object.histogramQueryResults)) + throw TypeError(".google.cloud.talent.v4beta1.SearchJobsResponse.histogramQueryResults: array expected"); + message.histogramQueryResults = []; + for (var i = 0; i < object.histogramQueryResults.length; ++i) { + if (typeof object.histogramQueryResults[i] !== "object") + throw TypeError(".google.cloud.talent.v4beta1.SearchJobsResponse.histogramQueryResults: object expected"); + message.histogramQueryResults[i] = $root.google.cloud.talent.v4beta1.HistogramQueryResult.fromObject(object.histogramQueryResults[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.locationFilters) { + if (!Array.isArray(object.locationFilters)) + throw TypeError(".google.cloud.talent.v4beta1.SearchJobsResponse.locationFilters: array expected"); + message.locationFilters = []; + for (var i = 0; i < object.locationFilters.length; ++i) { + if (typeof object.locationFilters[i] !== "object") + throw TypeError(".google.cloud.talent.v4beta1.SearchJobsResponse.locationFilters: object expected"); + message.locationFilters[i] = $root.google.cloud.talent.v4beta1.Location.fromObject(object.locationFilters[i]); + } + } + if (object.estimatedTotalSize != null) + message.estimatedTotalSize = object.estimatedTotalSize | 0; + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.talent.v4beta1.SearchJobsResponse.metadata: object expected"); + message.metadata = $root.google.cloud.talent.v4beta1.ResponseMetadata.fromObject(object.metadata); + } + if (object.broadenedQueryJobsCount != null) + message.broadenedQueryJobsCount = object.broadenedQueryJobsCount | 0; + if (object.spellCorrection != null) { + if (typeof object.spellCorrection !== "object") + throw TypeError(".google.cloud.talent.v4beta1.SearchJobsResponse.spellCorrection: object expected"); + message.spellCorrection = $root.google.cloud.talent.v4beta1.SpellingCorrection.fromObject(object.spellCorrection); + } + return message; + }; + + /** + * Creates a plain object from a SearchJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @static + * @param {google.cloud.talent.v4beta1.SearchJobsResponse} message SearchJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.matchingJobs = []; + object.histogramQueryResults = []; + object.locationFilters = []; + } + if (options.defaults) { + object.nextPageToken = ""; + object.estimatedTotalSize = 0; + object.totalSize = 0; + object.metadata = null; + object.broadenedQueryJobsCount = 0; + object.spellCorrection = null; + } + if (message.matchingJobs && message.matchingJobs.length) { + object.matchingJobs = []; + for (var j = 0; j < message.matchingJobs.length; ++j) + object.matchingJobs[j] = $root.google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob.toObject(message.matchingJobs[j], options); + } + if (message.histogramQueryResults && message.histogramQueryResults.length) { + object.histogramQueryResults = []; + for (var j = 0; j < message.histogramQueryResults.length; ++j) + object.histogramQueryResults[j] = $root.google.cloud.talent.v4beta1.HistogramQueryResult.toObject(message.histogramQueryResults[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.locationFilters && message.locationFilters.length) { + object.locationFilters = []; + for (var j = 0; j < message.locationFilters.length; ++j) + object.locationFilters[j] = $root.google.cloud.talent.v4beta1.Location.toObject(message.locationFilters[j], options); + } + if (message.estimatedTotalSize != null && message.hasOwnProperty("estimatedTotalSize")) + object.estimatedTotalSize = message.estimatedTotalSize; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.talent.v4beta1.ResponseMetadata.toObject(message.metadata, options); + if (message.broadenedQueryJobsCount != null && message.hasOwnProperty("broadenedQueryJobsCount")) + object.broadenedQueryJobsCount = message.broadenedQueryJobsCount; + if (message.spellCorrection != null && message.hasOwnProperty("spellCorrection")) + object.spellCorrection = $root.google.cloud.talent.v4beta1.SpellingCorrection.toObject(message.spellCorrection, options); + return object; + }; + + /** + * Converts this SearchJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @instance + * @returns {Object.} JSON object + */ + SearchJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchJobsResponse + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.SearchJobsResponse"; + }; + + SearchJobsResponse.MatchingJob = (function() { + + /** + * Properties of a MatchingJob. + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @interface IMatchingJob + * @property {google.cloud.talent.v4beta1.IJob|null} [job] MatchingJob job + * @property {string|null} [jobSummary] MatchingJob jobSummary + * @property {string|null} [jobTitleSnippet] MatchingJob jobTitleSnippet + * @property {string|null} [searchTextSnippet] MatchingJob searchTextSnippet + * @property {google.cloud.talent.v4beta1.SearchJobsResponse.ICommuteInfo|null} [commuteInfo] MatchingJob commuteInfo + */ + + /** + * Constructs a new MatchingJob. + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @classdesc Represents a MatchingJob. + * @implements IMatchingJob + * @constructor + * @param {google.cloud.talent.v4beta1.SearchJobsResponse.IMatchingJob=} [properties] Properties to set + */ + function MatchingJob(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MatchingJob job. + * @member {google.cloud.talent.v4beta1.IJob|null|undefined} job + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob + * @instance + */ + MatchingJob.prototype.job = null; + + /** + * MatchingJob jobSummary. + * @member {string} jobSummary + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob + * @instance + */ + MatchingJob.prototype.jobSummary = ""; + + /** + * MatchingJob jobTitleSnippet. + * @member {string} jobTitleSnippet + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob + * @instance + */ + MatchingJob.prototype.jobTitleSnippet = ""; + + /** + * MatchingJob searchTextSnippet. + * @member {string} searchTextSnippet + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob + * @instance + */ + MatchingJob.prototype.searchTextSnippet = ""; + + /** + * MatchingJob commuteInfo. + * @member {google.cloud.talent.v4beta1.SearchJobsResponse.ICommuteInfo|null|undefined} commuteInfo + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob + * @instance + */ + MatchingJob.prototype.commuteInfo = null; + + /** + * Creates a new MatchingJob instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob + * @static + * @param {google.cloud.talent.v4beta1.SearchJobsResponse.IMatchingJob=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob} MatchingJob instance + */ + MatchingJob.create = function create(properties) { + return new MatchingJob(properties); + }; + + /** + * Encodes the specified MatchingJob message. Does not implicitly {@link google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob + * @static + * @param {google.cloud.talent.v4beta1.SearchJobsResponse.IMatchingJob} message MatchingJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchingJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.talent.v4beta1.Job.encode(message.job, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.jobSummary != null && Object.hasOwnProperty.call(message, "jobSummary")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobSummary); + if (message.jobTitleSnippet != null && Object.hasOwnProperty.call(message, "jobTitleSnippet")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobTitleSnippet); + if (message.searchTextSnippet != null && Object.hasOwnProperty.call(message, "searchTextSnippet")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.searchTextSnippet); + if (message.commuteInfo != null && Object.hasOwnProperty.call(message, "commuteInfo")) + $root.google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo.encode(message.commuteInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MatchingJob message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob + * @static + * @param {google.cloud.talent.v4beta1.SearchJobsResponse.IMatchingJob} message MatchingJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MatchingJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MatchingJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob} MatchingJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchingJob.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.job = $root.google.cloud.talent.v4beta1.Job.decode(reader, reader.uint32()); + break; + } + case 2: { + message.jobSummary = reader.string(); + break; + } + case 3: { + message.jobTitleSnippet = reader.string(); + break; + } + case 4: { + message.searchTextSnippet = reader.string(); + break; + } + case 5: { + message.commuteInfo = $root.google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MatchingJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob} MatchingJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MatchingJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MatchingJob message. + * @function verify + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MatchingJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.cloud.talent.v4beta1.Job.verify(message.job); + if (error) + return "job." + error; + } + if (message.jobSummary != null && message.hasOwnProperty("jobSummary")) + if (!$util.isString(message.jobSummary)) + return "jobSummary: string expected"; + if (message.jobTitleSnippet != null && message.hasOwnProperty("jobTitleSnippet")) + if (!$util.isString(message.jobTitleSnippet)) + return "jobTitleSnippet: string expected"; + if (message.searchTextSnippet != null && message.hasOwnProperty("searchTextSnippet")) + if (!$util.isString(message.searchTextSnippet)) + return "searchTextSnippet: string expected"; + if (message.commuteInfo != null && message.hasOwnProperty("commuteInfo")) { + var error = $root.google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo.verify(message.commuteInfo); + if (error) + return "commuteInfo." + error; + } + return null; + }; + + /** + * Creates a MatchingJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob} MatchingJob + */ + MatchingJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob) + return object; + var message = new $root.google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob(); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob.job: object expected"); + message.job = $root.google.cloud.talent.v4beta1.Job.fromObject(object.job); + } + if (object.jobSummary != null) + message.jobSummary = String(object.jobSummary); + if (object.jobTitleSnippet != null) + message.jobTitleSnippet = String(object.jobTitleSnippet); + if (object.searchTextSnippet != null) + message.searchTextSnippet = String(object.searchTextSnippet); + if (object.commuteInfo != null) { + if (typeof object.commuteInfo !== "object") + throw TypeError(".google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob.commuteInfo: object expected"); + message.commuteInfo = $root.google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo.fromObject(object.commuteInfo); + } + return message; + }; + + /** + * Creates a plain object from a MatchingJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob + * @static + * @param {google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob} message MatchingJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MatchingJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.job = null; + object.jobSummary = ""; + object.jobTitleSnippet = ""; + object.searchTextSnippet = ""; + object.commuteInfo = null; + } + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.talent.v4beta1.Job.toObject(message.job, options); + if (message.jobSummary != null && message.hasOwnProperty("jobSummary")) + object.jobSummary = message.jobSummary; + if (message.jobTitleSnippet != null && message.hasOwnProperty("jobTitleSnippet")) + object.jobTitleSnippet = message.jobTitleSnippet; + if (message.searchTextSnippet != null && message.hasOwnProperty("searchTextSnippet")) + object.searchTextSnippet = message.searchTextSnippet; + if (message.commuteInfo != null && message.hasOwnProperty("commuteInfo")) + object.commuteInfo = $root.google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo.toObject(message.commuteInfo, options); + return object; + }; + + /** + * Converts this MatchingJob to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob + * @instance + * @returns {Object.} JSON object + */ + MatchingJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MatchingJob + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MatchingJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob"; + }; + + return MatchingJob; + })(); + + SearchJobsResponse.CommuteInfo = (function() { + + /** + * Properties of a CommuteInfo. + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @interface ICommuteInfo + * @property {google.cloud.talent.v4beta1.ILocation|null} [jobLocation] CommuteInfo jobLocation + * @property {google.protobuf.IDuration|null} [travelDuration] CommuteInfo travelDuration + */ + + /** + * Constructs a new CommuteInfo. + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse + * @classdesc Represents a CommuteInfo. + * @implements ICommuteInfo + * @constructor + * @param {google.cloud.talent.v4beta1.SearchJobsResponse.ICommuteInfo=} [properties] Properties to set + */ + function CommuteInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommuteInfo jobLocation. + * @member {google.cloud.talent.v4beta1.ILocation|null|undefined} jobLocation + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo + * @instance + */ + CommuteInfo.prototype.jobLocation = null; + + /** + * CommuteInfo travelDuration. + * @member {google.protobuf.IDuration|null|undefined} travelDuration + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo + * @instance + */ + CommuteInfo.prototype.travelDuration = null; + + /** + * Creates a new CommuteInfo instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo + * @static + * @param {google.cloud.talent.v4beta1.SearchJobsResponse.ICommuteInfo=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo} CommuteInfo instance + */ + CommuteInfo.create = function create(properties) { + return new CommuteInfo(properties); + }; + + /** + * Encodes the specified CommuteInfo message. Does not implicitly {@link google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo + * @static + * @param {google.cloud.talent.v4beta1.SearchJobsResponse.ICommuteInfo} message CommuteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommuteInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobLocation != null && Object.hasOwnProperty.call(message, "jobLocation")) + $root.google.cloud.talent.v4beta1.Location.encode(message.jobLocation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.travelDuration != null && Object.hasOwnProperty.call(message, "travelDuration")) + $root.google.protobuf.Duration.encode(message.travelDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommuteInfo message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo + * @static + * @param {google.cloud.talent.v4beta1.SearchJobsResponse.ICommuteInfo} message CommuteInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommuteInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommuteInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo} CommuteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommuteInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.jobLocation = $root.google.cloud.talent.v4beta1.Location.decode(reader, reader.uint32()); + break; + } + case 2: { + message.travelDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommuteInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo} CommuteInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommuteInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommuteInfo message. + * @function verify + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommuteInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobLocation != null && message.hasOwnProperty("jobLocation")) { + var error = $root.google.cloud.talent.v4beta1.Location.verify(message.jobLocation); + if (error) + return "jobLocation." + error; + } + if (message.travelDuration != null && message.hasOwnProperty("travelDuration")) { + var error = $root.google.protobuf.Duration.verify(message.travelDuration); + if (error) + return "travelDuration." + error; + } + return null; + }; + + /** + * Creates a CommuteInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo} CommuteInfo + */ + CommuteInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo) + return object; + var message = new $root.google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo(); + if (object.jobLocation != null) { + if (typeof object.jobLocation !== "object") + throw TypeError(".google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo.jobLocation: object expected"); + message.jobLocation = $root.google.cloud.talent.v4beta1.Location.fromObject(object.jobLocation); + } + if (object.travelDuration != null) { + if (typeof object.travelDuration !== "object") + throw TypeError(".google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo.travelDuration: object expected"); + message.travelDuration = $root.google.protobuf.Duration.fromObject(object.travelDuration); + } + return message; + }; + + /** + * Creates a plain object from a CommuteInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo + * @static + * @param {google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo} message CommuteInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommuteInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.jobLocation = null; + object.travelDuration = null; + } + if (message.jobLocation != null && message.hasOwnProperty("jobLocation")) + object.jobLocation = $root.google.cloud.talent.v4beta1.Location.toObject(message.jobLocation, options); + if (message.travelDuration != null && message.hasOwnProperty("travelDuration")) + object.travelDuration = $root.google.protobuf.Duration.toObject(message.travelDuration, options); + return object; + }; + + /** + * Converts this CommuteInfo to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo + * @instance + * @returns {Object.} JSON object + */ + CommuteInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommuteInfo + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommuteInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo"; + }; + + return CommuteInfo; + })(); + + return SearchJobsResponse; + })(); + + v4beta1.BatchCreateJobsRequest = (function() { + + /** + * Properties of a BatchCreateJobsRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface IBatchCreateJobsRequest + * @property {string|null} [parent] BatchCreateJobsRequest parent + * @property {Array.|null} [jobs] BatchCreateJobsRequest jobs + */ + + /** + * Constructs a new BatchCreateJobsRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a BatchCreateJobsRequest. + * @implements IBatchCreateJobsRequest + * @constructor + * @param {google.cloud.talent.v4beta1.IBatchCreateJobsRequest=} [properties] Properties to set + */ + function BatchCreateJobsRequest(properties) { + this.jobs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4beta1.BatchCreateJobsRequest + * @instance + */ + BatchCreateJobsRequest.prototype.parent = ""; + + /** + * BatchCreateJobsRequest jobs. + * @member {Array.} jobs + * @memberof google.cloud.talent.v4beta1.BatchCreateJobsRequest + * @instance + */ + BatchCreateJobsRequest.prototype.jobs = $util.emptyArray; + + /** + * Creates a new BatchCreateJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.BatchCreateJobsRequest + * @static + * @param {google.cloud.talent.v4beta1.IBatchCreateJobsRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.BatchCreateJobsRequest} BatchCreateJobsRequest instance + */ + BatchCreateJobsRequest.create = function create(properties) { + return new BatchCreateJobsRequest(properties); + }; + + /** + * Encodes the specified BatchCreateJobsRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.BatchCreateJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.BatchCreateJobsRequest + * @static + * @param {google.cloud.talent.v4beta1.IBatchCreateJobsRequest} message BatchCreateJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateJobsRequest.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.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + $root.google.cloud.talent.v4beta1.Job.encode(message.jobs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateJobsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.BatchCreateJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.BatchCreateJobsRequest + * @static + * @param {google.cloud.talent.v4beta1.IBatchCreateJobsRequest} message BatchCreateJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.BatchCreateJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.BatchCreateJobsRequest} BatchCreateJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.BatchCreateJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push($root.google.cloud.talent.v4beta1.Job.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.BatchCreateJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.BatchCreateJobsRequest} BatchCreateJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateJobsRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.BatchCreateJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateJobsRequest.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.jobs != null && message.hasOwnProperty("jobs")) { + if (!Array.isArray(message.jobs)) + return "jobs: array expected"; + for (var i = 0; i < message.jobs.length; ++i) { + var error = $root.google.cloud.talent.v4beta1.Job.verify(message.jobs[i]); + if (error) + return "jobs." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.BatchCreateJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.BatchCreateJobsRequest} BatchCreateJobsRequest + */ + BatchCreateJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.BatchCreateJobsRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.BatchCreateJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.talent.v4beta1.BatchCreateJobsRequest.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) { + if (typeof object.jobs[i] !== "object") + throw TypeError(".google.cloud.talent.v4beta1.BatchCreateJobsRequest.jobs: object expected"); + message.jobs[i] = $root.google.cloud.talent.v4beta1.Job.fromObject(object.jobs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.BatchCreateJobsRequest + * @static + * @param {google.cloud.talent.v4beta1.BatchCreateJobsRequest} message BatchCreateJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jobs = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = $root.google.cloud.talent.v4beta1.Job.toObject(message.jobs[j], options); + } + return object; + }; + + /** + * Converts this BatchCreateJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.BatchCreateJobsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchCreateJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateJobsRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.BatchCreateJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.BatchCreateJobsRequest"; + }; + + return BatchCreateJobsRequest; + })(); + + v4beta1.BatchUpdateJobsRequest = (function() { + + /** + * Properties of a BatchUpdateJobsRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface IBatchUpdateJobsRequest + * @property {string|null} [parent] BatchUpdateJobsRequest parent + * @property {Array.|null} [jobs] BatchUpdateJobsRequest jobs + * @property {google.protobuf.IFieldMask|null} [updateMask] BatchUpdateJobsRequest updateMask + */ + + /** + * Constructs a new BatchUpdateJobsRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a BatchUpdateJobsRequest. + * @implements IBatchUpdateJobsRequest + * @constructor + * @param {google.cloud.talent.v4beta1.IBatchUpdateJobsRequest=} [properties] Properties to set + */ + function BatchUpdateJobsRequest(properties) { + this.jobs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchUpdateJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4beta1.BatchUpdateJobsRequest + * @instance + */ + BatchUpdateJobsRequest.prototype.parent = ""; + + /** + * BatchUpdateJobsRequest jobs. + * @member {Array.} jobs + * @memberof google.cloud.talent.v4beta1.BatchUpdateJobsRequest + * @instance + */ + BatchUpdateJobsRequest.prototype.jobs = $util.emptyArray; + + /** + * BatchUpdateJobsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.talent.v4beta1.BatchUpdateJobsRequest + * @instance + */ + BatchUpdateJobsRequest.prototype.updateMask = null; + + /** + * Creates a new BatchUpdateJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.BatchUpdateJobsRequest + * @static + * @param {google.cloud.talent.v4beta1.IBatchUpdateJobsRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.BatchUpdateJobsRequest} BatchUpdateJobsRequest instance + */ + BatchUpdateJobsRequest.create = function create(properties) { + return new BatchUpdateJobsRequest(properties); + }; + + /** + * Encodes the specified BatchUpdateJobsRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.BatchUpdateJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.BatchUpdateJobsRequest + * @static + * @param {google.cloud.talent.v4beta1.IBatchUpdateJobsRequest} message BatchUpdateJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateJobsRequest.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.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + $root.google.cloud.talent.v4beta1.Job.encode(message.jobs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchUpdateJobsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.BatchUpdateJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.BatchUpdateJobsRequest + * @static + * @param {google.cloud.talent.v4beta1.IBatchUpdateJobsRequest} message BatchUpdateJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchUpdateJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.BatchUpdateJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.BatchUpdateJobsRequest} BatchUpdateJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.BatchUpdateJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push($root.google.cloud.talent.v4beta1.Job.decode(reader, reader.uint32())); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchUpdateJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.BatchUpdateJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.BatchUpdateJobsRequest} BatchUpdateJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchUpdateJobsRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.BatchUpdateJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchUpdateJobsRequest.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.jobs != null && message.hasOwnProperty("jobs")) { + if (!Array.isArray(message.jobs)) + return "jobs: array expected"; + for (var i = 0; i < message.jobs.length; ++i) { + var error = $root.google.cloud.talent.v4beta1.Job.verify(message.jobs[i]); + if (error) + return "jobs." + 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 a BatchUpdateJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.BatchUpdateJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.BatchUpdateJobsRequest} BatchUpdateJobsRequest + */ + BatchUpdateJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.BatchUpdateJobsRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.BatchUpdateJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.talent.v4beta1.BatchUpdateJobsRequest.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) { + if (typeof object.jobs[i] !== "object") + throw TypeError(".google.cloud.talent.v4beta1.BatchUpdateJobsRequest.jobs: object expected"); + message.jobs[i] = $root.google.cloud.talent.v4beta1.Job.fromObject(object.jobs[i]); + } + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.talent.v4beta1.BatchUpdateJobsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a BatchUpdateJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.BatchUpdateJobsRequest + * @static + * @param {google.cloud.talent.v4beta1.BatchUpdateJobsRequest} message BatchUpdateJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchUpdateJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jobs = []; + if (options.defaults) { + object.parent = ""; + object.updateMask = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = $root.google.cloud.talent.v4beta1.Job.toObject(message.jobs[j], options); + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this BatchUpdateJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.BatchUpdateJobsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchUpdateJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchUpdateJobsRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.BatchUpdateJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchUpdateJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.BatchUpdateJobsRequest"; + }; + + return BatchUpdateJobsRequest; + })(); + + v4beta1.JobOperationResult = (function() { + + /** + * Properties of a JobOperationResult. + * @memberof google.cloud.talent.v4beta1 + * @interface IJobOperationResult + * @property {Array.|null} [jobResults] JobOperationResult jobResults + */ + + /** + * Constructs a new JobOperationResult. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a JobOperationResult. + * @implements IJobOperationResult + * @constructor + * @param {google.cloud.talent.v4beta1.IJobOperationResult=} [properties] Properties to set + */ + function JobOperationResult(properties) { + this.jobResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobOperationResult jobResults. + * @member {Array.} jobResults + * @memberof google.cloud.talent.v4beta1.JobOperationResult + * @instance + */ + JobOperationResult.prototype.jobResults = $util.emptyArray; + + /** + * Creates a new JobOperationResult instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.JobOperationResult + * @static + * @param {google.cloud.talent.v4beta1.IJobOperationResult=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.JobOperationResult} JobOperationResult instance + */ + JobOperationResult.create = function create(properties) { + return new JobOperationResult(properties); + }; + + /** + * Encodes the specified JobOperationResult message. Does not implicitly {@link google.cloud.talent.v4beta1.JobOperationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.JobOperationResult + * @static + * @param {google.cloud.talent.v4beta1.IJobOperationResult} message JobOperationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobOperationResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobResults != null && message.jobResults.length) + for (var i = 0; i < message.jobResults.length; ++i) + $root.google.cloud.talent.v4beta1.JobOperationResult.JobResult.encode(message.jobResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobOperationResult message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.JobOperationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.JobOperationResult + * @static + * @param {google.cloud.talent.v4beta1.IJobOperationResult} message JobOperationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobOperationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobOperationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.JobOperationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.JobOperationResult} JobOperationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobOperationResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.JobOperationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.jobResults && message.jobResults.length)) + message.jobResults = []; + message.jobResults.push($root.google.cloud.talent.v4beta1.JobOperationResult.JobResult.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobOperationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.JobOperationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.JobOperationResult} JobOperationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobOperationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobOperationResult message. + * @function verify + * @memberof google.cloud.talent.v4beta1.JobOperationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobOperationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobResults != null && message.hasOwnProperty("jobResults")) { + if (!Array.isArray(message.jobResults)) + return "jobResults: array expected"; + for (var i = 0; i < message.jobResults.length; ++i) { + var error = $root.google.cloud.talent.v4beta1.JobOperationResult.JobResult.verify(message.jobResults[i]); + if (error) + return "jobResults." + error; + } + } + return null; + }; + + /** + * Creates a JobOperationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.JobOperationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.JobOperationResult} JobOperationResult + */ + JobOperationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.JobOperationResult) + return object; + var message = new $root.google.cloud.talent.v4beta1.JobOperationResult(); + if (object.jobResults) { + if (!Array.isArray(object.jobResults)) + throw TypeError(".google.cloud.talent.v4beta1.JobOperationResult.jobResults: array expected"); + message.jobResults = []; + for (var i = 0; i < object.jobResults.length; ++i) { + if (typeof object.jobResults[i] !== "object") + throw TypeError(".google.cloud.talent.v4beta1.JobOperationResult.jobResults: object expected"); + message.jobResults[i] = $root.google.cloud.talent.v4beta1.JobOperationResult.JobResult.fromObject(object.jobResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a JobOperationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.JobOperationResult + * @static + * @param {google.cloud.talent.v4beta1.JobOperationResult} message JobOperationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobOperationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jobResults = []; + if (message.jobResults && message.jobResults.length) { + object.jobResults = []; + for (var j = 0; j < message.jobResults.length; ++j) + object.jobResults[j] = $root.google.cloud.talent.v4beta1.JobOperationResult.JobResult.toObject(message.jobResults[j], options); + } + return object; + }; + + /** + * Converts this JobOperationResult to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.JobOperationResult + * @instance + * @returns {Object.} JSON object + */ + JobOperationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobOperationResult + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.JobOperationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobOperationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.JobOperationResult"; + }; + + JobOperationResult.JobResult = (function() { + + /** + * Properties of a JobResult. + * @memberof google.cloud.talent.v4beta1.JobOperationResult + * @interface IJobResult + * @property {google.cloud.talent.v4beta1.IJob|null} [job] JobResult job + * @property {google.rpc.IStatus|null} [status] JobResult status + */ + + /** + * Constructs a new JobResult. + * @memberof google.cloud.talent.v4beta1.JobOperationResult + * @classdesc Represents a JobResult. + * @implements IJobResult + * @constructor + * @param {google.cloud.talent.v4beta1.JobOperationResult.IJobResult=} [properties] Properties to set + */ + function JobResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobResult job. + * @member {google.cloud.talent.v4beta1.IJob|null|undefined} job + * @memberof google.cloud.talent.v4beta1.JobOperationResult.JobResult + * @instance + */ + JobResult.prototype.job = null; + + /** + * JobResult status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.cloud.talent.v4beta1.JobOperationResult.JobResult + * @instance + */ + JobResult.prototype.status = null; + + /** + * Creates a new JobResult instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.JobOperationResult.JobResult + * @static + * @param {google.cloud.talent.v4beta1.JobOperationResult.IJobResult=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.JobOperationResult.JobResult} JobResult instance + */ + JobResult.create = function create(properties) { + return new JobResult(properties); + }; + + /** + * Encodes the specified JobResult message. Does not implicitly {@link google.cloud.talent.v4beta1.JobOperationResult.JobResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.JobOperationResult.JobResult + * @static + * @param {google.cloud.talent.v4beta1.JobOperationResult.IJobResult} message JobResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.talent.v4beta1.Job.encode(message.job, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobResult message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.JobOperationResult.JobResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.JobOperationResult.JobResult + * @static + * @param {google.cloud.talent.v4beta1.JobOperationResult.IJobResult} message JobResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.JobOperationResult.JobResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.JobOperationResult.JobResult} JobResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.JobOperationResult.JobResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.job = $root.google.cloud.talent.v4beta1.Job.decode(reader, reader.uint32()); + break; + } + case 2: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.JobOperationResult.JobResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.JobOperationResult.JobResult} JobResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobResult message. + * @function verify + * @memberof google.cloud.talent.v4beta1.JobOperationResult.JobResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.cloud.talent.v4beta1.Job.verify(message.job); + if (error) + return "job." + error; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates a JobResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.JobOperationResult.JobResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.JobOperationResult.JobResult} JobResult + */ + JobResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.JobOperationResult.JobResult) + return object; + var message = new $root.google.cloud.talent.v4beta1.JobOperationResult.JobResult(); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.talent.v4beta1.JobOperationResult.JobResult.job: object expected"); + message.job = $root.google.cloud.talent.v4beta1.Job.fromObject(object.job); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.talent.v4beta1.JobOperationResult.JobResult.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from a JobResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.JobOperationResult.JobResult + * @static + * @param {google.cloud.talent.v4beta1.JobOperationResult.JobResult} message JobResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.job = null; + object.status = null; + } + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.talent.v4beta1.Job.toObject(message.job, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this JobResult to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.JobOperationResult.JobResult + * @instance + * @returns {Object.} JSON object + */ + JobResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobResult + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.JobOperationResult.JobResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.JobOperationResult.JobResult"; + }; + + return JobResult; + })(); + + return JobOperationResult; + })(); + + v4beta1.Tenant = (function() { + + /** + * Properties of a Tenant. + * @memberof google.cloud.talent.v4beta1 + * @interface ITenant + * @property {string|null} [name] Tenant name + * @property {string|null} [externalId] Tenant externalId + * @property {google.cloud.talent.v4beta1.Tenant.DataUsageType|null} [usageType] Tenant usageType + * @property {Array.|null} [keywordSearchableProfileCustomAttributes] Tenant keywordSearchableProfileCustomAttributes + */ + + /** + * Constructs a new Tenant. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a Tenant. + * @implements ITenant + * @constructor + * @param {google.cloud.talent.v4beta1.ITenant=} [properties] Properties to set + */ + function Tenant(properties) { + this.keywordSearchableProfileCustomAttributes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tenant name. + * @member {string} name + * @memberof google.cloud.talent.v4beta1.Tenant + * @instance + */ + Tenant.prototype.name = ""; + + /** + * Tenant externalId. + * @member {string} externalId + * @memberof google.cloud.talent.v4beta1.Tenant + * @instance + */ + Tenant.prototype.externalId = ""; + + /** + * Tenant usageType. + * @member {google.cloud.talent.v4beta1.Tenant.DataUsageType} usageType + * @memberof google.cloud.talent.v4beta1.Tenant + * @instance + */ + Tenant.prototype.usageType = 0; + + /** + * Tenant keywordSearchableProfileCustomAttributes. + * @member {Array.} keywordSearchableProfileCustomAttributes + * @memberof google.cloud.talent.v4beta1.Tenant + * @instance + */ + Tenant.prototype.keywordSearchableProfileCustomAttributes = $util.emptyArray; + + /** + * Creates a new Tenant instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.Tenant + * @static + * @param {google.cloud.talent.v4beta1.ITenant=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.Tenant} Tenant instance + */ + Tenant.create = function create(properties) { + return new Tenant(properties); + }; + + /** + * Encodes the specified Tenant message. Does not implicitly {@link google.cloud.talent.v4beta1.Tenant.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.Tenant + * @static + * @param {google.cloud.talent.v4beta1.ITenant} message Tenant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tenant.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.externalId != null && Object.hasOwnProperty.call(message, "externalId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.externalId); + if (message.usageType != null && Object.hasOwnProperty.call(message, "usageType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.usageType); + if (message.keywordSearchableProfileCustomAttributes != null && message.keywordSearchableProfileCustomAttributes.length) + for (var i = 0; i < message.keywordSearchableProfileCustomAttributes.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.keywordSearchableProfileCustomAttributes[i]); + return writer; + }; + + /** + * Encodes the specified Tenant message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.Tenant.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.Tenant + * @static + * @param {google.cloud.talent.v4beta1.ITenant} message Tenant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tenant.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tenant message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.Tenant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.Tenant} Tenant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tenant.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.Tenant(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.externalId = reader.string(); + break; + } + case 3: { + message.usageType = reader.int32(); + break; + } + case 4: { + if (!(message.keywordSearchableProfileCustomAttributes && message.keywordSearchableProfileCustomAttributes.length)) + message.keywordSearchableProfileCustomAttributes = []; + message.keywordSearchableProfileCustomAttributes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tenant message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.Tenant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.Tenant} Tenant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tenant.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tenant message. + * @function verify + * @memberof google.cloud.talent.v4beta1.Tenant + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tenant.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.externalId != null && message.hasOwnProperty("externalId")) + if (!$util.isString(message.externalId)) + return "externalId: string expected"; + if (message.usageType != null && message.hasOwnProperty("usageType")) + switch (message.usageType) { + default: + return "usageType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.keywordSearchableProfileCustomAttributes != null && message.hasOwnProperty("keywordSearchableProfileCustomAttributes")) { + if (!Array.isArray(message.keywordSearchableProfileCustomAttributes)) + return "keywordSearchableProfileCustomAttributes: array expected"; + for (var i = 0; i < message.keywordSearchableProfileCustomAttributes.length; ++i) + if (!$util.isString(message.keywordSearchableProfileCustomAttributes[i])) + return "keywordSearchableProfileCustomAttributes: string[] expected"; + } + return null; + }; + + /** + * Creates a Tenant message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.Tenant + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.Tenant} Tenant + */ + Tenant.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.Tenant) + return object; + var message = new $root.google.cloud.talent.v4beta1.Tenant(); + if (object.name != null) + message.name = String(object.name); + if (object.externalId != null) + message.externalId = String(object.externalId); + switch (object.usageType) { + default: + if (typeof object.usageType === "number") { + message.usageType = object.usageType; + break; + } + break; + case "DATA_USAGE_TYPE_UNSPECIFIED": + case 0: + message.usageType = 0; + break; + case "AGGREGATED": + case 1: + message.usageType = 1; + break; + case "ISOLATED": + case 2: + message.usageType = 2; + break; + } + if (object.keywordSearchableProfileCustomAttributes) { + if (!Array.isArray(object.keywordSearchableProfileCustomAttributes)) + throw TypeError(".google.cloud.talent.v4beta1.Tenant.keywordSearchableProfileCustomAttributes: array expected"); + message.keywordSearchableProfileCustomAttributes = []; + for (var i = 0; i < object.keywordSearchableProfileCustomAttributes.length; ++i) + message.keywordSearchableProfileCustomAttributes[i] = String(object.keywordSearchableProfileCustomAttributes[i]); + } + return message; + }; + + /** + * Creates a plain object from a Tenant message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.Tenant + * @static + * @param {google.cloud.talent.v4beta1.Tenant} message Tenant + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tenant.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keywordSearchableProfileCustomAttributes = []; + if (options.defaults) { + object.name = ""; + object.externalId = ""; + object.usageType = options.enums === String ? "DATA_USAGE_TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.externalId != null && message.hasOwnProperty("externalId")) + object.externalId = message.externalId; + if (message.usageType != null && message.hasOwnProperty("usageType")) + object.usageType = options.enums === String ? $root.google.cloud.talent.v4beta1.Tenant.DataUsageType[message.usageType] === undefined ? message.usageType : $root.google.cloud.talent.v4beta1.Tenant.DataUsageType[message.usageType] : message.usageType; + if (message.keywordSearchableProfileCustomAttributes && message.keywordSearchableProfileCustomAttributes.length) { + object.keywordSearchableProfileCustomAttributes = []; + for (var j = 0; j < message.keywordSearchableProfileCustomAttributes.length; ++j) + object.keywordSearchableProfileCustomAttributes[j] = message.keywordSearchableProfileCustomAttributes[j]; + } + return object; + }; + + /** + * Converts this Tenant to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.Tenant + * @instance + * @returns {Object.} JSON object + */ + Tenant.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Tenant + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.Tenant + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Tenant.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.Tenant"; + }; + + /** + * DataUsageType enum. + * @name google.cloud.talent.v4beta1.Tenant.DataUsageType + * @enum {number} + * @property {number} DATA_USAGE_TYPE_UNSPECIFIED=0 DATA_USAGE_TYPE_UNSPECIFIED value + * @property {number} AGGREGATED=1 AGGREGATED value + * @property {number} ISOLATED=2 ISOLATED value + */ + Tenant.DataUsageType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_USAGE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AGGREGATED"] = 1; + values[valuesById[2] = "ISOLATED"] = 2; + return values; + })(); + + return Tenant; + })(); + + v4beta1.TenantService = (function() { + + /** + * Constructs a new TenantService service. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a TenantService + * @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 TenantService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TenantService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TenantService; + + /** + * Creates new TenantService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.talent.v4beta1.TenantService + * @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 {TenantService} RPC service. Useful where requests and/or responses are streamed. + */ + TenantService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.TenantService|createTenant}. + * @memberof google.cloud.talent.v4beta1.TenantService + * @typedef CreateTenantCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4beta1.Tenant} [response] Tenant + */ + + /** + * Calls CreateTenant. + * @function createTenant + * @memberof google.cloud.talent.v4beta1.TenantService + * @instance + * @param {google.cloud.talent.v4beta1.ICreateTenantRequest} request CreateTenantRequest message or plain object + * @param {google.cloud.talent.v4beta1.TenantService.CreateTenantCallback} callback Node-style callback called with the error, if any, and Tenant + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TenantService.prototype.createTenant = function createTenant(request, callback) { + return this.rpcCall(createTenant, $root.google.cloud.talent.v4beta1.CreateTenantRequest, $root.google.cloud.talent.v4beta1.Tenant, request, callback); + }, "name", { value: "CreateTenant" }); + + /** + * Calls CreateTenant. + * @function createTenant + * @memberof google.cloud.talent.v4beta1.TenantService + * @instance + * @param {google.cloud.talent.v4beta1.ICreateTenantRequest} request CreateTenantRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.TenantService|getTenant}. + * @memberof google.cloud.talent.v4beta1.TenantService + * @typedef GetTenantCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4beta1.Tenant} [response] Tenant + */ + + /** + * Calls GetTenant. + * @function getTenant + * @memberof google.cloud.talent.v4beta1.TenantService + * @instance + * @param {google.cloud.talent.v4beta1.IGetTenantRequest} request GetTenantRequest message or plain object + * @param {google.cloud.talent.v4beta1.TenantService.GetTenantCallback} callback Node-style callback called with the error, if any, and Tenant + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TenantService.prototype.getTenant = function getTenant(request, callback) { + return this.rpcCall(getTenant, $root.google.cloud.talent.v4beta1.GetTenantRequest, $root.google.cloud.talent.v4beta1.Tenant, request, callback); + }, "name", { value: "GetTenant" }); + + /** + * Calls GetTenant. + * @function getTenant + * @memberof google.cloud.talent.v4beta1.TenantService + * @instance + * @param {google.cloud.talent.v4beta1.IGetTenantRequest} request GetTenantRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.TenantService|updateTenant}. + * @memberof google.cloud.talent.v4beta1.TenantService + * @typedef UpdateTenantCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4beta1.Tenant} [response] Tenant + */ + + /** + * Calls UpdateTenant. + * @function updateTenant + * @memberof google.cloud.talent.v4beta1.TenantService + * @instance + * @param {google.cloud.talent.v4beta1.IUpdateTenantRequest} request UpdateTenantRequest message or plain object + * @param {google.cloud.talent.v4beta1.TenantService.UpdateTenantCallback} callback Node-style callback called with the error, if any, and Tenant + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TenantService.prototype.updateTenant = function updateTenant(request, callback) { + return this.rpcCall(updateTenant, $root.google.cloud.talent.v4beta1.UpdateTenantRequest, $root.google.cloud.talent.v4beta1.Tenant, request, callback); + }, "name", { value: "UpdateTenant" }); + + /** + * Calls UpdateTenant. + * @function updateTenant + * @memberof google.cloud.talent.v4beta1.TenantService + * @instance + * @param {google.cloud.talent.v4beta1.IUpdateTenantRequest} request UpdateTenantRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.TenantService|deleteTenant}. + * @memberof google.cloud.talent.v4beta1.TenantService + * @typedef DeleteTenantCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTenant. + * @function deleteTenant + * @memberof google.cloud.talent.v4beta1.TenantService + * @instance + * @param {google.cloud.talent.v4beta1.IDeleteTenantRequest} request DeleteTenantRequest message or plain object + * @param {google.cloud.talent.v4beta1.TenantService.DeleteTenantCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TenantService.prototype.deleteTenant = function deleteTenant(request, callback) { + return this.rpcCall(deleteTenant, $root.google.cloud.talent.v4beta1.DeleteTenantRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTenant" }); + + /** + * Calls DeleteTenant. + * @function deleteTenant + * @memberof google.cloud.talent.v4beta1.TenantService + * @instance + * @param {google.cloud.talent.v4beta1.IDeleteTenantRequest} request DeleteTenantRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.talent.v4beta1.TenantService|listTenants}. + * @memberof google.cloud.talent.v4beta1.TenantService + * @typedef ListTenantsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.talent.v4beta1.ListTenantsResponse} [response] ListTenantsResponse + */ + + /** + * Calls ListTenants. + * @function listTenants + * @memberof google.cloud.talent.v4beta1.TenantService + * @instance + * @param {google.cloud.talent.v4beta1.IListTenantsRequest} request ListTenantsRequest message or plain object + * @param {google.cloud.talent.v4beta1.TenantService.ListTenantsCallback} callback Node-style callback called with the error, if any, and ListTenantsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TenantService.prototype.listTenants = function listTenants(request, callback) { + return this.rpcCall(listTenants, $root.google.cloud.talent.v4beta1.ListTenantsRequest, $root.google.cloud.talent.v4beta1.ListTenantsResponse, request, callback); + }, "name", { value: "ListTenants" }); + + /** + * Calls ListTenants. + * @function listTenants + * @memberof google.cloud.talent.v4beta1.TenantService + * @instance + * @param {google.cloud.talent.v4beta1.IListTenantsRequest} request ListTenantsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TenantService; + })(); + + v4beta1.CreateTenantRequest = (function() { + + /** + * Properties of a CreateTenantRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface ICreateTenantRequest + * @property {string|null} [parent] CreateTenantRequest parent + * @property {google.cloud.talent.v4beta1.ITenant|null} [tenant] CreateTenantRequest tenant + */ + + /** + * Constructs a new CreateTenantRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a CreateTenantRequest. + * @implements ICreateTenantRequest + * @constructor + * @param {google.cloud.talent.v4beta1.ICreateTenantRequest=} [properties] Properties to set + */ + function CreateTenantRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTenantRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4beta1.CreateTenantRequest + * @instance + */ + CreateTenantRequest.prototype.parent = ""; + + /** + * CreateTenantRequest tenant. + * @member {google.cloud.talent.v4beta1.ITenant|null|undefined} tenant + * @memberof google.cloud.talent.v4beta1.CreateTenantRequest + * @instance + */ + CreateTenantRequest.prototype.tenant = null; + + /** + * Creates a new CreateTenantRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.CreateTenantRequest + * @static + * @param {google.cloud.talent.v4beta1.ICreateTenantRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.CreateTenantRequest} CreateTenantRequest instance + */ + CreateTenantRequest.create = function create(properties) { + return new CreateTenantRequest(properties); + }; + + /** + * Encodes the specified CreateTenantRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.CreateTenantRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.CreateTenantRequest + * @static + * @param {google.cloud.talent.v4beta1.ICreateTenantRequest} message CreateTenantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTenantRequest.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.tenant != null && Object.hasOwnProperty.call(message, "tenant")) + $root.google.cloud.talent.v4beta1.Tenant.encode(message.tenant, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateTenantRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.CreateTenantRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.CreateTenantRequest + * @static + * @param {google.cloud.talent.v4beta1.ICreateTenantRequest} message CreateTenantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTenantRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTenantRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.CreateTenantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.CreateTenantRequest} CreateTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTenantRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.CreateTenantRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.tenant = $root.google.cloud.talent.v4beta1.Tenant.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTenantRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.CreateTenantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.CreateTenantRequest} CreateTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTenantRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTenantRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.CreateTenantRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTenantRequest.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.tenant != null && message.hasOwnProperty("tenant")) { + var error = $root.google.cloud.talent.v4beta1.Tenant.verify(message.tenant); + if (error) + return "tenant." + error; + } + return null; + }; + + /** + * Creates a CreateTenantRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.CreateTenantRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.CreateTenantRequest} CreateTenantRequest + */ + CreateTenantRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.CreateTenantRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.CreateTenantRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tenant != null) { + if (typeof object.tenant !== "object") + throw TypeError(".google.cloud.talent.v4beta1.CreateTenantRequest.tenant: object expected"); + message.tenant = $root.google.cloud.talent.v4beta1.Tenant.fromObject(object.tenant); + } + return message; + }; + + /** + * Creates a plain object from a CreateTenantRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.CreateTenantRequest + * @static + * @param {google.cloud.talent.v4beta1.CreateTenantRequest} message CreateTenantRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTenantRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.tenant = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tenant != null && message.hasOwnProperty("tenant")) + object.tenant = $root.google.cloud.talent.v4beta1.Tenant.toObject(message.tenant, options); + return object; + }; + + /** + * Converts this CreateTenantRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.CreateTenantRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTenantRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTenantRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.CreateTenantRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTenantRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.CreateTenantRequest"; + }; + + return CreateTenantRequest; + })(); + + v4beta1.GetTenantRequest = (function() { + + /** + * Properties of a GetTenantRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface IGetTenantRequest + * @property {string|null} [name] GetTenantRequest name + */ + + /** + * Constructs a new GetTenantRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a GetTenantRequest. + * @implements IGetTenantRequest + * @constructor + * @param {google.cloud.talent.v4beta1.IGetTenantRequest=} [properties] Properties to set + */ + function GetTenantRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTenantRequest name. + * @member {string} name + * @memberof google.cloud.talent.v4beta1.GetTenantRequest + * @instance + */ + GetTenantRequest.prototype.name = ""; + + /** + * Creates a new GetTenantRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.GetTenantRequest + * @static + * @param {google.cloud.talent.v4beta1.IGetTenantRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.GetTenantRequest} GetTenantRequest instance + */ + GetTenantRequest.create = function create(properties) { + return new GetTenantRequest(properties); + }; + + /** + * Encodes the specified GetTenantRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.GetTenantRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.GetTenantRequest + * @static + * @param {google.cloud.talent.v4beta1.IGetTenantRequest} message GetTenantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTenantRequest.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 GetTenantRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.GetTenantRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.GetTenantRequest + * @static + * @param {google.cloud.talent.v4beta1.IGetTenantRequest} message GetTenantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTenantRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTenantRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.GetTenantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.GetTenantRequest} GetTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTenantRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.GetTenantRequest(); + 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 GetTenantRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.GetTenantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.GetTenantRequest} GetTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTenantRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTenantRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.GetTenantRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTenantRequest.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 GetTenantRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.GetTenantRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.GetTenantRequest} GetTenantRequest + */ + GetTenantRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.GetTenantRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.GetTenantRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTenantRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.GetTenantRequest + * @static + * @param {google.cloud.talent.v4beta1.GetTenantRequest} message GetTenantRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTenantRequest.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 GetTenantRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.GetTenantRequest + * @instance + * @returns {Object.} JSON object + */ + GetTenantRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTenantRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.GetTenantRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTenantRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.GetTenantRequest"; + }; + + return GetTenantRequest; + })(); + + v4beta1.UpdateTenantRequest = (function() { + + /** + * Properties of an UpdateTenantRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface IUpdateTenantRequest + * @property {google.cloud.talent.v4beta1.ITenant|null} [tenant] UpdateTenantRequest tenant + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTenantRequest updateMask + */ + + /** + * Constructs a new UpdateTenantRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents an UpdateTenantRequest. + * @implements IUpdateTenantRequest + * @constructor + * @param {google.cloud.talent.v4beta1.IUpdateTenantRequest=} [properties] Properties to set + */ + function UpdateTenantRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTenantRequest tenant. + * @member {google.cloud.talent.v4beta1.ITenant|null|undefined} tenant + * @memberof google.cloud.talent.v4beta1.UpdateTenantRequest + * @instance + */ + UpdateTenantRequest.prototype.tenant = null; + + /** + * UpdateTenantRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.talent.v4beta1.UpdateTenantRequest + * @instance + */ + UpdateTenantRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateTenantRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.UpdateTenantRequest + * @static + * @param {google.cloud.talent.v4beta1.IUpdateTenantRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.UpdateTenantRequest} UpdateTenantRequest instance + */ + UpdateTenantRequest.create = function create(properties) { + return new UpdateTenantRequest(properties); + }; + + /** + * Encodes the specified UpdateTenantRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.UpdateTenantRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.UpdateTenantRequest + * @static + * @param {google.cloud.talent.v4beta1.IUpdateTenantRequest} message UpdateTenantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTenantRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tenant != null && Object.hasOwnProperty.call(message, "tenant")) + $root.google.cloud.talent.v4beta1.Tenant.encode(message.tenant, 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 UpdateTenantRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.UpdateTenantRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.UpdateTenantRequest + * @static + * @param {google.cloud.talent.v4beta1.IUpdateTenantRequest} message UpdateTenantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTenantRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTenantRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.UpdateTenantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.UpdateTenantRequest} UpdateTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTenantRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.UpdateTenantRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tenant = $root.google.cloud.talent.v4beta1.Tenant.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 UpdateTenantRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.UpdateTenantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.UpdateTenantRequest} UpdateTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTenantRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTenantRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.UpdateTenantRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTenantRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tenant != null && message.hasOwnProperty("tenant")) { + var error = $root.google.cloud.talent.v4beta1.Tenant.verify(message.tenant); + if (error) + return "tenant." + 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 UpdateTenantRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.UpdateTenantRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.UpdateTenantRequest} UpdateTenantRequest + */ + UpdateTenantRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.UpdateTenantRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.UpdateTenantRequest(); + if (object.tenant != null) { + if (typeof object.tenant !== "object") + throw TypeError(".google.cloud.talent.v4beta1.UpdateTenantRequest.tenant: object expected"); + message.tenant = $root.google.cloud.talent.v4beta1.Tenant.fromObject(object.tenant); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.talent.v4beta1.UpdateTenantRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateTenantRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.UpdateTenantRequest + * @static + * @param {google.cloud.talent.v4beta1.UpdateTenantRequest} message UpdateTenantRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTenantRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tenant = null; + object.updateMask = null; + } + if (message.tenant != null && message.hasOwnProperty("tenant")) + object.tenant = $root.google.cloud.talent.v4beta1.Tenant.toObject(message.tenant, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateTenantRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.UpdateTenantRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTenantRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTenantRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.UpdateTenantRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTenantRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.UpdateTenantRequest"; + }; + + return UpdateTenantRequest; + })(); + + v4beta1.DeleteTenantRequest = (function() { + + /** + * Properties of a DeleteTenantRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface IDeleteTenantRequest + * @property {string|null} [name] DeleteTenantRequest name + */ + + /** + * Constructs a new DeleteTenantRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a DeleteTenantRequest. + * @implements IDeleteTenantRequest + * @constructor + * @param {google.cloud.talent.v4beta1.IDeleteTenantRequest=} [properties] Properties to set + */ + function DeleteTenantRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTenantRequest name. + * @member {string} name + * @memberof google.cloud.talent.v4beta1.DeleteTenantRequest + * @instance + */ + DeleteTenantRequest.prototype.name = ""; + + /** + * Creates a new DeleteTenantRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.DeleteTenantRequest + * @static + * @param {google.cloud.talent.v4beta1.IDeleteTenantRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.DeleteTenantRequest} DeleteTenantRequest instance + */ + DeleteTenantRequest.create = function create(properties) { + return new DeleteTenantRequest(properties); + }; + + /** + * Encodes the specified DeleteTenantRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.DeleteTenantRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.DeleteTenantRequest + * @static + * @param {google.cloud.talent.v4beta1.IDeleteTenantRequest} message DeleteTenantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTenantRequest.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 DeleteTenantRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.DeleteTenantRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.DeleteTenantRequest + * @static + * @param {google.cloud.talent.v4beta1.IDeleteTenantRequest} message DeleteTenantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTenantRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTenantRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.DeleteTenantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.DeleteTenantRequest} DeleteTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTenantRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.DeleteTenantRequest(); + 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 DeleteTenantRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.DeleteTenantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.DeleteTenantRequest} DeleteTenantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTenantRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTenantRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.DeleteTenantRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTenantRequest.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 DeleteTenantRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.DeleteTenantRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.DeleteTenantRequest} DeleteTenantRequest + */ + DeleteTenantRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.DeleteTenantRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.DeleteTenantRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteTenantRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.DeleteTenantRequest + * @static + * @param {google.cloud.talent.v4beta1.DeleteTenantRequest} message DeleteTenantRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTenantRequest.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 DeleteTenantRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.DeleteTenantRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTenantRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTenantRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.DeleteTenantRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTenantRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.DeleteTenantRequest"; + }; + + return DeleteTenantRequest; + })(); + + v4beta1.ListTenantsRequest = (function() { + + /** + * Properties of a ListTenantsRequest. + * @memberof google.cloud.talent.v4beta1 + * @interface IListTenantsRequest + * @property {string|null} [parent] ListTenantsRequest parent + * @property {string|null} [pageToken] ListTenantsRequest pageToken + * @property {number|null} [pageSize] ListTenantsRequest pageSize + */ + + /** + * Constructs a new ListTenantsRequest. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a ListTenantsRequest. + * @implements IListTenantsRequest + * @constructor + * @param {google.cloud.talent.v4beta1.IListTenantsRequest=} [properties] Properties to set + */ + function ListTenantsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTenantsRequest parent. + * @member {string} parent + * @memberof google.cloud.talent.v4beta1.ListTenantsRequest + * @instance + */ + ListTenantsRequest.prototype.parent = ""; + + /** + * ListTenantsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.talent.v4beta1.ListTenantsRequest + * @instance + */ + ListTenantsRequest.prototype.pageToken = ""; + + /** + * ListTenantsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.talent.v4beta1.ListTenantsRequest + * @instance + */ + ListTenantsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListTenantsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.ListTenantsRequest + * @static + * @param {google.cloud.talent.v4beta1.IListTenantsRequest=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.ListTenantsRequest} ListTenantsRequest instance + */ + ListTenantsRequest.create = function create(properties) { + return new ListTenantsRequest(properties); + }; + + /** + * Encodes the specified ListTenantsRequest message. Does not implicitly {@link google.cloud.talent.v4beta1.ListTenantsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.ListTenantsRequest + * @static + * @param {google.cloud.talent.v4beta1.IListTenantsRequest} message ListTenantsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTenantsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListTenantsRequest message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.ListTenantsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.ListTenantsRequest + * @static + * @param {google.cloud.talent.v4beta1.IListTenantsRequest} message ListTenantsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTenantsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTenantsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.ListTenantsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.ListTenantsRequest} ListTenantsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTenantsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.ListTenantsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTenantsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.ListTenantsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.ListTenantsRequest} ListTenantsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTenantsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTenantsRequest message. + * @function verify + * @memberof google.cloud.talent.v4beta1.ListTenantsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTenantsRequest.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.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListTenantsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.ListTenantsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.ListTenantsRequest} ListTenantsRequest + */ + ListTenantsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.ListTenantsRequest) + return object; + var message = new $root.google.cloud.talent.v4beta1.ListTenantsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListTenantsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.ListTenantsRequest + * @static + * @param {google.cloud.talent.v4beta1.ListTenantsRequest} message ListTenantsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTenantsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListTenantsRequest to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.ListTenantsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTenantsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTenantsRequest + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.ListTenantsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTenantsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.ListTenantsRequest"; + }; + + return ListTenantsRequest; + })(); + + v4beta1.ListTenantsResponse = (function() { + + /** + * Properties of a ListTenantsResponse. + * @memberof google.cloud.talent.v4beta1 + * @interface IListTenantsResponse + * @property {Array.|null} [tenants] ListTenantsResponse tenants + * @property {string|null} [nextPageToken] ListTenantsResponse nextPageToken + * @property {google.cloud.talent.v4beta1.IResponseMetadata|null} [metadata] ListTenantsResponse metadata + */ + + /** + * Constructs a new ListTenantsResponse. + * @memberof google.cloud.talent.v4beta1 + * @classdesc Represents a ListTenantsResponse. + * @implements IListTenantsResponse + * @constructor + * @param {google.cloud.talent.v4beta1.IListTenantsResponse=} [properties] Properties to set + */ + function ListTenantsResponse(properties) { + this.tenants = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTenantsResponse tenants. + * @member {Array.} tenants + * @memberof google.cloud.talent.v4beta1.ListTenantsResponse + * @instance + */ + ListTenantsResponse.prototype.tenants = $util.emptyArray; + + /** + * ListTenantsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.talent.v4beta1.ListTenantsResponse + * @instance + */ + ListTenantsResponse.prototype.nextPageToken = ""; + + /** + * ListTenantsResponse metadata. + * @member {google.cloud.talent.v4beta1.IResponseMetadata|null|undefined} metadata + * @memberof google.cloud.talent.v4beta1.ListTenantsResponse + * @instance + */ + ListTenantsResponse.prototype.metadata = null; + + /** + * Creates a new ListTenantsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.talent.v4beta1.ListTenantsResponse + * @static + * @param {google.cloud.talent.v4beta1.IListTenantsResponse=} [properties] Properties to set + * @returns {google.cloud.talent.v4beta1.ListTenantsResponse} ListTenantsResponse instance + */ + ListTenantsResponse.create = function create(properties) { + return new ListTenantsResponse(properties); + }; + + /** + * Encodes the specified ListTenantsResponse message. Does not implicitly {@link google.cloud.talent.v4beta1.ListTenantsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.talent.v4beta1.ListTenantsResponse + * @static + * @param {google.cloud.talent.v4beta1.IListTenantsResponse} message ListTenantsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTenantsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tenants != null && message.tenants.length) + for (var i = 0; i < message.tenants.length; ++i) + $root.google.cloud.talent.v4beta1.Tenant.encode(message.tenants[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.talent.v4beta1.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListTenantsResponse message, length delimited. Does not implicitly {@link google.cloud.talent.v4beta1.ListTenantsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.talent.v4beta1.ListTenantsResponse + * @static + * @param {google.cloud.talent.v4beta1.IListTenantsResponse} message ListTenantsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTenantsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTenantsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.talent.v4beta1.ListTenantsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.talent.v4beta1.ListTenantsResponse} ListTenantsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTenantsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.talent.v4beta1.ListTenantsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tenants && message.tenants.length)) + message.tenants = []; + message.tenants.push($root.google.cloud.talent.v4beta1.Tenant.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.metadata = $root.google.cloud.talent.v4beta1.ResponseMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTenantsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.talent.v4beta1.ListTenantsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.talent.v4beta1.ListTenantsResponse} ListTenantsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTenantsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTenantsResponse message. + * @function verify + * @memberof google.cloud.talent.v4beta1.ListTenantsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTenantsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tenants != null && message.hasOwnProperty("tenants")) { + if (!Array.isArray(message.tenants)) + return "tenants: array expected"; + for (var i = 0; i < message.tenants.length; ++i) { + var error = $root.google.cloud.talent.v4beta1.Tenant.verify(message.tenants[i]); + if (error) + return "tenants." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.talent.v4beta1.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a ListTenantsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.talent.v4beta1.ListTenantsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.talent.v4beta1.ListTenantsResponse} ListTenantsResponse + */ + ListTenantsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.talent.v4beta1.ListTenantsResponse) + return object; + var message = new $root.google.cloud.talent.v4beta1.ListTenantsResponse(); + if (object.tenants) { + if (!Array.isArray(object.tenants)) + throw TypeError(".google.cloud.talent.v4beta1.ListTenantsResponse.tenants: array expected"); + message.tenants = []; + for (var i = 0; i < object.tenants.length; ++i) { + if (typeof object.tenants[i] !== "object") + throw TypeError(".google.cloud.talent.v4beta1.ListTenantsResponse.tenants: object expected"); + message.tenants[i] = $root.google.cloud.talent.v4beta1.Tenant.fromObject(object.tenants[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.talent.v4beta1.ListTenantsResponse.metadata: object expected"); + message.metadata = $root.google.cloud.talent.v4beta1.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a ListTenantsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.talent.v4beta1.ListTenantsResponse + * @static + * @param {google.cloud.talent.v4beta1.ListTenantsResponse} message ListTenantsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTenantsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tenants = []; + if (options.defaults) { + object.nextPageToken = ""; + object.metadata = null; + } + if (message.tenants && message.tenants.length) { + object.tenants = []; + for (var j = 0; j < message.tenants.length; ++j) + object.tenants[j] = $root.google.cloud.talent.v4beta1.Tenant.toObject(message.tenants[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.talent.v4beta1.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this ListTenantsResponse to JSON. + * @function toJSON + * @memberof google.cloud.talent.v4beta1.ListTenantsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTenantsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTenantsResponse + * @function getTypeUrl + * @memberof google.cloud.talent.v4beta1.ListTenantsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTenantsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.talent.v4beta1.ListTenantsResponse"; + }; + + return ListTenantsResponse; + })(); + + return v4beta1; + })(); + + return talent; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {string|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 13: { + message.edition = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.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.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function 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.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function 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.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function 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.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.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.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function 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.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function 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.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function 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.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function 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.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.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); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function 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.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.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"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.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).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function 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.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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 a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + 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 a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + 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 BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + 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.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.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; + })(); + + return protobuf; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.LatLng = (function() { + + /** + * Properties of a LatLng. + * @memberof google.type + * @interface ILatLng + * @property {number|null} [latitude] LatLng latitude + * @property {number|null} [longitude] LatLng longitude + */ + + /** + * Constructs a new LatLng. + * @memberof google.type + * @classdesc Represents a LatLng. + * @implements ILatLng + * @constructor + * @param {google.type.ILatLng=} [properties] Properties to set + */ + function LatLng(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LatLng latitude. + * @member {number} latitude + * @memberof google.type.LatLng + * @instance + */ + LatLng.prototype.latitude = 0; + + /** + * LatLng longitude. + * @member {number} longitude + * @memberof google.type.LatLng + * @instance + */ + LatLng.prototype.longitude = 0; + + /** + * Creates a new LatLng instance using the specified properties. + * @function create + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng=} [properties] Properties to set + * @returns {google.type.LatLng} LatLng instance + */ + LatLng.create = function create(properties) { + return new LatLng(properties); + }; + + /** + * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @function encode + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng} message LatLng message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLng.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latitude != null && Object.hasOwnProperty.call(message, "latitude")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.latitude); + if (message.longitude != null && Object.hasOwnProperty.call(message, "longitude")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.longitude); + return writer; + }; + + /** + * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng} message LatLng message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLng.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LatLng message from the specified reader or buffer. + * @function decode + * @memberof google.type.LatLng + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.LatLng} LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLng.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.LatLng(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.latitude = reader.double(); + break; + } + case 2: { + message.longitude = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LatLng message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.LatLng + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.LatLng} LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLng.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LatLng message. + * @function verify + * @memberof google.type.LatLng + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LatLng.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latitude != null && message.hasOwnProperty("latitude")) + if (typeof message.latitude !== "number") + return "latitude: number expected"; + if (message.longitude != null && message.hasOwnProperty("longitude")) + if (typeof message.longitude !== "number") + return "longitude: number expected"; + return null; + }; + + /** + * Creates a LatLng message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.LatLng + * @static + * @param {Object.} object Plain object + * @returns {google.type.LatLng} LatLng + */ + LatLng.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.LatLng) + return object; + var message = new $root.google.type.LatLng(); + if (object.latitude != null) + message.latitude = Number(object.latitude); + if (object.longitude != null) + message.longitude = Number(object.longitude); + return message; + }; + + /** + * Creates a plain object from a LatLng message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.LatLng + * @static + * @param {google.type.LatLng} message LatLng + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LatLng.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.latitude = 0; + object.longitude = 0; + } + if (message.latitude != null && message.hasOwnProperty("latitude")) + object.latitude = options.json && !isFinite(message.latitude) ? String(message.latitude) : message.latitude; + if (message.longitude != null && message.hasOwnProperty("longitude")) + object.longitude = options.json && !isFinite(message.longitude) ? String(message.longitude) : message.longitude; + return object; + }; + + /** + * Converts this LatLng to JSON. + * @function toJSON + * @memberof google.type.LatLng + * @instance + * @returns {Object.} JSON object + */ + LatLng.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LatLng + * @function getTypeUrl + * @memberof google.type.LatLng + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LatLng.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.LatLng"; + }; + + return LatLng; + })(); + + type.Money = (function() { + + /** + * Properties of a Money. + * @memberof google.type + * @interface IMoney + * @property {string|null} [currencyCode] Money currencyCode + * @property {number|Long|null} [units] Money units + * @property {number|null} [nanos] Money nanos + */ + + /** + * Constructs a new Money. + * @memberof google.type + * @classdesc Represents a Money. + * @implements IMoney + * @constructor + * @param {google.type.IMoney=} [properties] Properties to set + */ + function Money(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Money currencyCode. + * @member {string} currencyCode + * @memberof google.type.Money + * @instance + */ + Money.prototype.currencyCode = ""; + + /** + * Money units. + * @member {number|Long} units + * @memberof google.type.Money + * @instance + */ + Money.prototype.units = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Money nanos. + * @member {number} nanos + * @memberof google.type.Money + * @instance + */ + Money.prototype.nanos = 0; + + /** + * Creates a new Money instance using the specified properties. + * @function create + * @memberof google.type.Money + * @static + * @param {google.type.IMoney=} [properties] Properties to set + * @returns {google.type.Money} Money instance + */ + Money.create = function create(properties) { + return new Money(properties); + }; + + /** + * Encodes the specified Money message. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @function encode + * @memberof google.type.Money + * @static + * @param {google.type.IMoney} message Money message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Money.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.currencyCode); + if (message.units != null && Object.hasOwnProperty.call(message, "units")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.units); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Money message, length delimited. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Money + * @static + * @param {google.type.IMoney} message Money message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Money.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Money message from the specified reader or buffer. + * @function decode + * @memberof google.type.Money + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Money} Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Money.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Money(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.currencyCode = reader.string(); + break; + } + case 2: { + message.units = reader.int64(); + break; + } + case 3: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Money message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Money + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Money} Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Money.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Money message. + * @function verify + * @memberof google.type.Money + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Money.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + if (message.units != null && message.hasOwnProperty("units")) + if (!$util.isInteger(message.units) && !(message.units && $util.isInteger(message.units.low) && $util.isInteger(message.units.high))) + return "units: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Money message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Money + * @static + * @param {Object.} object Plain object + * @returns {google.type.Money} Money + */ + Money.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Money) + return object; + var message = new $root.google.type.Money(); + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + if (object.units != null) + if ($util.Long) + (message.units = $util.Long.fromValue(object.units)).unsigned = false; + else if (typeof object.units === "string") + message.units = parseInt(object.units, 10); + else if (typeof object.units === "number") + message.units = object.units; + else if (typeof object.units === "object") + message.units = new $util.LongBits(object.units.low >>> 0, object.units.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Money message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Money + * @static + * @param {google.type.Money} message Money + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Money.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.currencyCode = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.units = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.units = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; + if (message.units != null && message.hasOwnProperty("units")) + if (typeof message.units === "number") + object.units = options.longs === String ? String(message.units) : message.units; + else + object.units = options.longs === String ? $util.Long.prototype.toString.call(message.units) : options.longs === Number ? new $util.LongBits(message.units.low >>> 0, message.units.high >>> 0).toNumber() : message.units; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Money to JSON. + * @function toJSON + * @memberof google.type.Money + * @instance + * @returns {Object.} JSON object + */ + Money.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Money + * @function getTypeUrl + * @memberof google.type.Money + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Money.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Money"; + }; + + return Money; + })(); + + type.PostalAddress = (function() { + + /** + * Properties of a PostalAddress. + * @memberof google.type + * @interface IPostalAddress + * @property {number|null} [revision] PostalAddress revision + * @property {string|null} [regionCode] PostalAddress regionCode + * @property {string|null} [languageCode] PostalAddress languageCode + * @property {string|null} [postalCode] PostalAddress postalCode + * @property {string|null} [sortingCode] PostalAddress sortingCode + * @property {string|null} [administrativeArea] PostalAddress administrativeArea + * @property {string|null} [locality] PostalAddress locality + * @property {string|null} [sublocality] PostalAddress sublocality + * @property {Array.|null} [addressLines] PostalAddress addressLines + * @property {Array.|null} [recipients] PostalAddress recipients + * @property {string|null} [organization] PostalAddress organization + */ + + /** + * Constructs a new PostalAddress. + * @memberof google.type + * @classdesc Represents a PostalAddress. + * @implements IPostalAddress + * @constructor + * @param {google.type.IPostalAddress=} [properties] Properties to set + */ + function PostalAddress(properties) { + this.addressLines = []; + this.recipients = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PostalAddress revision. + * @member {number} revision + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.revision = 0; + + /** + * PostalAddress regionCode. + * @member {string} regionCode + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.regionCode = ""; + + /** + * PostalAddress languageCode. + * @member {string} languageCode + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.languageCode = ""; + + /** + * PostalAddress postalCode. + * @member {string} postalCode + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.postalCode = ""; + + /** + * PostalAddress sortingCode. + * @member {string} sortingCode + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.sortingCode = ""; + + /** + * PostalAddress administrativeArea. + * @member {string} administrativeArea + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.administrativeArea = ""; + + /** + * PostalAddress locality. + * @member {string} locality + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.locality = ""; + + /** + * PostalAddress sublocality. + * @member {string} sublocality + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.sublocality = ""; + + /** + * PostalAddress addressLines. + * @member {Array.} addressLines + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.addressLines = $util.emptyArray; + + /** + * PostalAddress recipients. + * @member {Array.} recipients + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.recipients = $util.emptyArray; + + /** + * PostalAddress organization. + * @member {string} organization + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.organization = ""; + + /** + * Creates a new PostalAddress instance using the specified properties. + * @function create + * @memberof google.type.PostalAddress + * @static + * @param {google.type.IPostalAddress=} [properties] Properties to set + * @returns {google.type.PostalAddress} PostalAddress instance + */ + PostalAddress.create = function create(properties) { + return new PostalAddress(properties); + }; + + /** + * Encodes the specified PostalAddress message. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. + * @function encode + * @memberof google.type.PostalAddress + * @static + * @param {google.type.IPostalAddress} message PostalAddress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostalAddress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.revision); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.regionCode); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.postalCode != null && Object.hasOwnProperty.call(message, "postalCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.postalCode); + if (message.sortingCode != null && Object.hasOwnProperty.call(message, "sortingCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.sortingCode); + if (message.administrativeArea != null && Object.hasOwnProperty.call(message, "administrativeArea")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.administrativeArea); + if (message.locality != null && Object.hasOwnProperty.call(message, "locality")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.locality); + if (message.sublocality != null && Object.hasOwnProperty.call(message, "sublocality")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.sublocality); + if (message.addressLines != null && message.addressLines.length) + for (var i = 0; i < message.addressLines.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.addressLines[i]); + if (message.recipients != null && message.recipients.length) + for (var i = 0; i < message.recipients.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.recipients[i]); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.organization); + return writer; + }; + + /** + * Encodes the specified PostalAddress message, length delimited. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.PostalAddress + * @static + * @param {google.type.IPostalAddress} message PostalAddress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostalAddress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PostalAddress message from the specified reader or buffer. + * @function decode + * @memberof google.type.PostalAddress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.PostalAddress} PostalAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostalAddress.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.PostalAddress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.revision = reader.int32(); + break; + } + case 2: { + message.regionCode = reader.string(); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + case 4: { + message.postalCode = reader.string(); + break; + } + case 5: { + message.sortingCode = reader.string(); + break; + } + case 6: { + message.administrativeArea = reader.string(); + break; + } + case 7: { + message.locality = reader.string(); + break; + } + case 8: { + message.sublocality = reader.string(); + break; + } + case 9: { + if (!(message.addressLines && message.addressLines.length)) + message.addressLines = []; + message.addressLines.push(reader.string()); + break; + } + case 10: { + if (!(message.recipients && message.recipients.length)) + message.recipients = []; + message.recipients.push(reader.string()); + break; + } + case 11: { + message.organization = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PostalAddress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.PostalAddress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.PostalAddress} PostalAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostalAddress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PostalAddress message. + * @function verify + * @memberof google.type.PostalAddress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PostalAddress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.revision != null && message.hasOwnProperty("revision")) + if (!$util.isInteger(message.revision)) + return "revision: integer expected"; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.postalCode != null && message.hasOwnProperty("postalCode")) + if (!$util.isString(message.postalCode)) + return "postalCode: string expected"; + if (message.sortingCode != null && message.hasOwnProperty("sortingCode")) + if (!$util.isString(message.sortingCode)) + return "sortingCode: string expected"; + if (message.administrativeArea != null && message.hasOwnProperty("administrativeArea")) + if (!$util.isString(message.administrativeArea)) + return "administrativeArea: string expected"; + if (message.locality != null && message.hasOwnProperty("locality")) + if (!$util.isString(message.locality)) + return "locality: string expected"; + if (message.sublocality != null && message.hasOwnProperty("sublocality")) + if (!$util.isString(message.sublocality)) + return "sublocality: string expected"; + if (message.addressLines != null && message.hasOwnProperty("addressLines")) { + if (!Array.isArray(message.addressLines)) + return "addressLines: array expected"; + for (var i = 0; i < message.addressLines.length; ++i) + if (!$util.isString(message.addressLines[i])) + return "addressLines: string[] expected"; + } + if (message.recipients != null && message.hasOwnProperty("recipients")) { + if (!Array.isArray(message.recipients)) + return "recipients: array expected"; + for (var i = 0; i < message.recipients.length; ++i) + if (!$util.isString(message.recipients[i])) + return "recipients: string[] expected"; + } + if (message.organization != null && message.hasOwnProperty("organization")) + if (!$util.isString(message.organization)) + return "organization: string expected"; + return null; + }; + + /** + * Creates a PostalAddress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.PostalAddress + * @static + * @param {Object.} object Plain object + * @returns {google.type.PostalAddress} PostalAddress + */ + PostalAddress.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.PostalAddress) + return object; + var message = new $root.google.type.PostalAddress(); + if (object.revision != null) + message.revision = object.revision | 0; + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.postalCode != null) + message.postalCode = String(object.postalCode); + if (object.sortingCode != null) + message.sortingCode = String(object.sortingCode); + if (object.administrativeArea != null) + message.administrativeArea = String(object.administrativeArea); + if (object.locality != null) + message.locality = String(object.locality); + if (object.sublocality != null) + message.sublocality = String(object.sublocality); + if (object.addressLines) { + if (!Array.isArray(object.addressLines)) + throw TypeError(".google.type.PostalAddress.addressLines: array expected"); + message.addressLines = []; + for (var i = 0; i < object.addressLines.length; ++i) + message.addressLines[i] = String(object.addressLines[i]); + } + if (object.recipients) { + if (!Array.isArray(object.recipients)) + throw TypeError(".google.type.PostalAddress.recipients: array expected"); + message.recipients = []; + for (var i = 0; i < object.recipients.length; ++i) + message.recipients[i] = String(object.recipients[i]); + } + if (object.organization != null) + message.organization = String(object.organization); + return message; + }; + + /** + * Creates a plain object from a PostalAddress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.PostalAddress + * @static + * @param {google.type.PostalAddress} message PostalAddress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PostalAddress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.addressLines = []; + object.recipients = []; + } + if (options.defaults) { + object.revision = 0; + object.regionCode = ""; + object.languageCode = ""; + object.postalCode = ""; + object.sortingCode = ""; + object.administrativeArea = ""; + object.locality = ""; + object.sublocality = ""; + object.organization = ""; + } + if (message.revision != null && message.hasOwnProperty("revision")) + object.revision = message.revision; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.postalCode != null && message.hasOwnProperty("postalCode")) + object.postalCode = message.postalCode; + if (message.sortingCode != null && message.hasOwnProperty("sortingCode")) + object.sortingCode = message.sortingCode; + if (message.administrativeArea != null && message.hasOwnProperty("administrativeArea")) + object.administrativeArea = message.administrativeArea; + if (message.locality != null && message.hasOwnProperty("locality")) + object.locality = message.locality; + if (message.sublocality != null && message.hasOwnProperty("sublocality")) + object.sublocality = message.sublocality; + if (message.addressLines && message.addressLines.length) { + object.addressLines = []; + for (var j = 0; j < message.addressLines.length; ++j) + object.addressLines[j] = message.addressLines[j]; + } + if (message.recipients && message.recipients.length) { + object.recipients = []; + for (var j = 0; j < message.recipients.length; ++j) + object.recipients[j] = message.recipients[j]; + } + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = message.organization; + return object; + }; + + /** + * Converts this PostalAddress to JSON. + * @function toJSON + * @memberof google.type.PostalAddress + * @instance + * @returns {Object.} JSON object + */ + PostalAddress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PostalAddress + * @function getTypeUrl + * @memberof google.type.PostalAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PostalAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.PostalAddress"; + }; + + return PostalAddress; + })(); + + type.TimeOfDay = (function() { + + /** + * Properties of a TimeOfDay. + * @memberof google.type + * @interface ITimeOfDay + * @property {number|null} [hours] TimeOfDay hours + * @property {number|null} [minutes] TimeOfDay minutes + * @property {number|null} [seconds] TimeOfDay seconds + * @property {number|null} [nanos] TimeOfDay nanos + */ + + /** + * Constructs a new TimeOfDay. + * @memberof google.type + * @classdesc Represents a TimeOfDay. + * @implements ITimeOfDay + * @constructor + * @param {google.type.ITimeOfDay=} [properties] Properties to set + */ + function TimeOfDay(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeOfDay hours. + * @member {number} hours + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.hours = 0; + + /** + * TimeOfDay minutes. + * @member {number} minutes + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.minutes = 0; + + /** + * TimeOfDay seconds. + * @member {number} seconds + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.seconds = 0; + + /** + * TimeOfDay nanos. + * @member {number} nanos + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.nanos = 0; + + /** + * Creates a new TimeOfDay instance using the specified properties. + * @function create + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay=} [properties] Properties to set + * @returns {google.type.TimeOfDay} TimeOfDay instance + */ + TimeOfDay.create = function create(properties) { + return new TimeOfDay(properties); + }; + + /** + * Encodes the specified TimeOfDay message. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @function encode + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay} message TimeOfDay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeOfDay.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hours != null && Object.hasOwnProperty.call(message, "hours")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.hours); + if (message.minutes != null && Object.hasOwnProperty.call(message, "minutes")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minutes); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified TimeOfDay message, length delimited. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay} message TimeOfDay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeOfDay.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer. + * @function decode + * @memberof google.type.TimeOfDay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.TimeOfDay} TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeOfDay.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.TimeOfDay(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.hours = reader.int32(); + break; + } + case 2: { + message.minutes = reader.int32(); + break; + } + case 3: { + message.seconds = reader.int32(); + break; + } + case 4: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.TimeOfDay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.TimeOfDay} TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeOfDay.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeOfDay message. + * @function verify + * @memberof google.type.TimeOfDay + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeOfDay.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hours != null && message.hasOwnProperty("hours")) + if (!$util.isInteger(message.hours)) + return "hours: integer expected"; + if (message.minutes != null && message.hasOwnProperty("minutes")) + if (!$util.isInteger(message.minutes)) + return "minutes: integer expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds)) + return "seconds: integer expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a TimeOfDay message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.TimeOfDay + * @static + * @param {Object.} object Plain object + * @returns {google.type.TimeOfDay} TimeOfDay + */ + TimeOfDay.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.TimeOfDay) + return object; + var message = new $root.google.type.TimeOfDay(); + if (object.hours != null) + message.hours = object.hours | 0; + if (object.minutes != null) + message.minutes = object.minutes | 0; + if (object.seconds != null) + message.seconds = object.seconds | 0; + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a TimeOfDay message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.TimeOfDay} message TimeOfDay + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeOfDay.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.hours = 0; + object.minutes = 0; + object.seconds = 0; + object.nanos = 0; + } + if (message.hours != null && message.hasOwnProperty("hours")) + object.hours = message.hours; + if (message.minutes != null && message.hasOwnProperty("minutes")) + object.minutes = message.minutes; + if (message.seconds != null && message.hasOwnProperty("seconds")) + object.seconds = message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this TimeOfDay to JSON. + * @function toJSON + * @memberof google.type.TimeOfDay + * @instance + * @returns {Object.} JSON object + */ + TimeOfDay.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeOfDay + * @function getTypeUrl + * @memberof google.type.TimeOfDay + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeOfDay.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.TimeOfDay"; + }; + + return TimeOfDay; + })(); + + return type; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-talent/protos/protos.json b/packages/google-cloud-talent/protos/protos.json new file mode 100644 index 00000000000..7ad045b1b31 --- /dev/null +++ b/packages/google-cloud-talent/protos/protos.json @@ -0,0 +1,6235 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "talent": { + "nested": { + "v4": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/talent/v4;talent", + "java_multiple_files": true, + "java_outer_classname": "TenantServiceProto", + "java_package": "com.google.cloud.talent.v4", + "objc_class_prefix": "CTS" + }, + "nested": { + "TimestampRange": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "CompanySize": { + "values": { + "COMPANY_SIZE_UNSPECIFIED": 0, + "MINI": 1, + "SMALL": 2, + "SMEDIUM": 3, + "MEDIUM": 4, + "BIG": 5, + "BIGGER": 6, + "GIANT": 7 + } + }, + "JobBenefit": { + "values": { + "JOB_BENEFIT_UNSPECIFIED": 0, + "CHILD_CARE": 1, + "DENTAL": 2, + "DOMESTIC_PARTNER": 3, + "FLEXIBLE_HOURS": 4, + "MEDICAL": 5, + "LIFE_INSURANCE": 6, + "PARENTAL_LEAVE": 7, + "RETIREMENT_PLAN": 8, + "SICK_DAYS": 9, + "VACATION": 10, + "VISION": 11 + } + }, + "DegreeType": { + "values": { + "DEGREE_TYPE_UNSPECIFIED": 0, + "PRIMARY_EDUCATION": 1, + "LOWER_SECONDARY_EDUCATION": 2, + "UPPER_SECONDARY_EDUCATION": 3, + "ADULT_REMEDIAL_EDUCATION": 4, + "ASSOCIATES_OR_EQUIVALENT": 5, + "BACHELORS_OR_EQUIVALENT": 6, + "MASTERS_OR_EQUIVALENT": 7, + "DOCTORAL_OR_EQUIVALENT": 8 + } + }, + "EmploymentType": { + "values": { + "EMPLOYMENT_TYPE_UNSPECIFIED": 0, + "FULL_TIME": 1, + "PART_TIME": 2, + "CONTRACTOR": 3, + "CONTRACT_TO_HIRE": 4, + "TEMPORARY": 5, + "INTERN": 6, + "VOLUNTEER": 7, + "PER_DIEM": 8, + "FLY_IN_FLY_OUT": 9, + "OTHER_EMPLOYMENT_TYPE": 10 + } + }, + "JobLevel": { + "values": { + "JOB_LEVEL_UNSPECIFIED": 0, + "ENTRY_LEVEL": 1, + "EXPERIENCED": 2, + "MANAGER": 3, + "DIRECTOR": 4, + "EXECUTIVE": 5 + } + }, + "JobCategory": { + "values": { + "JOB_CATEGORY_UNSPECIFIED": 0, + "ACCOUNTING_AND_FINANCE": 1, + "ADMINISTRATIVE_AND_OFFICE": 2, + "ADVERTISING_AND_MARKETING": 3, + "ANIMAL_CARE": 4, + "ART_FASHION_AND_DESIGN": 5, + "BUSINESS_OPERATIONS": 6, + "CLEANING_AND_FACILITIES": 7, + "COMPUTER_AND_IT": 8, + "CONSTRUCTION": 9, + "CUSTOMER_SERVICE": 10, + "EDUCATION": 11, + "ENTERTAINMENT_AND_TRAVEL": 12, + "FARMING_AND_OUTDOORS": 13, + "HEALTHCARE": 14, + "HUMAN_RESOURCES": 15, + "INSTALLATION_MAINTENANCE_AND_REPAIR": 16, + "LEGAL": 17, + "MANAGEMENT": 18, + "MANUFACTURING_AND_WAREHOUSE": 19, + "MEDIA_COMMUNICATIONS_AND_WRITING": 20, + "OIL_GAS_AND_MINING": 21, + "PERSONAL_CARE_AND_SERVICES": 22, + "PROTECTIVE_SERVICES": 23, + "REAL_ESTATE": 24, + "RESTAURANT_AND_HOSPITALITY": 25, + "SALES_AND_RETAIL": 26, + "SCIENCE_AND_ENGINEERING": 27, + "SOCIAL_SERVICES_AND_NON_PROFIT": 28, + "SPORTS_FITNESS_AND_RECREATION": 29, + "TRANSPORTATION_AND_LOGISTICS": 30 + } + }, + "PostingRegion": { + "values": { + "POSTING_REGION_UNSPECIFIED": 0, + "ADMINISTRATIVE_AREA": 1, + "NATION": 2, + "TELECOMMUTE": 3 + } + }, + "Visibility": { + "options": { + "deprecated": true + }, + "values": { + "VISIBILITY_UNSPECIFIED": 0, + "ACCOUNT_ONLY": 1, + "SHARED_WITH_GOOGLE": 2, + "SHARED_WITH_PUBLIC": 3 + } + }, + "HtmlSanitization": { + "values": { + "HTML_SANITIZATION_UNSPECIFIED": 0, + "HTML_SANITIZATION_DISABLED": 1, + "SIMPLE_FORMATTING_ONLY": 2 + } + }, + "CommuteMethod": { + "values": { + "COMMUTE_METHOD_UNSPECIFIED": 0, + "DRIVING": 1, + "TRANSIT": 2, + "WALKING": 3, + "CYCLING": 4, + "TRANSIT_ACCESSIBLE": 5 + } + }, + "Location": { + "fields": { + "locationType": { + "type": "LocationType", + "id": 1 + }, + "postalAddress": { + "type": "google.type.PostalAddress", + "id": 2 + }, + "latLng": { + "type": "google.type.LatLng", + "id": 3 + }, + "radiusMiles": { + "type": "double", + "id": 4 + } + }, + "nested": { + "LocationType": { + "values": { + "LOCATION_TYPE_UNSPECIFIED": 0, + "COUNTRY": 1, + "ADMINISTRATIVE_AREA": 2, + "SUB_ADMINISTRATIVE_AREA": 3, + "LOCALITY": 4, + "POSTAL_CODE": 5, + "SUB_LOCALITY": 6, + "SUB_LOCALITY_1": 7, + "SUB_LOCALITY_2": 8, + "NEIGHBORHOOD": 9, + "STREET_ADDRESS": 10 + } + } + } + }, + "RequestMetadata": { + "fields": { + "domain": { + "type": "string", + "id": 1 + }, + "sessionId": { + "type": "string", + "id": 2 + }, + "userId": { + "type": "string", + "id": 3 + }, + "allowMissingIds": { + "type": "bool", + "id": 4 + }, + "deviceInfo": { + "type": "DeviceInfo", + "id": 5 + } + } + }, + "ResponseMetadata": { + "fields": { + "requestId": { + "type": "string", + "id": 1 + } + } + }, + "DeviceInfo": { + "fields": { + "deviceType": { + "type": "DeviceType", + "id": 1 + }, + "id": { + "type": "string", + "id": 2 + } + }, + "nested": { + "DeviceType": { + "values": { + "DEVICE_TYPE_UNSPECIFIED": 0, + "WEB": 1, + "MOBILE_WEB": 2, + "ANDROID": 3, + "IOS": 4, + "BOT": 5, + "OTHER": 6 + } + } + } + }, + "CustomAttribute": { + "fields": { + "stringValues": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "longValues": { + "rule": "repeated", + "type": "int64", + "id": 2 + }, + "filterable": { + "type": "bool", + "id": 3 + }, + "keywordSearchable": { + "type": "bool", + "id": 4 + } + } + }, + "SpellingCorrection": { + "fields": { + "corrected": { + "type": "bool", + "id": 1 + }, + "correctedText": { + "type": "string", + "id": 2 + }, + "correctedHtml": { + "type": "string", + "id": 3 + } + } + }, + "CompensationInfo": { + "fields": { + "entries": { + "rule": "repeated", + "type": "CompensationEntry", + "id": 1 + }, + "annualizedBaseCompensationRange": { + "type": "CompensationRange", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "annualizedTotalCompensationRange": { + "type": "CompensationRange", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "CompensationEntry": { + "oneofs": { + "compensationAmount": { + "oneof": [ + "amount", + "range" + ] + } + }, + "fields": { + "type": { + "type": "CompensationType", + "id": 1 + }, + "unit": { + "type": "CompensationUnit", + "id": 2 + }, + "amount": { + "type": "google.type.Money", + "id": 3 + }, + "range": { + "type": "CompensationRange", + "id": 4 + }, + "description": { + "type": "string", + "id": 5 + }, + "expectedUnitsPerYear": { + "type": "google.protobuf.DoubleValue", + "id": 6 + } + } + }, + "CompensationType": { + "values": { + "COMPENSATION_TYPE_UNSPECIFIED": 0, + "BASE": 1, + "BONUS": 2, + "SIGNING_BONUS": 3, + "EQUITY": 4, + "PROFIT_SHARING": 5, + "COMMISSIONS": 6, + "TIPS": 7, + "OTHER_COMPENSATION_TYPE": 8 + } + }, + "CompensationUnit": { + "values": { + "COMPENSATION_UNIT_UNSPECIFIED": 0, + "HOURLY": 1, + "DAILY": 2, + "WEEKLY": 3, + "MONTHLY": 4, + "YEARLY": 5, + "ONE_TIME": 6, + "OTHER_COMPENSATION_UNIT": 7 + } + }, + "CompensationRange": { + "fields": { + "maxCompensation": { + "type": "google.type.Money", + "id": 2 + }, + "minCompensation": { + "type": "google.type.Money", + "id": 1 + } + } + } + } + }, + "BatchOperationMetadata": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "stateDescription": { + "type": "string", + "id": 2 + }, + "successCount": { + "type": "int32", + "id": 3 + }, + "failureCount": { + "type": "int32", + "id": 4 + }, + "totalCount": { + "type": "int32", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 8 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "INITIALIZING": 1, + "PROCESSING": 2, + "SUCCEEDED": 3, + "FAILED": 4, + "CANCELLING": 5, + "CANCELLED": 6 + } + } + } + }, + "Company": { + "options": { + "(google.api.resource).type": "jobs.googleapis.com/Company", + "(google.api.resource).pattern": "projects/{project}/tenants/{tenant}/companies/{company}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "externalId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "size": { + "type": "CompanySize", + "id": 4 + }, + "headquartersAddress": { + "type": "string", + "id": 5 + }, + "hiringAgency": { + "type": "bool", + "id": 6 + }, + "eeoText": { + "type": "string", + "id": 7 + }, + "websiteUri": { + "type": "string", + "id": 8 + }, + "careerSiteUri": { + "type": "string", + "id": 9 + }, + "imageUri": { + "type": "string", + "id": 10 + }, + "keywordSearchableJobCustomAttributes": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "deprecated": true + } + }, + "derivedInfo": { + "type": "DerivedInfo", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "suspended": { + "type": "bool", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "DerivedInfo": { + "fields": { + "headquartersLocation": { + "type": "Location", + "id": 1 + } + } + } + } + }, + "CompanyService": { + "options": { + "(google.api.default_host)": "jobs.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobs" + }, + "methods": { + "CreateCompany": { + "requestType": "CreateCompanyRequest", + "responseType": "Company", + "options": { + "(google.api.http).post": "/v4/{parent=projects/*/tenants/*}/companies", + "(google.api.http).body": "company", + "(google.api.method_signature)": "parent,company" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4/{parent=projects/*/tenants/*}/companies", + "body": "company" + } + }, + { + "(google.api.method_signature)": "parent,company" + } + ] + }, + "GetCompany": { + "requestType": "GetCompanyRequest", + "responseType": "Company", + "options": { + "(google.api.http).get": "/v4/{name=projects/*/tenants/*/companies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4/{name=projects/*/tenants/*/companies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateCompany": { + "requestType": "UpdateCompanyRequest", + "responseType": "Company", + "options": { + "(google.api.http).patch": "/v4/{company.name=projects/*/tenants/*/companies/*}", + "(google.api.http).body": "company", + "(google.api.method_signature)": "company,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v4/{company.name=projects/*/tenants/*/companies/*}", + "body": "company" + } + }, + { + "(google.api.method_signature)": "company,update_mask" + } + ] + }, + "DeleteCompany": { + "requestType": "DeleteCompanyRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v4/{name=projects/*/tenants/*/companies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v4/{name=projects/*/tenants/*/companies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCompanies": { + "requestType": "ListCompaniesRequest", + "responseType": "ListCompaniesResponse", + "options": { + "(google.api.http).get": "/v4/{parent=projects/*/tenants/*}/companies", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4/{parent=projects/*/tenants/*}/companies" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateCompanyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "jobs.googleapis.com/Tenant" + } + }, + "company": { + "type": "Company", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetCompanyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "jobs.googleapis.com/Company" + } + } + } + }, + "UpdateCompanyRequest": { + "fields": { + "company": { + "type": "Company", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteCompanyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "jobs.googleapis.com/Company" + } + } + } + }, + "ListCompaniesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "jobs.googleapis.com/Tenant" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "requireOpenJobs": { + "type": "bool", + "id": 4 + } + } + }, + "ListCompaniesResponse": { + "fields": { + "companies": { + "rule": "repeated", + "type": "Company", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "metadata": { + "type": "ResponseMetadata", + "id": 3 + } + } + }, + "Completion": { + "options": { + "(google.api.default_host)": "jobs.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobs" + }, + "methods": { + "CompleteQuery": { + "requestType": "CompleteQueryRequest", + "responseType": "CompleteQueryResponse", + "options": { + "(google.api.http).get": "/v4/{tenant=projects/*/tenants/*}:completeQuery" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4/{tenant=projects/*/tenants/*}:completeQuery" + } + } + ] + } + } + }, + "CompleteQueryRequest": { + "fields": { + "tenant": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "jobs.googleapis.com/Tenant" + } + }, + "query": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCodes": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "company": { + "type": "string", + "id": 5, + "options": { + "(google.api.resource_reference).type": "jobs.googleapis.com/Company" + } + }, + "scope": { + "type": "CompletionScope", + "id": 6 + }, + "type": { + "type": "CompletionType", + "id": 7 + } + }, + "nested": { + "CompletionScope": { + "values": { + "COMPLETION_SCOPE_UNSPECIFIED": 0, + "TENANT": 1, + "PUBLIC": 2 + } + }, + "CompletionType": { + "values": { + "COMPLETION_TYPE_UNSPECIFIED": 0, + "JOB_TITLE": 1, + "COMPANY_NAME": 2, + "COMBINED": 3 + } + } + } + }, + "CompleteQueryResponse": { + "fields": { + "completionResults": { + "rule": "repeated", + "type": "CompletionResult", + "id": 1 + }, + "metadata": { + "type": "ResponseMetadata", + "id": 2 + } + }, + "nested": { + "CompletionResult": { + "fields": { + "suggestion": { + "type": "string", + "id": 1 + }, + "type": { + "type": "CompleteQueryRequest.CompletionType", + "id": 2 + }, + "imageUri": { + "type": "string", + "id": 3 + } + } + } + } + }, + "ClientEvent": { + "oneofs": { + "event": { + "oneof": [ + "jobEvent" + ] + } + }, + "fields": { + "requestId": { + "type": "string", + "id": 1 + }, + "eventId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobEvent": { + "type": "JobEvent", + "id": 5 + }, + "eventNotes": { + "type": "string", + "id": 9 + } + } + }, + "JobEvent": { + "fields": { + "type": { + "type": "JobEventType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobs": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "JobEventType": { + "values": { + "JOB_EVENT_TYPE_UNSPECIFIED": 0, + "IMPRESSION": 1, + "VIEW": 2, + "VIEW_REDIRECT": 3, + "APPLICATION_START": 4, + "APPLICATION_FINISH": 5, + "APPLICATION_QUICK_SUBMISSION": 6, + "APPLICATION_REDIRECT": 7, + "APPLICATION_START_FROM_SEARCH": 8, + "APPLICATION_REDIRECT_FROM_SEARCH": 9, + "APPLICATION_COMPANY_SUBMIT": 10, + "BOOKMARK": 11, + "NOTIFICATION": 12, + "HIRED": 13, + "SENT_CV": 14, + "INTERVIEW_GRANTED": 15 + } + } + } + }, + "EventService": { + "options": { + "(google.api.default_host)": "jobs.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobs" + }, + "methods": { + "CreateClientEvent": { + "requestType": "CreateClientEventRequest", + "responseType": "ClientEvent", + "options": { + "(google.api.http).post": "/v4/{parent=projects/*/tenants/*}/clientEvents", + "(google.api.http).body": "client_event", + "(google.api.method_signature)": "parent,client_event" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4/{parent=projects/*/tenants/*}/clientEvents", + "body": "client_event" + } + }, + { + "(google.api.method_signature)": "parent,client_event" + } + ] + } + } + }, + "CreateClientEventRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "jobs.googleapis.com/Tenant" + } + }, + "clientEvent": { + "type": "ClientEvent", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "JobQuery": { + "fields": { + "query": { + "type": "string", + "id": 1 + }, + "queryLanguageCode": { + "type": "string", + "id": 14 + }, + "companies": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "locationFilters": { + "rule": "repeated", + "type": "LocationFilter", + "id": 3 + }, + "jobCategories": { + "rule": "repeated", + "type": "JobCategory", + "id": 4 + }, + "commuteFilter": { + "type": "CommuteFilter", + "id": 5 + }, + "companyDisplayNames": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "compensationFilter": { + "type": "CompensationFilter", + "id": 7 + }, + "customAttributeFilter": { + "type": "string", + "id": 8 + }, + "disableSpellCheck": { + "type": "bool", + "id": 9 + }, + "employmentTypes": { + "rule": "repeated", + "type": "EmploymentType", + "id": 10 + }, + "languageCodes": { + "rule": "repeated", + "type": "string", + "id": 11 + }, + "publishTimeRange": { + "type": "TimestampRange", + "id": 12 + }, + "excludedJobs": { + "rule": "repeated", + "type": "string", + "id": 13 + } + } + }, + "LocationFilter": { + "fields": { + "address": { + "type": "string", + "id": 1 + }, + "regionCode": { + "type": "string", + "id": 2 + }, + "latLng": { + "type": "google.type.LatLng", + "id": 3 + }, + "distanceInMiles": { + "type": "double", + "id": 4 + }, + "telecommutePreference": { + "type": "TelecommutePreference", + "id": 5 + } + }, + "nested": { + "TelecommutePreference": { + "valuesOptions": { + "TELECOMMUTE_EXCLUDED": { + "deprecated": true + } + }, + "values": { + "TELECOMMUTE_PREFERENCE_UNSPECIFIED": 0, + "TELECOMMUTE_EXCLUDED": 1, + "TELECOMMUTE_ALLOWED": 2, + "TELECOMMUTE_JOBS_EXCLUDED": 3 + } + } + } + }, + "CompensationFilter": { + "fields": { + "type": { + "type": "FilterType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "units": { + "rule": "repeated", + "type": "CompensationInfo.CompensationUnit", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "range": { + "type": "CompensationInfo.CompensationRange", + "id": 3 + }, + "includeJobsWithUnspecifiedCompensationRange": { + "type": "bool", + "id": 4 + } + }, + "nested": { + "FilterType": { + "values": { + "FILTER_TYPE_UNSPECIFIED": 0, + "UNIT_ONLY": 1, + "UNIT_AND_AMOUNT": 2, + "ANNUALIZED_BASE_AMOUNT": 3, + "ANNUALIZED_TOTAL_AMOUNT": 4 + } + } + } + }, + "CommuteFilter": { + "oneofs": { + "trafficOption": { + "oneof": [ + "roadTraffic", + "departureTime" + ] + } + }, + "fields": { + "commuteMethod": { + "type": "CommuteMethod", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "startCoordinates": { + "type": "google.type.LatLng", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "travelDuration": { + "type": "google.protobuf.Duration", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "allowImpreciseAddresses": { + "type": "bool", + "id": 4 + }, + "roadTraffic": { + "type": "RoadTraffic", + "id": 5 + }, + "departureTime": { + "type": "google.type.TimeOfDay", + "id": 6 + } + }, + "nested": { + "RoadTraffic": { + "values": { + "ROAD_TRAFFIC_UNSPECIFIED": 0, + "TRAFFIC_FREE": 1, + "BUSY_HOUR": 2 + } + } + } + }, + "HistogramQuery": { + "fields": { + "histogramQuery": { + "type": "string", + "id": 1 + } + } + }, + "HistogramQueryResult": { + "fields": { + "histogramQuery": { + "type": "string", + "id": 1 + }, + "histogram": { + "keyType": "string", + "type": "int64", + "id": 2 + } + } + }, + "Job": { + "options": { + "(google.api.resource).type": "jobs.googleapis.com/Job", + "(google.api.resource).pattern": "projects/{project}/tenants/{tenant}/jobs/{job}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "company": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "jobs.googleapis.com/Company" + } + }, + "requisitionId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "title": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "addresses": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "applicationInfo": { + "type": "ApplicationInfo", + "id": 7 + }, + "jobBenefits": { + "rule": "repeated", + "type": "JobBenefit", + "id": 8 + }, + "compensationInfo": { + "type": "CompensationInfo", + "id": 9 + }, + "customAttributes": { + "keyType": "string", + "type": "CustomAttribute", + "id": 10 + }, + "degreeTypes": { + "rule": "repeated", + "type": "DegreeType", + "id": 11 + }, + "department": { + "type": "string", + "id": 12 + }, + "employmentTypes": { + "rule": "repeated", + "type": "EmploymentType", + "id": 13 + }, + "incentives": { + "type": "string", + "id": 14 + }, + "languageCode": { + "type": "string", + "id": 15 + }, + "jobLevel": { + "type": "JobLevel", + "id": 16 + }, + "promotionValue": { + "type": "int32", + "id": 17 + }, + "qualifications": { + "type": "string", + "id": 18 + }, + "responsibilities": { + "type": "string", + "id": 19 + }, + "postingRegion": { + "type": "PostingRegion", + "id": 20 + }, + "visibility": { + "type": "Visibility", + "id": 21, + "options": { + "deprecated": true + } + }, + "jobStartTime": { + "type": "google.protobuf.Timestamp", + "id": 22 + }, + "jobEndTime": { + "type": "google.protobuf.Timestamp", + "id": 23 + }, + "postingPublishTime": { + "type": "google.protobuf.Timestamp", + "id": 24 + }, + "postingExpireTime": { + "type": "google.protobuf.Timestamp", + "id": 25 + }, + "postingCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 26, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "postingUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 27, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "companyDisplayName": { + "type": "string", + "id": 28, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "derivedInfo": { + "type": "DerivedInfo", + "id": 29, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "processingOptions": { + "type": "ProcessingOptions", + "id": 30 + } + }, + "nested": { + "ApplicationInfo": { + "fields": { + "emails": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "instruction": { + "type": "string", + "id": 2 + }, + "uris": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "DerivedInfo": { + "fields": { + "locations": { + "rule": "repeated", + "type": "Location", + "id": 1 + }, + "jobCategories": { + "rule": "repeated", + "type": "JobCategory", + "id": 3 + } + } + }, + "ProcessingOptions": { + "fields": { + "disableStreetAddressResolution": { + "type": "bool", + "id": 1 + }, + "htmlSanitization": { + "type": "HtmlSanitization", + "id": 2 + } + } + } + } + }, + "JobService": { + "options": { + "(google.api.default_host)": "jobs.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobs" + }, + "methods": { + "CreateJob": { + "requestType": "CreateJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).post": "/v4/{parent=projects/*/tenants/*}/jobs", + "(google.api.http).body": "job", + "(google.api.method_signature)": "parent,job" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4/{parent=projects/*/tenants/*}/jobs", + "body": "job" + } + }, + { + "(google.api.method_signature)": "parent,job" + } + ] + }, + "BatchCreateJobs": { + "requestType": "BatchCreateJobsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v4/{parent=projects/*/tenants/*}/jobs:batchCreate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,jobs", + "(google.longrunning.operation_info).response_type": "BatchCreateJobsResponse", + "(google.longrunning.operation_info).metadata_type": "BatchOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4/{parent=projects/*/tenants/*}/jobs:batchCreate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,jobs" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchCreateJobsResponse", + "metadata_type": "BatchOperationMetadata" + } + } + ] + }, + "GetJob": { + "requestType": "GetJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).get": "/v4/{name=projects/*/tenants/*/jobs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4/{name=projects/*/tenants/*/jobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateJob": { + "requestType": "UpdateJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).patch": "/v4/{job.name=projects/*/tenants/*/jobs/*}", + "(google.api.http).body": "job", + "(google.api.method_signature)": "job,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v4/{job.name=projects/*/tenants/*/jobs/*}", + "body": "job" + } + }, + { + "(google.api.method_signature)": "job,update_mask" + } + ] + }, + "BatchUpdateJobs": { + "requestType": "BatchUpdateJobsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v4/{parent=projects/*/tenants/*}/jobs:batchUpdate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,jobs", + "(google.longrunning.operation_info).response_type": "BatchUpdateJobsResponse", + "(google.longrunning.operation_info).metadata_type": "BatchOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4/{parent=projects/*/tenants/*}/jobs:batchUpdate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,jobs" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchUpdateJobsResponse", + "metadata_type": "BatchOperationMetadata" + } + } + ] + }, + "DeleteJob": { + "requestType": "DeleteJobRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v4/{name=projects/*/tenants/*/jobs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v4/{name=projects/*/tenants/*/jobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "BatchDeleteJobs": { + "requestType": "BatchDeleteJobsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v4/{parent=projects/*/tenants/*}/jobs:batchDelete", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,names", + "(google.longrunning.operation_info).response_type": "BatchDeleteJobsResponse", + "(google.longrunning.operation_info).metadata_type": "BatchOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4/{parent=projects/*/tenants/*}/jobs:batchDelete", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,names" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchDeleteJobsResponse", + "metadata_type": "BatchOperationMetadata" + } + } + ] + }, + "ListJobs": { + "requestType": "ListJobsRequest", + "responseType": "ListJobsResponse", + "options": { + "(google.api.http).get": "/v4/{parent=projects/*/tenants/*}/jobs", + "(google.api.method_signature)": "parent,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4/{parent=projects/*/tenants/*}/jobs" + } + }, + { + "(google.api.method_signature)": "parent,filter" + } + ] + }, + "SearchJobs": { + "requestType": "SearchJobsRequest", + "responseType": "SearchJobsResponse", + "options": { + "(google.api.http).post": "/v4/{parent=projects/*/tenants/*}/jobs:search", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4/{parent=projects/*/tenants/*}/jobs:search", + "body": "*" + } + } + ] + }, + "SearchJobsForAlert": { + "requestType": "SearchJobsRequest", + "responseType": "SearchJobsResponse", + "options": { + "(google.api.http).post": "/v4/{parent=projects/*/tenants/*}/jobs:searchForAlert", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4/{parent=projects/*/tenants/*}/jobs:searchForAlert", + "body": "*" + } + } + ] + } + } + }, + "CreateJobRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "jobs.googleapis.com/Job" + } + }, + "job": { + "type": "Job", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "jobs.googleapis.com/Job" + } + } + } + }, + "UpdateJobRequest": { + "fields": { + "job": { + "type": "Job", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "jobs.googleapis.com/Job" + } + } + } + }, + "JobView": { + "values": { + "JOB_VIEW_UNSPECIFIED": 0, + "JOB_VIEW_ID_ONLY": 1, + "JOB_VIEW_MINIMAL": 2, + "JOB_VIEW_SMALL": 3, + "JOB_VIEW_FULL": 4 + } + }, + "ListJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "jobs.googleapis.com/Job" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "jobView": { + "type": "JobView", + "id": 5 + } + } + }, + "ListJobsResponse": { + "fields": { + "jobs": { + "rule": "repeated", + "type": "Job", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "metadata": { + "type": "ResponseMetadata", + "id": 3 + } + } + }, + "SearchJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "jobs.googleapis.com/Job" + } + }, + "searchMode": { + "type": "SearchMode", + "id": 2 + }, + "requestMetadata": { + "type": "RequestMetadata", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobQuery": { + "type": "JobQuery", + "id": 4 + }, + "enableBroadening": { + "type": "bool", + "id": 5 + }, + "histogramQueries": { + "rule": "repeated", + "type": "HistogramQuery", + "id": 7 + }, + "jobView": { + "type": "JobView", + "id": 8 + }, + "offset": { + "type": "int32", + "id": 9 + }, + "maxPageSize": { + "type": "int32", + "id": 10 + }, + "pageToken": { + "type": "string", + "id": 11 + }, + "orderBy": { + "type": "string", + "id": 12 + }, + "diversificationLevel": { + "type": "DiversificationLevel", + "id": 13 + }, + "customRankingInfo": { + "type": "CustomRankingInfo", + "id": 14 + }, + "disableKeywordMatch": { + "type": "bool", + "id": 16, + "options": { + "deprecated": true + } + }, + "keywordMatchMode": { + "type": "KeywordMatchMode", + "id": 18 + } + }, + "nested": { + "SearchMode": { + "values": { + "SEARCH_MODE_UNSPECIFIED": 0, + "JOB_SEARCH": 1, + "FEATURED_JOB_SEARCH": 2 + } + }, + "DiversificationLevel": { + "values": { + "DIVERSIFICATION_LEVEL_UNSPECIFIED": 0, + "DISABLED": 1, + "SIMPLE": 2, + "ONE_PER_COMPANY": 3, + "TWO_PER_COMPANY": 4, + "DIVERSIFY_BY_LOOSER_SIMILARITY": 5 + } + }, + "KeywordMatchMode": { + "values": { + "KEYWORD_MATCH_MODE_UNSPECIFIED": 0, + "KEYWORD_MATCH_DISABLED": 1, + "KEYWORD_MATCH_ALL": 2, + "KEYWORD_MATCH_TITLE_ONLY": 3 + } + }, + "CustomRankingInfo": { + "fields": { + "importanceLevel": { + "type": "ImportanceLevel", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rankingExpression": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "ImportanceLevel": { + "values": { + "IMPORTANCE_LEVEL_UNSPECIFIED": 0, + "NONE": 1, + "LOW": 2, + "MILD": 3, + "MEDIUM": 4, + "HIGH": 5, + "EXTREME": 6 + } + } + } + } + } + }, + "SearchJobsResponse": { + "fields": { + "matchingJobs": { + "rule": "repeated", + "type": "MatchingJob", + "id": 1 + }, + "histogramQueryResults": { + "rule": "repeated", + "type": "HistogramQueryResult", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "locationFilters": { + "rule": "repeated", + "type": "Location", + "id": 4 + }, + "totalSize": { + "type": "int32", + "id": 6 + }, + "metadata": { + "type": "ResponseMetadata", + "id": 7 + }, + "broadenedQueryJobsCount": { + "type": "int32", + "id": 8 + }, + "spellCorrection": { + "type": "SpellingCorrection", + "id": 9 + } + }, + "nested": { + "MatchingJob": { + "fields": { + "job": { + "type": "Job", + "id": 1 + }, + "jobSummary": { + "type": "string", + "id": 2 + }, + "jobTitleSnippet": { + "type": "string", + "id": 3 + }, + "searchTextSnippet": { + "type": "string", + "id": 4 + }, + "commuteInfo": { + "type": "CommuteInfo", + "id": 5 + } + } + }, + "CommuteInfo": { + "fields": { + "jobLocation": { + "type": "Location", + "id": 1 + }, + "travelDuration": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + } + } + }, + "BatchCreateJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "jobs.googleapis.com/Job" + } + }, + "jobs": { + "rule": "repeated", + "type": "Job", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchUpdateJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "jobs.googleapis.com/Job" + } + }, + "jobs": { + "rule": "repeated", + "type": "Job", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "BatchDeleteJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "jobs.googleapis.com/Tenant" + } + }, + "names": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "jobs.googleapis.com/Job" + } + } + } + }, + "JobResult": { + "fields": { + "job": { + "type": "Job", + "id": 1 + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + } + } + }, + "BatchCreateJobsResponse": { + "fields": { + "jobResults": { + "rule": "repeated", + "type": "JobResult", + "id": 1 + } + } + }, + "BatchUpdateJobsResponse": { + "fields": { + "jobResults": { + "rule": "repeated", + "type": "JobResult", + "id": 1 + } + } + }, + "BatchDeleteJobsResponse": { + "fields": { + "jobResults": { + "rule": "repeated", + "type": "JobResult", + "id": 1 + } + } + }, + "Tenant": { + "options": { + "(google.api.resource).type": "jobs.googleapis.com/Tenant", + "(google.api.resource).pattern": "projects/{project}/tenants/{tenant}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "externalId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TenantService": { + "options": { + "(google.api.default_host)": "jobs.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobs" + }, + "methods": { + "CreateTenant": { + "requestType": "CreateTenantRequest", + "responseType": "Tenant", + "options": { + "(google.api.http).post": "/v4/{parent=projects/*}/tenants", + "(google.api.http).body": "tenant", + "(google.api.method_signature)": "parent,tenant" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4/{parent=projects/*}/tenants", + "body": "tenant" + } + }, + { + "(google.api.method_signature)": "parent,tenant" + } + ] + }, + "GetTenant": { + "requestType": "GetTenantRequest", + "responseType": "Tenant", + "options": { + "(google.api.http).get": "/v4/{name=projects/*/tenants/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4/{name=projects/*/tenants/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateTenant": { + "requestType": "UpdateTenantRequest", + "responseType": "Tenant", + "options": { + "(google.api.http).patch": "/v4/{tenant.name=projects/*/tenants/*}", + "(google.api.http).body": "tenant", + "(google.api.method_signature)": "tenant,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v4/{tenant.name=projects/*/tenants/*}", + "body": "tenant" + } + }, + { + "(google.api.method_signature)": "tenant,update_mask" + } + ] + }, + "DeleteTenant": { + "requestType": "DeleteTenantRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v4/{name=projects/*/tenants/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v4/{name=projects/*/tenants/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListTenants": { + "requestType": "ListTenantsRequest", + "responseType": "ListTenantsResponse", + "options": { + "(google.api.http).get": "/v4/{parent=projects/*}/tenants", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4/{parent=projects/*}/tenants" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateTenantRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "tenant": { + "type": "Tenant", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetTenantRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "jobs.googleapis.com/Tenant" + } + } + } + }, + "UpdateTenantRequest": { + "fields": { + "tenant": { + "type": "Tenant", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteTenantRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "jobs.googleapis.com/Tenant" + } + } + } + }, + "ListTenantsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "ListTenantsResponse": { + "fields": { + "tenants": { + "rule": "repeated", + "type": "Tenant", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "metadata": { + "type": "ResponseMetadata", + "id": 3 + } + } + } + } + }, + "v4beta1": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent", + "java_multiple_files": true, + "java_outer_classname": "TenantServiceProto", + "java_package": "com.google.cloud.talent.v4beta1", + "objc_class_prefix": "CTS" + }, + "nested": { + "TimestampRange": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "CompanySize": { + "values": { + "COMPANY_SIZE_UNSPECIFIED": 0, + "MINI": 1, + "SMALL": 2, + "SMEDIUM": 3, + "MEDIUM": 4, + "BIG": 5, + "BIGGER": 6, + "GIANT": 7 + } + }, + "JobBenefit": { + "values": { + "JOB_BENEFIT_UNSPECIFIED": 0, + "CHILD_CARE": 1, + "DENTAL": 2, + "DOMESTIC_PARTNER": 3, + "FLEXIBLE_HOURS": 4, + "MEDICAL": 5, + "LIFE_INSURANCE": 6, + "PARENTAL_LEAVE": 7, + "RETIREMENT_PLAN": 8, + "SICK_DAYS": 9, + "VACATION": 10, + "VISION": 11 + } + }, + "DegreeType": { + "values": { + "DEGREE_TYPE_UNSPECIFIED": 0, + "PRIMARY_EDUCATION": 1, + "LOWER_SECONDARY_EDUCATION": 2, + "UPPER_SECONDARY_EDUCATION": 3, + "ADULT_REMEDIAL_EDUCATION": 4, + "ASSOCIATES_OR_EQUIVALENT": 5, + "BACHELORS_OR_EQUIVALENT": 6, + "MASTERS_OR_EQUIVALENT": 7, + "DOCTORAL_OR_EQUIVALENT": 8 + } + }, + "EmploymentType": { + "values": { + "EMPLOYMENT_TYPE_UNSPECIFIED": 0, + "FULL_TIME": 1, + "PART_TIME": 2, + "CONTRACTOR": 3, + "CONTRACT_TO_HIRE": 4, + "TEMPORARY": 5, + "INTERN": 6, + "VOLUNTEER": 7, + "PER_DIEM": 8, + "FLY_IN_FLY_OUT": 9, + "OTHER_EMPLOYMENT_TYPE": 10 + } + }, + "JobLevel": { + "values": { + "JOB_LEVEL_UNSPECIFIED": 0, + "ENTRY_LEVEL": 1, + "EXPERIENCED": 2, + "MANAGER": 3, + "DIRECTOR": 4, + "EXECUTIVE": 5 + } + }, + "JobCategory": { + "values": { + "JOB_CATEGORY_UNSPECIFIED": 0, + "ACCOUNTING_AND_FINANCE": 1, + "ADMINISTRATIVE_AND_OFFICE": 2, + "ADVERTISING_AND_MARKETING": 3, + "ANIMAL_CARE": 4, + "ART_FASHION_AND_DESIGN": 5, + "BUSINESS_OPERATIONS": 6, + "CLEANING_AND_FACILITIES": 7, + "COMPUTER_AND_IT": 8, + "CONSTRUCTION": 9, + "CUSTOMER_SERVICE": 10, + "EDUCATION": 11, + "ENTERTAINMENT_AND_TRAVEL": 12, + "FARMING_AND_OUTDOORS": 13, + "HEALTHCARE": 14, + "HUMAN_RESOURCES": 15, + "INSTALLATION_MAINTENANCE_AND_REPAIR": 16, + "LEGAL": 17, + "MANAGEMENT": 18, + "MANUFACTURING_AND_WAREHOUSE": 19, + "MEDIA_COMMUNICATIONS_AND_WRITING": 20, + "OIL_GAS_AND_MINING": 21, + "PERSONAL_CARE_AND_SERVICES": 22, + "PROTECTIVE_SERVICES": 23, + "REAL_ESTATE": 24, + "RESTAURANT_AND_HOSPITALITY": 25, + "SALES_AND_RETAIL": 26, + "SCIENCE_AND_ENGINEERING": 27, + "SOCIAL_SERVICES_AND_NON_PROFIT": 28, + "SPORTS_FITNESS_AND_RECREATION": 29, + "TRANSPORTATION_AND_LOGISTICS": 30 + } + }, + "PostingRegion": { + "values": { + "POSTING_REGION_UNSPECIFIED": 0, + "ADMINISTRATIVE_AREA": 1, + "NATION": 2, + "TELECOMMUTE": 3 + } + }, + "Visibility": { + "options": { + "deprecated": true + }, + "values": { + "VISIBILITY_UNSPECIFIED": 0, + "ACCOUNT_ONLY": 1, + "SHARED_WITH_GOOGLE": 2, + "SHARED_WITH_PUBLIC": 3 + } + }, + "HtmlSanitization": { + "values": { + "HTML_SANITIZATION_UNSPECIFIED": 0, + "HTML_SANITIZATION_DISABLED": 1, + "SIMPLE_FORMATTING_ONLY": 2 + } + }, + "CommuteMethod": { + "values": { + "COMMUTE_METHOD_UNSPECIFIED": 0, + "DRIVING": 1, + "TRANSIT": 2, + "WALKING": 3, + "CYCLING": 4 + } + }, + "Location": { + "fields": { + "locationType": { + "type": "LocationType", + "id": 1 + }, + "postalAddress": { + "type": "google.type.PostalAddress", + "id": 2 + }, + "latLng": { + "type": "google.type.LatLng", + "id": 3 + }, + "radiusMiles": { + "type": "double", + "id": 4 + } + }, + "nested": { + "LocationType": { + "values": { + "LOCATION_TYPE_UNSPECIFIED": 0, + "COUNTRY": 1, + "ADMINISTRATIVE_AREA": 2, + "SUB_ADMINISTRATIVE_AREA": 3, + "LOCALITY": 4, + "POSTAL_CODE": 5, + "SUB_LOCALITY": 6, + "SUB_LOCALITY_1": 7, + "SUB_LOCALITY_2": 8, + "NEIGHBORHOOD": 9, + "STREET_ADDRESS": 10 + } + } + } + }, + "RequestMetadata": { + "fields": { + "domain": { + "type": "string", + "id": 1 + }, + "sessionId": { + "type": "string", + "id": 2 + }, + "userId": { + "type": "string", + "id": 3 + }, + "allowMissingIds": { + "type": "bool", + "id": 4 + }, + "deviceInfo": { + "type": "DeviceInfo", + "id": 5 + } + } + }, + "ResponseMetadata": { + "fields": { + "requestId": { + "type": "string", + "id": 1 + } + } + }, + "DeviceInfo": { + "fields": { + "deviceType": { + "type": "DeviceType", + "id": 1 + }, + "id": { + "type": "string", + "id": 2 + } + }, + "nested": { + "DeviceType": { + "values": { + "DEVICE_TYPE_UNSPECIFIED": 0, + "WEB": 1, + "MOBILE_WEB": 2, + "ANDROID": 3, + "IOS": 4, + "BOT": 5, + "OTHER": 6 + } + } + } + }, + "CustomAttribute": { + "fields": { + "stringValues": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "longValues": { + "rule": "repeated", + "type": "int64", + "id": 2 + }, + "filterable": { + "type": "bool", + "id": 3 + }, + "keywordSearchable": { + "type": "bool", + "id": 4 + } + } + }, + "SpellingCorrection": { + "fields": { + "corrected": { + "type": "bool", + "id": 1 + }, + "correctedText": { + "type": "string", + "id": 2 + }, + "correctedHtml": { + "type": "string", + "id": 3 + } + } + }, + "CompensationInfo": { + "fields": { + "entries": { + "rule": "repeated", + "type": "CompensationEntry", + "id": 1 + }, + "annualizedBaseCompensationRange": { + "type": "CompensationRange", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "annualizedTotalCompensationRange": { + "type": "CompensationRange", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "CompensationEntry": { + "oneofs": { + "compensationAmount": { + "oneof": [ + "amount", + "range" + ] + } + }, + "fields": { + "type": { + "type": "CompensationType", + "id": 1 + }, + "unit": { + "type": "CompensationUnit", + "id": 2 + }, + "amount": { + "type": "google.type.Money", + "id": 3 + }, + "range": { + "type": "CompensationRange", + "id": 4 + }, + "description": { + "type": "string", + "id": 5 + }, + "expectedUnitsPerYear": { + "type": "google.protobuf.DoubleValue", + "id": 6 + } + } + }, + "CompensationType": { + "values": { + "COMPENSATION_TYPE_UNSPECIFIED": 0, + "BASE": 1, + "BONUS": 2, + "SIGNING_BONUS": 3, + "EQUITY": 4, + "PROFIT_SHARING": 5, + "COMMISSIONS": 6, + "TIPS": 7, + "OTHER_COMPENSATION_TYPE": 8 + } + }, + "CompensationUnit": { + "values": { + "COMPENSATION_UNIT_UNSPECIFIED": 0, + "HOURLY": 1, + "DAILY": 2, + "WEEKLY": 3, + "MONTHLY": 4, + "YEARLY": 5, + "ONE_TIME": 6, + "OTHER_COMPENSATION_UNIT": 7 + } + }, + "CompensationRange": { + "fields": { + "maxCompensation": { + "type": "google.type.Money", + "id": 2 + }, + "minCompensation": { + "type": "google.type.Money", + "id": 1 + } + } + } + } + }, + "BatchOperationMetadata": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "stateDescription": { + "type": "string", + "id": 2 + }, + "successCount": { + "type": "int32", + "id": 3 + }, + "failureCount": { + "type": "int32", + "id": 4 + }, + "totalCount": { + "type": "int32", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 8 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "INITIALIZING": 1, + "PROCESSING": 2, + "SUCCEEDED": 3, + "FAILED": 4, + "CANCELLING": 5, + "CANCELLED": 6 + } + } + } + }, + "Company": { + "options": { + "(google.api.resource).type": "jobs.googleapis.com/Company", + "(google.api.resource).pattern": "projects/{project}/companies/{company}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "externalId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "size": { + "type": "CompanySize", + "id": 4 + }, + "headquartersAddress": { + "type": "string", + "id": 5 + }, + "hiringAgency": { + "type": "bool", + "id": 6 + }, + "eeoText": { + "type": "string", + "id": 7 + }, + "websiteUri": { + "type": "string", + "id": 8 + }, + "careerSiteUri": { + "type": "string", + "id": 9 + }, + "imageUri": { + "type": "string", + "id": 10 + }, + "keywordSearchableJobCustomAttributes": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "deprecated": true + } + }, + "derivedInfo": { + "type": "DerivedInfo", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "suspended": { + "type": "bool", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "DerivedInfo": { + "fields": { + "headquartersLocation": { + "type": "Location", + "id": 1 + } + } + } + } + }, + "CompanyService": { + "options": { + "(google.api.default_host)": "jobs.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobs" + }, + "methods": { + "CreateCompany": { + "requestType": "CreateCompanyRequest", + "responseType": "Company", + "options": { + "(google.api.http).post": "/v4beta1/{parent=projects/*/tenants/*}/companies", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v4beta1/{parent=projects/*}/companies", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,company" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4beta1/{parent=projects/*/tenants/*}/companies", + "body": "*", + "additional_bindings": { + "post": "/v4beta1/{parent=projects/*}/companies", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent,company" + } + ] + }, + "GetCompany": { + "requestType": "GetCompanyRequest", + "responseType": "Company", + "options": { + "(google.api.http).get": "/v4beta1/{name=projects/*/tenants/*/companies/*}", + "(google.api.http).additional_bindings.get": "/v4beta1/{name=projects/*/companies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4beta1/{name=projects/*/tenants/*/companies/*}", + "additional_bindings": { + "get": "/v4beta1/{name=projects/*/companies/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateCompany": { + "requestType": "UpdateCompanyRequest", + "responseType": "Company", + "options": { + "(google.api.http).patch": "/v4beta1/{company.name=projects/*/tenants/*/companies/*}", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.patch": "/v4beta1/{company.name=projects/*/companies/*}", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "company" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v4beta1/{company.name=projects/*/tenants/*/companies/*}", + "body": "*", + "additional_bindings": { + "patch": "/v4beta1/{company.name=projects/*/companies/*}", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "company" + } + ] + }, + "DeleteCompany": { + "requestType": "DeleteCompanyRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v4beta1/{name=projects/*/tenants/*/companies/*}", + "(google.api.http).additional_bindings.delete": "/v4beta1/{name=projects/*/companies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v4beta1/{name=projects/*/tenants/*/companies/*}", + "additional_bindings": { + "delete": "/v4beta1/{name=projects/*/companies/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCompanies": { + "requestType": "ListCompaniesRequest", + "responseType": "ListCompaniesResponse", + "options": { + "(google.api.http).get": "/v4beta1/{parent=projects/*/tenants/*}/companies", + "(google.api.http).additional_bindings.get": "/v4beta1/{parent=projects/*}/companies", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4beta1/{parent=projects/*/tenants/*}/companies", + "additional_bindings": { + "get": "/v4beta1/{parent=projects/*}/companies" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateCompanyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "jobs.googleapis.com/Company" + } + }, + "company": { + "type": "Company", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetCompanyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "jobs.googleapis.com/Company" + } + } + } + }, + "UpdateCompanyRequest": { + "fields": { + "company": { + "type": "Company", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteCompanyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "jobs.googleapis.com/Company" + } + } + } + }, + "ListCompaniesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "jobs.googleapis.com/Company" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "requireOpenJobs": { + "type": "bool", + "id": 4 + } + } + }, + "ListCompaniesResponse": { + "fields": { + "companies": { + "rule": "repeated", + "type": "Company", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "metadata": { + "type": "ResponseMetadata", + "id": 3 + } + } + }, + "Completion": { + "options": { + "(google.api.default_host)": "jobs.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobs" + }, + "methods": { + "CompleteQuery": { + "requestType": "CompleteQueryRequest", + "responseType": "CompleteQueryResponse", + "options": { + "(google.api.http).get": "/v4beta1/{parent=projects/*/tenants/*}:complete", + "(google.api.http).additional_bindings.get": "/v4beta1/{parent=projects/*}:complete" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4beta1/{parent=projects/*/tenants/*}:complete", + "additional_bindings": { + "get": "/v4beta1/{parent=projects/*}:complete" + } + } + } + ] + } + } + }, + "CompleteQueryRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "jobs.googleapis.com/Company" + } + }, + "query": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCodes": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "company": { + "type": "string", + "id": 5, + "options": { + "(google.api.resource_reference).type": "jobs.googleapis.com/Company" + } + }, + "scope": { + "type": "CompletionScope", + "id": 6 + }, + "type": { + "type": "CompletionType", + "id": 7 + } + }, + "nested": { + "CompletionScope": { + "values": { + "COMPLETION_SCOPE_UNSPECIFIED": 0, + "TENANT": 1, + "PUBLIC": 2 + } + }, + "CompletionType": { + "values": { + "COMPLETION_TYPE_UNSPECIFIED": 0, + "JOB_TITLE": 1, + "COMPANY_NAME": 2, + "COMBINED": 3 + } + } + } + }, + "CompleteQueryResponse": { + "fields": { + "completionResults": { + "rule": "repeated", + "type": "CompletionResult", + "id": 1 + }, + "metadata": { + "type": "ResponseMetadata", + "id": 2 + } + }, + "nested": { + "CompletionResult": { + "fields": { + "suggestion": { + "type": "string", + "id": 1 + }, + "type": { + "type": "CompleteQueryRequest.CompletionType", + "id": 2 + }, + "imageUri": { + "type": "string", + "id": 3 + } + } + } + } + }, + "ClientEvent": { + "oneofs": { + "event": { + "oneof": [ + "jobEvent" + ] + } + }, + "fields": { + "requestId": { + "type": "string", + "id": 1 + }, + "eventId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobEvent": { + "type": "JobEvent", + "id": 5 + }, + "eventNotes": { + "type": "string", + "id": 9 + } + } + }, + "JobEvent": { + "fields": { + "type": { + "type": "JobEventType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobs": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "profile": { + "type": "string", + "id": 3 + } + }, + "nested": { + "JobEventType": { + "values": { + "JOB_EVENT_TYPE_UNSPECIFIED": 0, + "IMPRESSION": 1, + "VIEW": 2, + "VIEW_REDIRECT": 3, + "APPLICATION_START": 4, + "APPLICATION_FINISH": 5, + "APPLICATION_QUICK_SUBMISSION": 6, + "APPLICATION_REDIRECT": 7, + "APPLICATION_START_FROM_SEARCH": 8, + "APPLICATION_REDIRECT_FROM_SEARCH": 9, + "APPLICATION_COMPANY_SUBMIT": 10, + "BOOKMARK": 11, + "NOTIFICATION": 12, + "HIRED": 13, + "SENT_CV": 14, + "INTERVIEW_GRANTED": 15 + } + } + } + }, + "EventService": { + "options": { + "(google.api.default_host)": "jobs.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobs" + }, + "methods": { + "CreateClientEvent": { + "requestType": "CreateClientEventRequest", + "responseType": "ClientEvent", + "options": { + "(google.api.http).post": "/v4beta1/{parent=projects/*/tenants/*}/clientEvents", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v4beta1/{parent=projects/*}/clientEvents", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,client_event" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4beta1/{parent=projects/*/tenants/*}/clientEvents", + "body": "*", + "additional_bindings": { + "post": "/v4beta1/{parent=projects/*}/clientEvents", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent,client_event" + } + ] + } + } + }, + "CreateClientEventRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "jobs.googleapis.com/Company" + } + }, + "clientEvent": { + "type": "ClientEvent", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "JobQuery": { + "fields": { + "query": { + "type": "string", + "id": 1 + }, + "queryLanguageCode": { + "type": "string", + "id": 14 + }, + "companies": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "locationFilters": { + "rule": "repeated", + "type": "LocationFilter", + "id": 3 + }, + "jobCategories": { + "rule": "repeated", + "type": "JobCategory", + "id": 4 + }, + "commuteFilter": { + "type": "CommuteFilter", + "id": 5 + }, + "companyDisplayNames": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "compensationFilter": { + "type": "CompensationFilter", + "id": 7 + }, + "customAttributeFilter": { + "type": "string", + "id": 8 + }, + "disableSpellCheck": { + "type": "bool", + "id": 9 + }, + "employmentTypes": { + "rule": "repeated", + "type": "EmploymentType", + "id": 10 + }, + "languageCodes": { + "rule": "repeated", + "type": "string", + "id": 11 + }, + "publishTimeRange": { + "type": "TimestampRange", + "id": 12 + }, + "excludedJobs": { + "rule": "repeated", + "type": "string", + "id": 13 + } + } + }, + "LocationFilter": { + "fields": { + "address": { + "type": "string", + "id": 1 + }, + "regionCode": { + "type": "string", + "id": 2 + }, + "latLng": { + "type": "google.type.LatLng", + "id": 3 + }, + "distanceInMiles": { + "type": "double", + "id": 4 + }, + "telecommutePreference": { + "type": "TelecommutePreference", + "id": 5 + }, + "negated": { + "type": "bool", + "id": 6 + } + }, + "nested": { + "TelecommutePreference": { + "valuesOptions": { + "TELECOMMUTE_EXCLUDED": { + "deprecated": true + } + }, + "values": { + "TELECOMMUTE_PREFERENCE_UNSPECIFIED": 0, + "TELECOMMUTE_EXCLUDED": 1, + "TELECOMMUTE_ALLOWED": 2, + "TELECOMMUTE_JOBS_EXCLUDED": 3 + } + } + } + }, + "CompensationFilter": { + "fields": { + "type": { + "type": "FilterType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "units": { + "rule": "repeated", + "type": "CompensationInfo.CompensationUnit", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "range": { + "type": "CompensationInfo.CompensationRange", + "id": 3 + }, + "includeJobsWithUnspecifiedCompensationRange": { + "type": "bool", + "id": 4 + } + }, + "nested": { + "FilterType": { + "values": { + "FILTER_TYPE_UNSPECIFIED": 0, + "UNIT_ONLY": 1, + "UNIT_AND_AMOUNT": 2, + "ANNUALIZED_BASE_AMOUNT": 3, + "ANNUALIZED_TOTAL_AMOUNT": 4 + } + } + } + }, + "CommuteFilter": { + "oneofs": { + "trafficOption": { + "oneof": [ + "roadTraffic", + "departureTime" + ] + } + }, + "fields": { + "commuteMethod": { + "type": "CommuteMethod", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "startCoordinates": { + "type": "google.type.LatLng", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "travelDuration": { + "type": "google.protobuf.Duration", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "allowImpreciseAddresses": { + "type": "bool", + "id": 4 + }, + "roadTraffic": { + "type": "RoadTraffic", + "id": 5 + }, + "departureTime": { + "type": "google.type.TimeOfDay", + "id": 6 + } + }, + "nested": { + "RoadTraffic": { + "values": { + "ROAD_TRAFFIC_UNSPECIFIED": 0, + "TRAFFIC_FREE": 1, + "BUSY_HOUR": 2 + } + } + } + }, + "HistogramQuery": { + "fields": { + "histogramQuery": { + "type": "string", + "id": 1 + } + } + }, + "HistogramQueryResult": { + "fields": { + "histogramQuery": { + "type": "string", + "id": 1 + }, + "histogram": { + "keyType": "string", + "type": "int64", + "id": 2 + } + } + }, + "Job": { + "options": { + "(google.api.resource).type": "jobs.googleapis.com/Job", + "(google.api.resource).pattern": "projects/{project}/jobs/{job}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "company": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "jobs.googleapis.com/Company" + } + }, + "requisitionId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "title": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "addresses": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "applicationInfo": { + "type": "ApplicationInfo", + "id": 7 + }, + "jobBenefits": { + "rule": "repeated", + "type": "JobBenefit", + "id": 8 + }, + "compensationInfo": { + "type": "CompensationInfo", + "id": 9 + }, + "customAttributes": { + "keyType": "string", + "type": "CustomAttribute", + "id": 10 + }, + "degreeTypes": { + "rule": "repeated", + "type": "DegreeType", + "id": 11 + }, + "department": { + "type": "string", + "id": 12 + }, + "employmentTypes": { + "rule": "repeated", + "type": "EmploymentType", + "id": 13 + }, + "incentives": { + "type": "string", + "id": 14 + }, + "languageCode": { + "type": "string", + "id": 15 + }, + "jobLevel": { + "type": "JobLevel", + "id": 16 + }, + "promotionValue": { + "type": "int32", + "id": 17 + }, + "qualifications": { + "type": "string", + "id": 18 + }, + "responsibilities": { + "type": "string", + "id": 19 + }, + "postingRegion": { + "type": "PostingRegion", + "id": 20 + }, + "visibility": { + "type": "Visibility", + "id": 21, + "options": { + "deprecated": true + } + }, + "jobStartTime": { + "type": "google.protobuf.Timestamp", + "id": 22 + }, + "jobEndTime": { + "type": "google.protobuf.Timestamp", + "id": 23 + }, + "postingPublishTime": { + "type": "google.protobuf.Timestamp", + "id": 24 + }, + "postingExpireTime": { + "type": "google.protobuf.Timestamp", + "id": 25 + }, + "postingCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 26, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "postingUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 27, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "companyDisplayName": { + "type": "string", + "id": 28, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "derivedInfo": { + "type": "DerivedInfo", + "id": 29, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "processingOptions": { + "type": "ProcessingOptions", + "id": 30 + } + }, + "nested": { + "ApplicationInfo": { + "fields": { + "emails": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "instruction": { + "type": "string", + "id": 2 + }, + "uris": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "DerivedInfo": { + "fields": { + "locations": { + "rule": "repeated", + "type": "Location", + "id": 1 + }, + "jobCategories": { + "rule": "repeated", + "type": "JobCategory", + "id": 3 + } + } + }, + "ProcessingOptions": { + "fields": { + "disableStreetAddressResolution": { + "type": "bool", + "id": 1 + }, + "htmlSanitization": { + "type": "HtmlSanitization", + "id": 2 + } + } + } + } + }, + "JobService": { + "options": { + "(google.api.default_host)": "jobs.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobs" + }, + "methods": { + "CreateJob": { + "requestType": "CreateJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).post": "/v4beta1/{parent=projects/*/tenants/*}/jobs", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v4beta1/{parent=projects/*}/jobs", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,job" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4beta1/{parent=projects/*/tenants/*}/jobs", + "body": "*", + "additional_bindings": { + "post": "/v4beta1/{parent=projects/*}/jobs", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent,job" + } + ] + }, + "BatchCreateJobs": { + "requestType": "BatchCreateJobsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v4beta1/{parent=projects/*/tenants/*}/jobs:batchCreate", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v4beta1/{parent=projects/*}/jobs:batchCreate", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,jobs", + "(google.longrunning.operation_info).response_type": "JobOperationResult", + "(google.longrunning.operation_info).metadata_type": "BatchOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4beta1/{parent=projects/*/tenants/*}/jobs:batchCreate", + "body": "*", + "additional_bindings": { + "post": "/v4beta1/{parent=projects/*}/jobs:batchCreate", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent,jobs" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "JobOperationResult", + "metadata_type": "BatchOperationMetadata" + } + } + ] + }, + "GetJob": { + "requestType": "GetJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).get": "/v4beta1/{name=projects/*/tenants/*/jobs/*}", + "(google.api.http).additional_bindings.get": "/v4beta1/{name=projects/*/jobs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4beta1/{name=projects/*/tenants/*/jobs/*}", + "additional_bindings": { + "get": "/v4beta1/{name=projects/*/jobs/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateJob": { + "requestType": "UpdateJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).patch": "/v4beta1/{job.name=projects/*/tenants/*/jobs/*}", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.patch": "/v4beta1/{job.name=projects/*/jobs/*}", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "job" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v4beta1/{job.name=projects/*/tenants/*/jobs/*}", + "body": "*", + "additional_bindings": { + "patch": "/v4beta1/{job.name=projects/*/jobs/*}", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "job" + } + ] + }, + "BatchUpdateJobs": { + "requestType": "BatchUpdateJobsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v4beta1/{parent=projects/*/tenants/*}/jobs:batchUpdate", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v4beta1/{parent=projects/*}/jobs:batchUpdate", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,jobs", + "(google.longrunning.operation_info).response_type": "JobOperationResult", + "(google.longrunning.operation_info).metadata_type": "BatchOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4beta1/{parent=projects/*/tenants/*}/jobs:batchUpdate", + "body": "*", + "additional_bindings": { + "post": "/v4beta1/{parent=projects/*}/jobs:batchUpdate", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent,jobs" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "JobOperationResult", + "metadata_type": "BatchOperationMetadata" + } + } + ] + }, + "DeleteJob": { + "requestType": "DeleteJobRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v4beta1/{name=projects/*/tenants/*/jobs/*}", + "(google.api.http).additional_bindings.delete": "/v4beta1/{name=projects/*/jobs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v4beta1/{name=projects/*/tenants/*/jobs/*}", + "additional_bindings": { + "delete": "/v4beta1/{name=projects/*/jobs/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "BatchDeleteJobs": { + "requestType": "BatchDeleteJobsRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v4beta1/{parent=projects/*/tenants/*}/jobs:batchDelete", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v4beta1/{parent=projects/*}/jobs:batchDelete", + "(google.api.method_signature)": "parent,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4beta1/{parent=projects/*/tenants/*}/jobs:batchDelete", + "body": "*", + "additional_bindings": { + "post": "/v4beta1/{parent=projects/*}/jobs:batchDelete" + } + } + }, + { + "(google.api.method_signature)": "parent,filter" + } + ] + }, + "ListJobs": { + "requestType": "ListJobsRequest", + "responseType": "ListJobsResponse", + "options": { + "(google.api.http).get": "/v4beta1/{parent=projects/*/tenants/*}/jobs", + "(google.api.http).additional_bindings.get": "/v4beta1/{parent=projects/*}/jobs", + "(google.api.method_signature)": "parent,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4beta1/{parent=projects/*/tenants/*}/jobs", + "additional_bindings": { + "get": "/v4beta1/{parent=projects/*}/jobs" + } + } + }, + { + "(google.api.method_signature)": "parent,filter" + } + ] + }, + "SearchJobs": { + "requestType": "SearchJobsRequest", + "responseType": "SearchJobsResponse", + "options": { + "(google.api.http).post": "/v4beta1/{parent=projects/*/tenants/*}/jobs:search", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v4beta1/{parent=projects/*}/jobs:search", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4beta1/{parent=projects/*/tenants/*}/jobs:search", + "body": "*", + "additional_bindings": { + "post": "/v4beta1/{parent=projects/*}/jobs:search", + "body": "*" + } + } + } + ] + }, + "SearchJobsForAlert": { + "requestType": "SearchJobsRequest", + "responseType": "SearchJobsResponse", + "options": { + "(google.api.http).post": "/v4beta1/{parent=projects/*/tenants/*}/jobs:searchForAlert", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v4beta1/{parent=projects/*}/jobs:searchForAlert", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4beta1/{parent=projects/*/tenants/*}/jobs:searchForAlert", + "body": "*", + "additional_bindings": { + "post": "/v4beta1/{parent=projects/*}/jobs:searchForAlert", + "body": "*" + } + } + } + ] + } + } + }, + "CreateJobRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "jobs.googleapis.com/Job" + } + }, + "job": { + "type": "Job", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "jobs.googleapis.com/Job" + } + } + } + }, + "UpdateJobRequest": { + "fields": { + "job": { + "type": "Job", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "jobs.googleapis.com/Job" + } + } + } + }, + "BatchDeleteJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "jobs.googleapis.com/Job" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "JobView": { + "values": { + "JOB_VIEW_UNSPECIFIED": 0, + "JOB_VIEW_ID_ONLY": 1, + "JOB_VIEW_MINIMAL": 2, + "JOB_VIEW_SMALL": 3, + "JOB_VIEW_FULL": 4 + } + }, + "ListJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "jobs.googleapis.com/Job" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "jobView": { + "type": "JobView", + "id": 5 + } + } + }, + "ListJobsResponse": { + "fields": { + "jobs": { + "rule": "repeated", + "type": "Job", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "metadata": { + "type": "ResponseMetadata", + "id": 3 + } + } + }, + "SearchJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "jobs.googleapis.com/Job" + } + }, + "searchMode": { + "type": "SearchMode", + "id": 2 + }, + "requestMetadata": { + "type": "RequestMetadata", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobQuery": { + "type": "JobQuery", + "id": 4 + }, + "enableBroadening": { + "type": "bool", + "id": 5 + }, + "requirePreciseResultSize": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "histogramQueries": { + "rule": "repeated", + "type": "HistogramQuery", + "id": 7 + }, + "jobView": { + "type": "JobView", + "id": 8 + }, + "offset": { + "type": "int32", + "id": 9 + }, + "pageSize": { + "type": "int32", + "id": 10 + }, + "pageToken": { + "type": "string", + "id": 11 + }, + "orderBy": { + "type": "string", + "id": 12 + }, + "diversificationLevel": { + "type": "DiversificationLevel", + "id": 13 + }, + "customRankingInfo": { + "type": "CustomRankingInfo", + "id": 14 + }, + "disableKeywordMatch": { + "type": "bool", + "id": 16 + }, + "keywordMatchMode": { + "type": "KeywordMatchMode", + "id": 18 + } + }, + "nested": { + "SearchMode": { + "values": { + "SEARCH_MODE_UNSPECIFIED": 0, + "JOB_SEARCH": 1, + "FEATURED_JOB_SEARCH": 2 + } + }, + "DiversificationLevel": { + "values": { + "DIVERSIFICATION_LEVEL_UNSPECIFIED": 0, + "DISABLED": 1, + "SIMPLE": 2 + } + }, + "KeywordMatchMode": { + "values": { + "KEYWORD_MATCH_MODE_UNSPECIFIED": 0, + "KEYWORD_MATCH_DISABLED": 1, + "KEYWORD_MATCH_ALL": 2, + "KEYWORD_MATCH_TITLE_ONLY": 3 + } + }, + "CustomRankingInfo": { + "fields": { + "importanceLevel": { + "type": "ImportanceLevel", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rankingExpression": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "ImportanceLevel": { + "values": { + "IMPORTANCE_LEVEL_UNSPECIFIED": 0, + "NONE": 1, + "LOW": 2, + "MILD": 3, + "MEDIUM": 4, + "HIGH": 5, + "EXTREME": 6 + } + } + } + } + } + }, + "SearchJobsResponse": { + "fields": { + "matchingJobs": { + "rule": "repeated", + "type": "MatchingJob", + "id": 1 + }, + "histogramQueryResults": { + "rule": "repeated", + "type": "HistogramQueryResult", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "locationFilters": { + "rule": "repeated", + "type": "Location", + "id": 4 + }, + "estimatedTotalSize": { + "type": "int32", + "id": 5 + }, + "totalSize": { + "type": "int32", + "id": 6 + }, + "metadata": { + "type": "ResponseMetadata", + "id": 7 + }, + "broadenedQueryJobsCount": { + "type": "int32", + "id": 8 + }, + "spellCorrection": { + "type": "SpellingCorrection", + "id": 9 + } + }, + "nested": { + "MatchingJob": { + "fields": { + "job": { + "type": "Job", + "id": 1 + }, + "jobSummary": { + "type": "string", + "id": 2 + }, + "jobTitleSnippet": { + "type": "string", + "id": 3 + }, + "searchTextSnippet": { + "type": "string", + "id": 4 + }, + "commuteInfo": { + "type": "CommuteInfo", + "id": 5 + } + } + }, + "CommuteInfo": { + "fields": { + "jobLocation": { + "type": "Location", + "id": 1 + }, + "travelDuration": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + } + } + }, + "BatchCreateJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "jobs.googleapis.com/Job" + } + }, + "jobs": { + "rule": "repeated", + "type": "Job", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchUpdateJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "jobs.googleapis.com/Job" + } + }, + "jobs": { + "rule": "repeated", + "type": "Job", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "JobOperationResult": { + "fields": { + "jobResults": { + "rule": "repeated", + "type": "JobResult", + "id": 1 + } + }, + "nested": { + "JobResult": { + "fields": { + "job": { + "type": "Job", + "id": 1 + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + } + } + } + } + }, + "Tenant": { + "options": { + "(google.api.resource).type": "jobs.googleapis.com/Tenant", + "(google.api.resource).pattern": "projects/{project}/tenants/{tenant}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "externalId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "usageType": { + "type": "DataUsageType", + "id": 3 + }, + "keywordSearchableProfileCustomAttributes": { + "rule": "repeated", + "type": "string", + "id": 4 + } + }, + "nested": { + "DataUsageType": { + "values": { + "DATA_USAGE_TYPE_UNSPECIFIED": 0, + "AGGREGATED": 1, + "ISOLATED": 2 + } + } + } + }, + "TenantService": { + "options": { + "(google.api.default_host)": "jobs.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobs" + }, + "methods": { + "CreateTenant": { + "requestType": "CreateTenantRequest", + "responseType": "Tenant", + "options": { + "(google.api.http).post": "/v4beta1/{parent=projects/*}/tenants", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,tenant" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v4beta1/{parent=projects/*}/tenants", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,tenant" + } + ] + }, + "GetTenant": { + "requestType": "GetTenantRequest", + "responseType": "Tenant", + "options": { + "(google.api.http).get": "/v4beta1/{name=projects/*/tenants/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4beta1/{name=projects/*/tenants/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateTenant": { + "requestType": "UpdateTenantRequest", + "responseType": "Tenant", + "options": { + "(google.api.http).patch": "/v4beta1/{tenant.name=projects/*/tenants/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "tenant" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v4beta1/{tenant.name=projects/*/tenants/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "tenant" + } + ] + }, + "DeleteTenant": { + "requestType": "DeleteTenantRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v4beta1/{name=projects/*/tenants/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v4beta1/{name=projects/*/tenants/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListTenants": { + "requestType": "ListTenantsRequest", + "responseType": "ListTenantsResponse", + "options": { + "(google.api.http).get": "/v4beta1/{parent=projects/*}/tenants", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v4beta1/{parent=projects/*}/tenants" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateTenantRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "tenant": { + "type": "Tenant", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetTenantRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "jobs.googleapis.com/Tenant" + } + } + } + }, + "UpdateTenantRequest": { + "fields": { + "tenant": { + "type": "Tenant", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteTenantRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "jobs.googleapis.com/Tenant" + } + } + } + }, + "ListTenantsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "ListTenantsResponse": { + "fields": { + "tenants": { + "rule": "repeated", + "type": "Tenant", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "metadata": { + "type": "ResponseMetadata", + "id": 3 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/timeofday;timeofday", + "java_multiple_files": true, + "java_outer_classname": "TimeOfDayProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "LatLng": { + "fields": { + "latitude": { + "type": "double", + "id": 1 + }, + "longitude": { + "type": "double", + "id": 2 + } + } + }, + "Money": { + "fields": { + "currencyCode": { + "type": "string", + "id": 1 + }, + "units": { + "type": "int64", + "id": 2 + }, + "nanos": { + "type": "int32", + "id": 3 + } + } + }, + "PostalAddress": { + "fields": { + "revision": { + "type": "int32", + "id": 1 + }, + "regionCode": { + "type": "string", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 + }, + "postalCode": { + "type": "string", + "id": 4 + }, + "sortingCode": { + "type": "string", + "id": 5 + }, + "administrativeArea": { + "type": "string", + "id": 6 + }, + "locality": { + "type": "string", + "id": 7 + }, + "sublocality": { + "type": "string", + "id": 8 + }, + "addressLines": { + "rule": "repeated", + "type": "string", + "id": 9 + }, + "recipients": { + "rule": "repeated", + "type": "string", + "id": 10 + }, + "organization": { + "type": "string", + "id": 11 + } + } + }, + "TimeOfDay": { + "fields": { + "hours": { + "type": "int32", + "id": 1 + }, + "minutes": { + "type": "int32", + "id": 2 + }, + "seconds": { + "type": "int32", + "id": 3 + }, + "nanos": { + "type": "int32", + "id": 4 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-talent/samples/.eslintrc.yml b/packages/google-cloud-talent/samples/.eslintrc.yml new file mode 100644 index 00000000000..282535f55f6 --- /dev/null +++ b/packages/google-cloud-talent/samples/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/packages/google-cloud-talent/samples/generated/v4/company_service.create_company.js b/packages/google-cloud-talent/samples/generated/v4/company_service.create_company.js new file mode 100644 index 00000000000..4401c38206d --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/company_service.create_company.js @@ -0,0 +1,68 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, company) { + // [START jobs_v4_generated_CompanyService_CreateCompany_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 tenant under which the company is created. + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenants/bar". + */ + // const parent = 'abc123' + /** + * Required. The company to be created. + */ + // const company = {} + + // Imports the Talent library + const {CompanyServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new CompanyServiceClient(); + + async function callCreateCompany() { + // Construct request + const request = { + parent, + company, + }; + + // Run request + const response = await talentClient.createCompany(request); + console.log(response); + } + + callCreateCompany(); + // [END jobs_v4_generated_CompanyService_CreateCompany_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/company_service.delete_company.js b/packages/google-cloud-talent/samples/generated/v4/company_service.delete_company.js new file mode 100644 index 00000000000..9a74b803f5c --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/company_service.delete_company.js @@ -0,0 +1,64 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START jobs_v4_generated_CompanyService_DeleteCompany_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 company to be deleted. + * The format is + * "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for + * example, "projects/foo/tenants/bar/companies/baz". + */ + // const name = 'abc123' + + // Imports the Talent library + const {CompanyServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new CompanyServiceClient(); + + async function callDeleteCompany() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await talentClient.deleteCompany(request); + console.log(response); + } + + callDeleteCompany(); + // [END jobs_v4_generated_CompanyService_DeleteCompany_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/company_service.get_company.js b/packages/google-cloud-talent/samples/generated/v4/company_service.get_company.js new file mode 100644 index 00000000000..434cbf422d0 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/company_service.get_company.js @@ -0,0 +1,64 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START jobs_v4_generated_CompanyService_GetCompany_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 company to be retrieved. + * The format is + * "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for + * example, "projects/api-test-project/tenants/foo/companies/bar". + */ + // const name = 'abc123' + + // Imports the Talent library + const {CompanyServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new CompanyServiceClient(); + + async function callGetCompany() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await talentClient.getCompany(request); + console.log(response); + } + + callGetCompany(); + // [END jobs_v4_generated_CompanyService_GetCompany_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/company_service.list_companies.js b/packages/google-cloud-talent/samples/generated/v4/company_service.list_companies.js new file mode 100644 index 00000000000..fb184a72c44 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/company_service.list_companies.js @@ -0,0 +1,81 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START jobs_v4_generated_CompanyService_ListCompanies_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 tenant under which the company is created. + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenants/bar". + */ + // const parent = 'abc123' + /** + * The starting indicator from which to return results. + */ + // const pageToken = 'abc123' + /** + * The maximum number of companies to be returned, at most 100. + * Default is 100 if a non-positive number is provided. + */ + // const pageSize = 1234 + /** + * Set to true if the companies requested must have open jobs. + * Defaults to false. + * If true, at most page_size google.cloud.talent.v4.ListCompaniesRequest.page_size of companies are fetched, among which + * only those with open jobs are returned. + */ + // const requireOpenJobs = true + + // Imports the Talent library + const {CompanyServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new CompanyServiceClient(); + + async function callListCompanies() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await talentClient.listCompaniesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCompanies(); + // [END jobs_v4_generated_CompanyService_ListCompanies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/company_service.update_company.js b/packages/google-cloud-talent/samples/generated/v4/company_service.update_company.js new file mode 100644 index 00000000000..7ebcf8d801e --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/company_service.update_company.js @@ -0,0 +1,69 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(company) { + // [START jobs_v4_generated_CompanyService_UpdateCompany_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 company resource to replace the current resource in the system. + */ + // const company = {} + /** + * Strongly recommended for the best service experience. + * If update_mask google.cloud.talent.v4.UpdateCompanyRequest.update_mask is provided, only the specified fields in + * company google.cloud.talent.v4.UpdateCompanyRequest.company are updated. Otherwise all the fields are updated. + * A field mask to specify the company fields to be updated. Only + * top level fields of Company google.cloud.talent.v4.Company are supported. + */ + // const updateMask = {} + + // Imports the Talent library + const {CompanyServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new CompanyServiceClient(); + + async function callUpdateCompany() { + // Construct request + const request = { + company, + }; + + // Run request + const response = await talentClient.updateCompany(request); + console.log(response); + } + + callUpdateCompany(); + // [END jobs_v4_generated_CompanyService_UpdateCompany_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/completion.complete_query.js b/packages/google-cloud-talent/samples/generated/v4/completion.complete_query.js new file mode 100644 index 00000000000..8ba7f3c7a69 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/completion.complete_query.js @@ -0,0 +1,98 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(tenant, query, pageSize) { + // [START jobs_v4_generated_Completion_CompleteQuery_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 tenant the completion is performed within. + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenants/bar". + */ + // const tenant = 'abc123' + /** + * Required. The query used to generate suggestions. + * The maximum number of allowed characters is 255. + */ + // const query = 'abc123' + /** + * The list of languages of the query. This is + * the BCP-47 language code, such as "en-US" or "sr-Latn". + * For more information, see + * Tags for Identifying Languages (https://tools.ietf.org/html/bcp47). + * The maximum number of allowed characters is 255. + */ + // const languageCodes = 'abc123' + /** + * Required. Completion result count. + * The maximum allowed page size is 10. + */ + // const pageSize = 1234 + /** + * If provided, restricts completion to specified company. + * The format is + * "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for + * example, "projects/foo/tenants/bar/companies/baz". + */ + // const company = 'abc123' + /** + * The scope of the completion. The defaults is CompletionScope.PUBLIC google.cloud.talent.v4.CompleteQueryRequest.CompletionScope.PUBLIC. + */ + // const scope = {} + /** + * The completion topic. The default is CompletionType.COMBINED google.cloud.talent.v4.CompleteQueryRequest.CompletionType.COMBINED. + */ + // const type = {} + + // Imports the Talent library + const {CompletionClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new CompletionClient(); + + async function callCompleteQuery() { + // Construct request + const request = { + tenant, + query, + pageSize, + }; + + // Run request + const response = await talentClient.completeQuery(request); + console.log(response); + } + + callCompleteQuery(); + // [END jobs_v4_generated_Completion_CompleteQuery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/event_service.create_client_event.js b/packages/google-cloud-talent/samples/generated/v4/event_service.create_client_event.js new file mode 100644 index 00000000000..5ec537394b2 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/event_service.create_client_event.js @@ -0,0 +1,69 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, clientEvent) { + // [START jobs_v4_generated_EventService_CreateClientEvent_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 tenant under which the event is created. + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenants/bar". + */ + // const parent = 'abc123' + /** + * Required. Events issued when end user interacts with customer's application that + * uses Cloud Talent Solution. + */ + // const clientEvent = {} + + // Imports the Talent library + const {EventServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new EventServiceClient(); + + async function callCreateClientEvent() { + // Construct request + const request = { + parent, + clientEvent, + }; + + // Run request + const response = await talentClient.createClientEvent(request); + console.log(response); + } + + callCreateClientEvent(); + // [END jobs_v4_generated_EventService_CreateClientEvent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/job_service.batch_create_jobs.js b/packages/google-cloud-talent/samples/generated/v4/job_service.batch_create_jobs.js new file mode 100644 index 00000000000..f098f9f157a --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/job_service.batch_create_jobs.js @@ -0,0 +1,70 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, jobs) { + // [START jobs_v4_generated_JobService_BatchCreateJobs_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 tenant under which the job is created. + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenants/bar". + */ + // const parent = 'abc123' + /** + * Required. The jobs to be created. + * A maximum of 200 jobs can be created in a batch. + */ + // const jobs = 1234 + + // Imports the Talent library + const {JobServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new JobServiceClient(); + + async function callBatchCreateJobs() { + // Construct request + const request = { + parent, + jobs, + }; + + // Run request + const [operation] = await talentClient.batchCreateJobs(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchCreateJobs(); + // [END jobs_v4_generated_JobService_BatchCreateJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/job_service.batch_delete_jobs.js b/packages/google-cloud-talent/samples/generated/v4/job_service.batch_delete_jobs.js new file mode 100644 index 00000000000..e23cd39f091 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/job_service.batch_delete_jobs.js @@ -0,0 +1,72 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START jobs_v4_generated_JobService_BatchDeleteJobs_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 tenant under which the job is created. + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenants/bar". + * The parent of all of the jobs specified in `names` must match this field. + */ + // const parent = 'abc123' + /** + * The names of the jobs to delete. + * The format is "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". + * For example, "projects/foo/tenants/bar/jobs/baz". + * A maximum of 200 jobs can be deleted in a batch. + */ + // const names = 'abc123' + + // Imports the Talent library + const {JobServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new JobServiceClient(); + + async function callBatchDeleteJobs() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await talentClient.batchDeleteJobs(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchDeleteJobs(); + // [END jobs_v4_generated_JobService_BatchDeleteJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/job_service.batch_update_jobs.js b/packages/google-cloud-talent/samples/generated/v4/job_service.batch_update_jobs.js new file mode 100644 index 00000000000..e31a64e6b5f --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/job_service.batch_update_jobs.js @@ -0,0 +1,84 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, jobs) { + // [START jobs_v4_generated_JobService_BatchUpdateJobs_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 tenant under which the job is created. + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenants/bar". + */ + // const parent = 'abc123' + /** + * Required. The jobs to be updated. + * A maximum of 200 jobs can be updated in a batch. + */ + // const jobs = 1234 + /** + * Strongly recommended for the best service experience. Be aware that it will + * also increase latency when checking the status of a batch operation. + * If update_mask google.cloud.talent.v4.BatchUpdateJobsRequest.update_mask is provided, only the specified fields in + * Job google.cloud.talent.v4.Job are updated. Otherwise all the fields are updated. + * A field mask to restrict the fields that are updated. Only + * top level fields of Job google.cloud.talent.v4.Job are supported. + * If update_mask google.cloud.talent.v4.BatchUpdateJobsRequest.update_mask is provided, The Job google.cloud.talent.v4.Job inside + * JobResult JobOperationResult.JobResult + * will only contains fields that is updated, plus the Id of the Job. + * Otherwise, Job google.cloud.talent.v4.Job will include all fields, which can yield a very + * large response. + */ + // const updateMask = {} + + // Imports the Talent library + const {JobServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new JobServiceClient(); + + async function callBatchUpdateJobs() { + // Construct request + const request = { + parent, + jobs, + }; + + // Run request + const [operation] = await talentClient.batchUpdateJobs(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchUpdateJobs(); + // [END jobs_v4_generated_JobService_BatchUpdateJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/job_service.create_job.js b/packages/google-cloud-talent/samples/generated/v4/job_service.create_job.js new file mode 100644 index 00000000000..d5e3b9f942c --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/job_service.create_job.js @@ -0,0 +1,68 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, job) { + // [START jobs_v4_generated_JobService_CreateJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the tenant under which the job is created. + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenants/bar". + */ + // const parent = 'abc123' + /** + * Required. The Job to be created. + */ + // const job = {} + + // Imports the Talent library + const {JobServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new JobServiceClient(); + + async function callCreateJob() { + // Construct request + const request = { + parent, + job, + }; + + // Run request + const response = await talentClient.createJob(request); + console.log(response); + } + + callCreateJob(); + // [END jobs_v4_generated_JobService_CreateJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/job_service.delete_job.js b/packages/google-cloud-talent/samples/generated/v4/job_service.delete_job.js new file mode 100644 index 00000000000..f8d1e867926 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/job_service.delete_job.js @@ -0,0 +1,64 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START jobs_v4_generated_JobService_DeleteJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the job to be deleted. + * The format is + * "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For + * example, "projects/foo/tenants/bar/jobs/baz". + */ + // const name = 'abc123' + + // Imports the Talent library + const {JobServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new JobServiceClient(); + + async function callDeleteJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await talentClient.deleteJob(request); + console.log(response); + } + + callDeleteJob(); + // [END jobs_v4_generated_JobService_DeleteJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/job_service.get_job.js b/packages/google-cloud-talent/samples/generated/v4/job_service.get_job.js new file mode 100644 index 00000000000..30a2b628081 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/job_service.get_job.js @@ -0,0 +1,64 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START jobs_v4_generated_JobService_GetJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the job to retrieve. + * The format is + * "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For + * example, "projects/foo/tenants/bar/jobs/baz". + */ + // const name = 'abc123' + + // Imports the Talent library + const {JobServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new JobServiceClient(); + + async function callGetJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await talentClient.getJob(request); + console.log(response); + } + + callGetJob(); + // [END jobs_v4_generated_JobService_GetJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/job_service.list_jobs.js b/packages/google-cloud-talent/samples/generated/v4/job_service.list_jobs.js new file mode 100644 index 00000000000..c579a8c5d0e --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/job_service.list_jobs.js @@ -0,0 +1,103 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, filter) { + // [START jobs_v4_generated_JobService_ListJobs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the tenant under which the job is created. + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenants/bar". + */ + // const parent = 'abc123' + /** + * Required. The filter string specifies the jobs to be enumerated. + * Supported operator: =, AND + * The fields eligible for filtering are: + * * `companyName` + * * `requisitionId` + * * `status` Available values: OPEN, EXPIRED, ALL. Defaults to + * OPEN if no value is specified. + * At least one of `companyName` and `requisitionId` must present or an + * INVALID_ARGUMENT error is thrown. + * Sample Query: + * * companyName = "projects/foo/tenants/bar/companies/baz" + * * companyName = "projects/foo/tenants/bar/companies/baz" AND + * requisitionId = "req-1" + * * companyName = "projects/foo/tenants/bar/companies/baz" AND + * status = "EXPIRED" + * * requisitionId = "req-1" + * * requisitionId = "req-1" AND status = "EXPIRED" + */ + // const filter = 'abc123' + /** + * The starting point of a query result. + */ + // const pageToken = 'abc123' + /** + * The maximum number of jobs to be returned per page of results. + * If job_view google.cloud.talent.v4.ListJobsRequest.job_view is set to JobView.JOB_VIEW_ID_ONLY google.cloud.talent.v4.JobView.JOB_VIEW_ID_ONLY, the maximum allowed + * page size is 1000. Otherwise, the maximum allowed page size is 100. + * Default is 100 if empty or a number < 1 is specified. + */ + // const pageSize = 1234 + /** + * The desired job attributes returned for jobs in the + * search response. Defaults to JobView.JOB_VIEW_FULL google.cloud.talent.v4.JobView.JOB_VIEW_FULL if no value is + * specified. + */ + // const jobView = {} + + // Imports the Talent library + const {JobServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new JobServiceClient(); + + async function callListJobs() { + // Construct request + const request = { + parent, + filter, + }; + + // Run request + const iterable = await talentClient.listJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListJobs(); + // [END jobs_v4_generated_JobService_ListJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/job_service.search_jobs.js b/packages/google-cloud-talent/samples/generated/v4/job_service.search_jobs.js new file mode 100644 index 00000000000..0c33fbf1f50 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/job_service.search_jobs.js @@ -0,0 +1,299 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, requestMetadata) { + // [START jobs_v4_generated_JobService_SearchJobs_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 tenant to search within. + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenants/bar". + */ + // const parent = 'abc123' + /** + * Mode of a search. + * Defaults to SearchMode.JOB_SEARCH google.cloud.talent.v4.SearchJobsRequest.SearchMode.JOB_SEARCH. + */ + // const searchMode = {} + /** + * Required. The meta information collected about the job searcher, used to improve the + * search quality of the service. The identifiers (such as `user_id`) are + * provided by users, and must be unique and consistent. + */ + // const requestMetadata = {} + /** + * Query used to search against jobs, such as keyword, location filters, etc. + */ + // const jobQuery = {} + /** + * Controls whether to broaden the search when it produces sparse results. + * Broadened queries append results to the end of the matching results + * list. + * Defaults to false. + */ + // const enableBroadening = true + /** + * An expression specifies a histogram request against matching jobs. + * Expression syntax is an aggregation function call with histogram facets and + * other options. + * Available aggregation function calls are: + * * `count(string_histogram_facet)`: Count the number of matching entities, + * for each distinct attribute value. + * * `count(numeric_histogram_facet, list of buckets)`: Count the number of + * matching entities within each bucket. + * A maximum of 200 histogram buckets are supported. + * Data types: + * * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + * * String: string like "any string with backslash escape for quote(\")." + * * Number: whole number and floating point number like 10, -1 and -0.01. + * * List: list of elements with comma(,) separator surrounded by square + * brackets, for example, 1, 2, 3 and "one", "two", "three". + * Built-in constants: + * * MIN (minimum number similar to java Double.MIN_VALUE) + * * MAX (maximum number similar to java Double.MAX_VALUE) + * Built-in functions: + * * bucket(start, end, label): bucket built-in function creates a bucket + * with range of start, end). Note that the end is exclusive, for example, + * bucket(1, MAX, "positive number") or bucket(1, 10). + * Job histogram facets: + * * company_display_name: histogram by Job.company_display_name google.cloud.talent.v4.Job.company_display_name. + * * employment_type: histogram by Job.employment_types google.cloud.talent.v4.Job.employment_types, for example, + * "FULL_TIME", "PART_TIME". + * * company_size (DEPRECATED): histogram by CompanySize google.cloud.talent.v4.CompanySize, for example, + * "SMALL", "MEDIUM", "BIG". + * * publish_time_in_day: histogram by the Job.posting_publish_time google.cloud.talent.v4.Job.posting_publish_time + * in days. + * Must specify list of numeric buckets in spec. + * * publish_time_in_month: histogram by the Job.posting_publish_time google.cloud.talent.v4.Job.posting_publish_time + * in months. + * Must specify list of numeric buckets in spec. + * * publish_time_in_year: histogram by the Job.posting_publish_time google.cloud.talent.v4.Job.posting_publish_time + * in years. + * Must specify list of numeric buckets in spec. + * * degree_types: histogram by the Job.degree_types google.cloud.talent.v4.Job.degree_types, for example, + * "Bachelors", "Masters". + * * job_level: histogram by the Job.job_level google.cloud.talent.v4.Job.job_level, for example, "Entry + * Level". + * * country: histogram by the country code of jobs, for example, "US", "FR". + * * admin1: histogram by the admin1 code of jobs, which is a global + * placeholder referring to the state, province, or the particular term a + * country uses to define the geographic structure below the country level, + * for example, "CA", "IL". + * * city: histogram by a combination of the "city name, admin1 code". For + * example, "Mountain View, CA", "New York, NY". + * * admin1_country: histogram by a combination of the "admin1 code, country", + * for example, "CA, US", "IL, US". + * * city_coordinate: histogram by the city center's GPS coordinates (latitude + * and longitude), for example, 37.4038522,-122.0987765. Since the + * coordinates of a city center can change, customers may need to refresh + * them periodically. + * * locale: histogram by the Job.language_code google.cloud.talent.v4.Job.language_code, for example, "en-US", + * "fr-FR". + * * language: histogram by the language subtag of the Job.language_code google.cloud.talent.v4.Job.language_code, + * for example, "en", "fr". + * * category: histogram by the JobCategory google.cloud.talent.v4.JobCategory, for example, + * "COMPUTER_AND_IT", "HEALTHCARE". + * * base_compensation_unit: histogram by the + * CompensationInfo.CompensationUnit google.cloud.talent.v4.CompensationInfo.CompensationUnit of base + * salary, for example, "WEEKLY", "MONTHLY". + * * base_compensation: histogram by the base salary. Must specify list of + * numeric buckets to group results by. + * * annualized_base_compensation: histogram by the base annualized salary. + * Must specify list of numeric buckets to group results by. + * * annualized_total_compensation: histogram by the total annualized salary. + * Must specify list of numeric buckets to group results by. + * * string_custom_attribute: histogram by string Job.custom_attributes google.cloud.talent.v4.Job.custom_attributes. + * Values can be accessed via square bracket notations like + * string_custom_attribute"key1". + * * numeric_custom_attribute: histogram by numeric Job.custom_attributes google.cloud.talent.v4.Job.custom_attributes. + * Values can be accessed via square bracket notations like + * numeric_custom_attribute"key1". Must specify list of numeric buckets to + * group results by. + * Example expressions: + * * `count(admin1)` + * * `count(base_compensation, bucket(1000, 10000), bucket(10000, 100000), + * bucket(100000, MAX))` + * * `count(string_custom_attribute"some-string-custom-attribute")` + * * `count(numeric_custom_attribute"some-numeric-custom-attribute", + * bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative"))` + */ + // const histogramQueries = 1234 + /** + * The desired job attributes returned for jobs in the search response. + * Defaults to JobView.JOB_VIEW_SMALL google.cloud.talent.v4.JobView.JOB_VIEW_SMALL if no value is specified. + */ + // const jobView = {} + /** + * An integer that specifies the current offset (that is, starting result + * location, amongst the jobs deemed by the API as relevant) in search + * results. This field is only considered if page_token google.cloud.talent.v4.SearchJobsRequest.page_token is unset. + * The maximum allowed value is 5000. Otherwise an error is thrown. + * For example, 0 means to return results starting from the first matching + * job, and 10 means to return from the 11th job. This can be used for + * pagination, (for example, pageSize = 10 and offset = 10 means to return + * from the second page). + */ + // const offset = 1234 + /** + * A limit on the number of jobs returned in the search results. + * Increasing this value above the default value of 10 can increase search + * response time. The value can be between 1 and 100. + */ + // const maxPageSize = 1234 + /** + * The token specifying the current offset within + * search results. See SearchJobsResponse.next_page_token google.cloud.talent.v4.SearchJobsResponse.next_page_token for + * an explanation of how to obtain the next set of query results. + */ + // const pageToken = 'abc123' + /** + * The criteria determining how search results are sorted. Default is + * `"relevance desc"`. + * Supported options are: + * * `"relevance desc"`: By relevance descending, as determined by the API + * algorithms. Relevance thresholding of query results is only available + * with this ordering. + * * `"posting_publish_time desc"`: By Job.posting_publish_time google.cloud.talent.v4.Job.posting_publish_time + * descending. + * * `"posting_update_time desc"`: By Job.posting_update_time google.cloud.talent.v4.Job.posting_update_time + * descending. + * * `"title"`: By Job.title google.cloud.talent.v4.Job.title ascending. + * * `"title desc"`: By Job.title google.cloud.talent.v4.Job.title descending. + * * `"annualized_base_compensation"`: By job's + * CompensationInfo.annualized_base_compensation_range google.cloud.talent.v4.CompensationInfo.annualized_base_compensation_range ascending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_base_compensation desc"`: By job's + * CompensationInfo.annualized_base_compensation_range google.cloud.talent.v4.CompensationInfo.annualized_base_compensation_range descending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_total_compensation"`: By job's + * CompensationInfo.annualized_total_compensation_range google.cloud.talent.v4.CompensationInfo.annualized_total_compensation_range ascending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_total_compensation desc"`: By job's + * CompensationInfo.annualized_total_compensation_range google.cloud.talent.v4.CompensationInfo.annualized_total_compensation_range descending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"custom_ranking desc"`: By the relevance score adjusted to the + * SearchJobsRequest.CustomRankingInfo.ranking_expression google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ranking_expression with weight + * factor assigned by + * SearchJobsRequest.CustomRankingInfo.importance_level google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.importance_level in descending + * order. + * * Location sorting: Use the special syntax to order jobs by distance:
+ * `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ * `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ * `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + * multiple locations. See details below.
+ * `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + * multiple locations. See details below.
+ * The string can have a maximum of 256 characters. When multiple distance + * centers are provided, a job that is close to any of the distance centers + * would have a high rank. When a job has multiple locations, the job + * location closest to one of the distance centers will be used. Jobs that + * don't have locations will be ranked at the bottom. Distance is calculated + * with a precision of 11.3 meters (37.4 feet). Diversification strategy is + * still applied unless explicitly disabled in + * diversification_level google.cloud.talent.v4.SearchJobsRequest.diversification_level. + */ + // const orderBy = 'abc123' + /** + * Controls whether highly similar jobs are returned next to each other in + * the search results. Jobs are identified as highly similar based on + * their titles, job categories, and locations. Highly similar results are + * clustered so that only one representative job of the cluster is + * displayed to the job seeker higher up in the results, with the other jobs + * being displayed lower down in the results. + * Defaults to DiversificationLevel.SIMPLE google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel.SIMPLE if no value + * is specified. + */ + // const diversificationLevel = {} + /** + * Controls over how job documents get ranked on top of existing relevance + * score (determined by API algorithm). + */ + // const customRankingInfo = {} + /** + * This field is deprecated. Please use + * SearchJobsRequest.keyword_match_mode google.cloud.talent.v4.SearchJobsRequest.keyword_match_mode going forward. + * To migrate, disable_keyword_match set to false maps to + * KeywordMatchMode.KEYWORD_MATCH_ALL google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL, and disable_keyword_match set to + * true maps to KeywordMatchMode.KEYWORD_MATCH_DISABLED google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_DISABLED. If + * SearchJobsRequest.keyword_match_mode google.cloud.talent.v4.SearchJobsRequest.keyword_match_mode is set, this field is ignored. + * Controls whether to disable exact keyword match on Job.title google.cloud.talent.v4.Job.title, + * Job.description google.cloud.talent.v4.Job.description, Job.company_display_name google.cloud.talent.v4.Job.company_display_name, Job.addresses google.cloud.talent.v4.Job.addresses, + * Job.qualifications google.cloud.talent.v4.Job.qualifications. When disable keyword match is turned off, a + * keyword match returns jobs that do not match given category filters when + * there are matching keywords. For example, for the query "program manager," + * a result is returned even if the job posting has the title "software + * developer," which doesn't fall into "program manager" ontology, but does + * have "program manager" appearing in its description. + * For queries like "cloud" that don't contain title or + * location specific ontology, jobs with "cloud" keyword matches are returned + * regardless of this flag's value. + * Use Company.keyword_searchable_job_custom_attributes google.cloud.talent.v4.Company.keyword_searchable_job_custom_attributes if + * company-specific globally matched custom field/attribute string values are + * needed. Enabling keyword match improves recall of subsequent search + * requests. + * Defaults to false. + */ + // const disableKeywordMatch = true + /** + * Controls what keyword match options to use. If both keyword_match_mode and + * disable_keyword_match are set, keyword_match_mode will take precedence. + * Defaults to KeywordMatchMode.KEYWORD_MATCH_ALL google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL if no value + * is specified. + */ + // const keywordMatchMode = {} + + // Imports the Talent library + const {JobServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new JobServiceClient(); + + async function callSearchJobs() { + // Construct request + const request = { + parent, + requestMetadata, + }; + + // Run request + const response = await talentClient.searchJobs(request); + console.log(response); + } + + callSearchJobs(); + // [END jobs_v4_generated_JobService_SearchJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/job_service.search_jobs_for_alert.js b/packages/google-cloud-talent/samples/generated/v4/job_service.search_jobs_for_alert.js new file mode 100644 index 00000000000..035b48d0691 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/job_service.search_jobs_for_alert.js @@ -0,0 +1,299 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, requestMetadata) { + // [START jobs_v4_generated_JobService_SearchJobsForAlert_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 tenant to search within. + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenants/bar". + */ + // const parent = 'abc123' + /** + * Mode of a search. + * Defaults to SearchMode.JOB_SEARCH google.cloud.talent.v4.SearchJobsRequest.SearchMode.JOB_SEARCH. + */ + // const searchMode = {} + /** + * Required. The meta information collected about the job searcher, used to improve the + * search quality of the service. The identifiers (such as `user_id`) are + * provided by users, and must be unique and consistent. + */ + // const requestMetadata = {} + /** + * Query used to search against jobs, such as keyword, location filters, etc. + */ + // const jobQuery = {} + /** + * Controls whether to broaden the search when it produces sparse results. + * Broadened queries append results to the end of the matching results + * list. + * Defaults to false. + */ + // const enableBroadening = true + /** + * An expression specifies a histogram request against matching jobs. + * Expression syntax is an aggregation function call with histogram facets and + * other options. + * Available aggregation function calls are: + * * `count(string_histogram_facet)`: Count the number of matching entities, + * for each distinct attribute value. + * * `count(numeric_histogram_facet, list of buckets)`: Count the number of + * matching entities within each bucket. + * A maximum of 200 histogram buckets are supported. + * Data types: + * * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + * * String: string like "any string with backslash escape for quote(\")." + * * Number: whole number and floating point number like 10, -1 and -0.01. + * * List: list of elements with comma(,) separator surrounded by square + * brackets, for example, 1, 2, 3 and "one", "two", "three". + * Built-in constants: + * * MIN (minimum number similar to java Double.MIN_VALUE) + * * MAX (maximum number similar to java Double.MAX_VALUE) + * Built-in functions: + * * bucket(start, end, label): bucket built-in function creates a bucket + * with range of start, end). Note that the end is exclusive, for example, + * bucket(1, MAX, "positive number") or bucket(1, 10). + * Job histogram facets: + * * company_display_name: histogram by Job.company_display_name google.cloud.talent.v4.Job.company_display_name. + * * employment_type: histogram by Job.employment_types google.cloud.talent.v4.Job.employment_types, for example, + * "FULL_TIME", "PART_TIME". + * * company_size (DEPRECATED): histogram by CompanySize google.cloud.talent.v4.CompanySize, for example, + * "SMALL", "MEDIUM", "BIG". + * * publish_time_in_day: histogram by the Job.posting_publish_time google.cloud.talent.v4.Job.posting_publish_time + * in days. + * Must specify list of numeric buckets in spec. + * * publish_time_in_month: histogram by the Job.posting_publish_time google.cloud.talent.v4.Job.posting_publish_time + * in months. + * Must specify list of numeric buckets in spec. + * * publish_time_in_year: histogram by the Job.posting_publish_time google.cloud.talent.v4.Job.posting_publish_time + * in years. + * Must specify list of numeric buckets in spec. + * * degree_types: histogram by the Job.degree_types google.cloud.talent.v4.Job.degree_types, for example, + * "Bachelors", "Masters". + * * job_level: histogram by the Job.job_level google.cloud.talent.v4.Job.job_level, for example, "Entry + * Level". + * * country: histogram by the country code of jobs, for example, "US", "FR". + * * admin1: histogram by the admin1 code of jobs, which is a global + * placeholder referring to the state, province, or the particular term a + * country uses to define the geographic structure below the country level, + * for example, "CA", "IL". + * * city: histogram by a combination of the "city name, admin1 code". For + * example, "Mountain View, CA", "New York, NY". + * * admin1_country: histogram by a combination of the "admin1 code, country", + * for example, "CA, US", "IL, US". + * * city_coordinate: histogram by the city center's GPS coordinates (latitude + * and longitude), for example, 37.4038522,-122.0987765. Since the + * coordinates of a city center can change, customers may need to refresh + * them periodically. + * * locale: histogram by the Job.language_code google.cloud.talent.v4.Job.language_code, for example, "en-US", + * "fr-FR". + * * language: histogram by the language subtag of the Job.language_code google.cloud.talent.v4.Job.language_code, + * for example, "en", "fr". + * * category: histogram by the JobCategory google.cloud.talent.v4.JobCategory, for example, + * "COMPUTER_AND_IT", "HEALTHCARE". + * * base_compensation_unit: histogram by the + * CompensationInfo.CompensationUnit google.cloud.talent.v4.CompensationInfo.CompensationUnit of base + * salary, for example, "WEEKLY", "MONTHLY". + * * base_compensation: histogram by the base salary. Must specify list of + * numeric buckets to group results by. + * * annualized_base_compensation: histogram by the base annualized salary. + * Must specify list of numeric buckets to group results by. + * * annualized_total_compensation: histogram by the total annualized salary. + * Must specify list of numeric buckets to group results by. + * * string_custom_attribute: histogram by string Job.custom_attributes google.cloud.talent.v4.Job.custom_attributes. + * Values can be accessed via square bracket notations like + * string_custom_attribute"key1". + * * numeric_custom_attribute: histogram by numeric Job.custom_attributes google.cloud.talent.v4.Job.custom_attributes. + * Values can be accessed via square bracket notations like + * numeric_custom_attribute"key1". Must specify list of numeric buckets to + * group results by. + * Example expressions: + * * `count(admin1)` + * * `count(base_compensation, bucket(1000, 10000), bucket(10000, 100000), + * bucket(100000, MAX))` + * * `count(string_custom_attribute"some-string-custom-attribute")` + * * `count(numeric_custom_attribute"some-numeric-custom-attribute", + * bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative"))` + */ + // const histogramQueries = 1234 + /** + * The desired job attributes returned for jobs in the search response. + * Defaults to JobView.JOB_VIEW_SMALL google.cloud.talent.v4.JobView.JOB_VIEW_SMALL if no value is specified. + */ + // const jobView = {} + /** + * An integer that specifies the current offset (that is, starting result + * location, amongst the jobs deemed by the API as relevant) in search + * results. This field is only considered if page_token google.cloud.talent.v4.SearchJobsRequest.page_token is unset. + * The maximum allowed value is 5000. Otherwise an error is thrown. + * For example, 0 means to return results starting from the first matching + * job, and 10 means to return from the 11th job. This can be used for + * pagination, (for example, pageSize = 10 and offset = 10 means to return + * from the second page). + */ + // const offset = 1234 + /** + * A limit on the number of jobs returned in the search results. + * Increasing this value above the default value of 10 can increase search + * response time. The value can be between 1 and 100. + */ + // const maxPageSize = 1234 + /** + * The token specifying the current offset within + * search results. See SearchJobsResponse.next_page_token google.cloud.talent.v4.SearchJobsResponse.next_page_token for + * an explanation of how to obtain the next set of query results. + */ + // const pageToken = 'abc123' + /** + * The criteria determining how search results are sorted. Default is + * `"relevance desc"`. + * Supported options are: + * * `"relevance desc"`: By relevance descending, as determined by the API + * algorithms. Relevance thresholding of query results is only available + * with this ordering. + * * `"posting_publish_time desc"`: By Job.posting_publish_time google.cloud.talent.v4.Job.posting_publish_time + * descending. + * * `"posting_update_time desc"`: By Job.posting_update_time google.cloud.talent.v4.Job.posting_update_time + * descending. + * * `"title"`: By Job.title google.cloud.talent.v4.Job.title ascending. + * * `"title desc"`: By Job.title google.cloud.talent.v4.Job.title descending. + * * `"annualized_base_compensation"`: By job's + * CompensationInfo.annualized_base_compensation_range google.cloud.talent.v4.CompensationInfo.annualized_base_compensation_range ascending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_base_compensation desc"`: By job's + * CompensationInfo.annualized_base_compensation_range google.cloud.talent.v4.CompensationInfo.annualized_base_compensation_range descending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_total_compensation"`: By job's + * CompensationInfo.annualized_total_compensation_range google.cloud.talent.v4.CompensationInfo.annualized_total_compensation_range ascending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_total_compensation desc"`: By job's + * CompensationInfo.annualized_total_compensation_range google.cloud.talent.v4.CompensationInfo.annualized_total_compensation_range descending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"custom_ranking desc"`: By the relevance score adjusted to the + * SearchJobsRequest.CustomRankingInfo.ranking_expression google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ranking_expression with weight + * factor assigned by + * SearchJobsRequest.CustomRankingInfo.importance_level google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.importance_level in descending + * order. + * * Location sorting: Use the special syntax to order jobs by distance:
+ * `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ * `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ * `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + * multiple locations. See details below.
+ * `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + * multiple locations. See details below.
+ * The string can have a maximum of 256 characters. When multiple distance + * centers are provided, a job that is close to any of the distance centers + * would have a high rank. When a job has multiple locations, the job + * location closest to one of the distance centers will be used. Jobs that + * don't have locations will be ranked at the bottom. Distance is calculated + * with a precision of 11.3 meters (37.4 feet). Diversification strategy is + * still applied unless explicitly disabled in + * diversification_level google.cloud.talent.v4.SearchJobsRequest.diversification_level. + */ + // const orderBy = 'abc123' + /** + * Controls whether highly similar jobs are returned next to each other in + * the search results. Jobs are identified as highly similar based on + * their titles, job categories, and locations. Highly similar results are + * clustered so that only one representative job of the cluster is + * displayed to the job seeker higher up in the results, with the other jobs + * being displayed lower down in the results. + * Defaults to DiversificationLevel.SIMPLE google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel.SIMPLE if no value + * is specified. + */ + // const diversificationLevel = {} + /** + * Controls over how job documents get ranked on top of existing relevance + * score (determined by API algorithm). + */ + // const customRankingInfo = {} + /** + * This field is deprecated. Please use + * SearchJobsRequest.keyword_match_mode google.cloud.talent.v4.SearchJobsRequest.keyword_match_mode going forward. + * To migrate, disable_keyword_match set to false maps to + * KeywordMatchMode.KEYWORD_MATCH_ALL google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL, and disable_keyword_match set to + * true maps to KeywordMatchMode.KEYWORD_MATCH_DISABLED google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_DISABLED. If + * SearchJobsRequest.keyword_match_mode google.cloud.talent.v4.SearchJobsRequest.keyword_match_mode is set, this field is ignored. + * Controls whether to disable exact keyword match on Job.title google.cloud.talent.v4.Job.title, + * Job.description google.cloud.talent.v4.Job.description, Job.company_display_name google.cloud.talent.v4.Job.company_display_name, Job.addresses google.cloud.talent.v4.Job.addresses, + * Job.qualifications google.cloud.talent.v4.Job.qualifications. When disable keyword match is turned off, a + * keyword match returns jobs that do not match given category filters when + * there are matching keywords. For example, for the query "program manager," + * a result is returned even if the job posting has the title "software + * developer," which doesn't fall into "program manager" ontology, but does + * have "program manager" appearing in its description. + * For queries like "cloud" that don't contain title or + * location specific ontology, jobs with "cloud" keyword matches are returned + * regardless of this flag's value. + * Use Company.keyword_searchable_job_custom_attributes google.cloud.talent.v4.Company.keyword_searchable_job_custom_attributes if + * company-specific globally matched custom field/attribute string values are + * needed. Enabling keyword match improves recall of subsequent search + * requests. + * Defaults to false. + */ + // const disableKeywordMatch = true + /** + * Controls what keyword match options to use. If both keyword_match_mode and + * disable_keyword_match are set, keyword_match_mode will take precedence. + * Defaults to KeywordMatchMode.KEYWORD_MATCH_ALL google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL if no value + * is specified. + */ + // const keywordMatchMode = {} + + // Imports the Talent library + const {JobServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new JobServiceClient(); + + async function callSearchJobsForAlert() { + // Construct request + const request = { + parent, + requestMetadata, + }; + + // Run request + const response = await talentClient.searchJobsForAlert(request); + console.log(response); + } + + callSearchJobsForAlert(); + // [END jobs_v4_generated_JobService_SearchJobsForAlert_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/job_service.update_job.js b/packages/google-cloud-talent/samples/generated/v4/job_service.update_job.js new file mode 100644 index 00000000000..96b4d2d5631 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/job_service.update_job.js @@ -0,0 +1,69 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(job) { + // [START jobs_v4_generated_JobService_UpdateJob_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 Job to be updated. + */ + // const job = {} + /** + * Strongly recommended for the best service experience. + * If update_mask google.cloud.talent.v4.UpdateJobRequest.update_mask is provided, only the specified fields in + * job google.cloud.talent.v4.UpdateJobRequest.job are updated. Otherwise all the fields are updated. + * A field mask to restrict the fields that are updated. Only + * top level fields of Job google.cloud.talent.v4.Job are supported. + */ + // const updateMask = {} + + // Imports the Talent library + const {JobServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new JobServiceClient(); + + async function callUpdateJob() { + // Construct request + const request = { + job, + }; + + // Run request + const response = await talentClient.updateJob(request); + console.log(response); + } + + callUpdateJob(); + // [END jobs_v4_generated_JobService_UpdateJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/snippet_metadata.google.cloud.talent.v4.json b/packages/google-cloud-talent/samples/generated/v4/snippet_metadata.google.cloud.talent.v4.json new file mode 100644 index 00000000000..d2f18700a89 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/snippet_metadata.google.cloud.talent.v4.json @@ -0,0 +1,1111 @@ +{ + "clientLibrary": { + "name": "nodejs-talent", + "version": "5.0.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.talent.v4", + "version": "v4" + } + ] + }, + "snippets": [ + { + "regionTag": "jobs_v4_generated_CompanyService_CreateCompany_async", + "title": "talent createCompany Sample", + "origin": "API_DEFINITION", + "description": " Creates a new company entity.", + "canonical": true, + "file": "company_service.create_company.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCompany", + "fullName": "google.cloud.talent.v4.CompanyService.CreateCompany", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "company", + "type": ".google.cloud.talent.v4.Company" + } + ], + "resultType": ".google.cloud.talent.v4.Company", + "client": { + "shortName": "CompanyServiceClient", + "fullName": "google.cloud.talent.v4.CompanyServiceClient" + }, + "method": { + "shortName": "CreateCompany", + "fullName": "google.cloud.talent.v4.CompanyService.CreateCompany", + "service": { + "shortName": "CompanyService", + "fullName": "google.cloud.talent.v4.CompanyService" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_CompanyService_GetCompany_async", + "title": "talent getCompany Sample", + "origin": "API_DEFINITION", + "description": " Retrieves specified company.", + "canonical": true, + "file": "company_service.get_company.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCompany", + "fullName": "google.cloud.talent.v4.CompanyService.GetCompany", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.talent.v4.Company", + "client": { + "shortName": "CompanyServiceClient", + "fullName": "google.cloud.talent.v4.CompanyServiceClient" + }, + "method": { + "shortName": "GetCompany", + "fullName": "google.cloud.talent.v4.CompanyService.GetCompany", + "service": { + "shortName": "CompanyService", + "fullName": "google.cloud.talent.v4.CompanyService" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_CompanyService_UpdateCompany_async", + "title": "talent updateCompany Sample", + "origin": "API_DEFINITION", + "description": " Updates specified company.", + "canonical": true, + "file": "company_service.update_company.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCompany", + "fullName": "google.cloud.talent.v4.CompanyService.UpdateCompany", + "async": true, + "parameters": [ + { + "name": "company", + "type": ".google.cloud.talent.v4.Company" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.talent.v4.Company", + "client": { + "shortName": "CompanyServiceClient", + "fullName": "google.cloud.talent.v4.CompanyServiceClient" + }, + "method": { + "shortName": "UpdateCompany", + "fullName": "google.cloud.talent.v4.CompanyService.UpdateCompany", + "service": { + "shortName": "CompanyService", + "fullName": "google.cloud.talent.v4.CompanyService" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_CompanyService_DeleteCompany_async", + "title": "talent deleteCompany Sample", + "origin": "API_DEFINITION", + "description": " Deletes specified company. Prerequisite: The company has no jobs associated with it.", + "canonical": true, + "file": "company_service.delete_company.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCompany", + "fullName": "google.cloud.talent.v4.CompanyService.DeleteCompany", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "CompanyServiceClient", + "fullName": "google.cloud.talent.v4.CompanyServiceClient" + }, + "method": { + "shortName": "DeleteCompany", + "fullName": "google.cloud.talent.v4.CompanyService.DeleteCompany", + "service": { + "shortName": "CompanyService", + "fullName": "google.cloud.talent.v4.CompanyService" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_CompanyService_ListCompanies_async", + "title": "talent listCompanies Sample", + "origin": "API_DEFINITION", + "description": " Lists all companies associated with the project.", + "canonical": true, + "file": "company_service.list_companies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCompanies", + "fullName": "google.cloud.talent.v4.CompanyService.ListCompanies", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "require_open_jobs", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.talent.v4.ListCompaniesResponse", + "client": { + "shortName": "CompanyServiceClient", + "fullName": "google.cloud.talent.v4.CompanyServiceClient" + }, + "method": { + "shortName": "ListCompanies", + "fullName": "google.cloud.talent.v4.CompanyService.ListCompanies", + "service": { + "shortName": "CompanyService", + "fullName": "google.cloud.talent.v4.CompanyService" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_Completion_CompleteQuery_async", + "title": "talent completeQuery Sample", + "origin": "API_DEFINITION", + "description": " Completes the specified prefix with keyword suggestions. Intended for use by a job search auto-complete search box.", + "canonical": true, + "file": "completion.complete_query.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 90, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CompleteQuery", + "fullName": "google.cloud.talent.v4.Completion.CompleteQuery", + "async": true, + "parameters": [ + { + "name": "tenant", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "language_codes", + "type": "TYPE_STRING[]" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "company", + "type": "TYPE_STRING" + }, + { + "name": "scope", + "type": ".google.cloud.talent.v4.CompleteQueryRequest.CompletionScope" + }, + { + "name": "type", + "type": ".google.cloud.talent.v4.CompleteQueryRequest.CompletionType" + } + ], + "resultType": ".google.cloud.talent.v4.CompleteQueryResponse", + "client": { + "shortName": "CompletionClient", + "fullName": "google.cloud.talent.v4.CompletionClient" + }, + "method": { + "shortName": "CompleteQuery", + "fullName": "google.cloud.talent.v4.Completion.CompleteQuery", + "service": { + "shortName": "Completion", + "fullName": "google.cloud.talent.v4.Completion" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_EventService_CreateClientEvent_async", + "title": "talent createClientEvent Sample", + "origin": "API_DEFINITION", + "description": " Report events issued when end user interacts with customer's application that uses Cloud Talent Solution. You may inspect the created events in [self service tools](https://console.cloud.google.com/talent-solution/overview). [Learn more](https://cloud.google.com/talent-solution/docs/management-tools) about self service tools.", + "canonical": true, + "file": "event_service.create_client_event.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateClientEvent", + "fullName": "google.cloud.talent.v4.EventService.CreateClientEvent", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "client_event", + "type": ".google.cloud.talent.v4.ClientEvent" + } + ], + "resultType": ".google.cloud.talent.v4.ClientEvent", + "client": { + "shortName": "EventServiceClient", + "fullName": "google.cloud.talent.v4.EventServiceClient" + }, + "method": { + "shortName": "CreateClientEvent", + "fullName": "google.cloud.talent.v4.EventService.CreateClientEvent", + "service": { + "shortName": "EventService", + "fullName": "google.cloud.talent.v4.EventService" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_JobService_CreateJob_async", + "title": "talent createJob Sample", + "origin": "API_DEFINITION", + "description": " Creates a new job. Typically, the job becomes searchable within 10 seconds, but it may take up to 5 minutes.", + "canonical": true, + "file": "job_service.create_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateJob", + "fullName": "google.cloud.talent.v4.JobService.CreateJob", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "job", + "type": ".google.cloud.talent.v4.Job" + } + ], + "resultType": ".google.cloud.talent.v4.Job", + "client": { + "shortName": "JobServiceClient", + "fullName": "google.cloud.talent.v4.JobServiceClient" + }, + "method": { + "shortName": "CreateJob", + "fullName": "google.cloud.talent.v4.JobService.CreateJob", + "service": { + "shortName": "JobService", + "fullName": "google.cloud.talent.v4.JobService" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_JobService_BatchCreateJobs_async", + "title": "talent batchCreateJobs Sample", + "origin": "API_DEFINITION", + "description": " Begins executing a batch create jobs operation.", + "canonical": true, + "file": "job_service.batch_create_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchCreateJobs", + "fullName": "google.cloud.talent.v4.JobService.BatchCreateJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "jobs", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "JobServiceClient", + "fullName": "google.cloud.talent.v4.JobServiceClient" + }, + "method": { + "shortName": "BatchCreateJobs", + "fullName": "google.cloud.talent.v4.JobService.BatchCreateJobs", + "service": { + "shortName": "JobService", + "fullName": "google.cloud.talent.v4.JobService" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_JobService_GetJob_async", + "title": "talent getJob Sample", + "origin": "API_DEFINITION", + "description": " Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days.", + "canonical": true, + "file": "job_service.get_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJob", + "fullName": "google.cloud.talent.v4.JobService.GetJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.talent.v4.Job", + "client": { + "shortName": "JobServiceClient", + "fullName": "google.cloud.talent.v4.JobServiceClient" + }, + "method": { + "shortName": "GetJob", + "fullName": "google.cloud.talent.v4.JobService.GetJob", + "service": { + "shortName": "JobService", + "fullName": "google.cloud.talent.v4.JobService" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_JobService_UpdateJob_async", + "title": "talent updateJob Sample", + "origin": "API_DEFINITION", + "description": " Updates specified job. Typically, updated contents become visible in search results within 10 seconds, but it may take up to 5 minutes.", + "canonical": true, + "file": "job_service.update_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateJob", + "fullName": "google.cloud.talent.v4.JobService.UpdateJob", + "async": true, + "parameters": [ + { + "name": "job", + "type": ".google.cloud.talent.v4.Job" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.talent.v4.Job", + "client": { + "shortName": "JobServiceClient", + "fullName": "google.cloud.talent.v4.JobServiceClient" + }, + "method": { + "shortName": "UpdateJob", + "fullName": "google.cloud.talent.v4.JobService.UpdateJob", + "service": { + "shortName": "JobService", + "fullName": "google.cloud.talent.v4.JobService" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_JobService_BatchUpdateJobs_async", + "title": "talent batchUpdateJobs Sample", + "origin": "API_DEFINITION", + "description": " Begins executing a batch update jobs operation.", + "canonical": true, + "file": "job_service.batch_update_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchUpdateJobs", + "fullName": "google.cloud.talent.v4.JobService.BatchUpdateJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "jobs", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "JobServiceClient", + "fullName": "google.cloud.talent.v4.JobServiceClient" + }, + "method": { + "shortName": "BatchUpdateJobs", + "fullName": "google.cloud.talent.v4.JobService.BatchUpdateJobs", + "service": { + "shortName": "JobService", + "fullName": "google.cloud.talent.v4.JobService" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_JobService_DeleteJob_async", + "title": "talent deleteJob Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified job. Typically, the job becomes unsearchable within 10 seconds, but it may take up to 5 minutes.", + "canonical": true, + "file": "job_service.delete_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteJob", + "fullName": "google.cloud.talent.v4.JobService.DeleteJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "JobServiceClient", + "fullName": "google.cloud.talent.v4.JobServiceClient" + }, + "method": { + "shortName": "DeleteJob", + "fullName": "google.cloud.talent.v4.JobService.DeleteJob", + "service": { + "shortName": "JobService", + "fullName": "google.cloud.talent.v4.JobService" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_JobService_BatchDeleteJobs_async", + "title": "talent batchDeleteJobs Sample", + "origin": "API_DEFINITION", + "description": " Begins executing a batch delete jobs operation.", + "canonical": true, + "file": "job_service.batch_delete_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchDeleteJobs", + "fullName": "google.cloud.talent.v4.JobService.BatchDeleteJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "names", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "JobServiceClient", + "fullName": "google.cloud.talent.v4.JobServiceClient" + }, + "method": { + "shortName": "BatchDeleteJobs", + "fullName": "google.cloud.talent.v4.JobService.BatchDeleteJobs", + "service": { + "shortName": "JobService", + "fullName": "google.cloud.talent.v4.JobService" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_JobService_ListJobs_async", + "title": "talent listJobs Sample", + "origin": "API_DEFINITION", + "description": " Lists jobs by filter.", + "canonical": true, + "file": "job_service.list_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 95, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListJobs", + "fullName": "google.cloud.talent.v4.JobService.ListJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "job_view", + "type": ".google.cloud.talent.v4.JobView" + } + ], + "resultType": ".google.cloud.talent.v4.ListJobsResponse", + "client": { + "shortName": "JobServiceClient", + "fullName": "google.cloud.talent.v4.JobServiceClient" + }, + "method": { + "shortName": "ListJobs", + "fullName": "google.cloud.talent.v4.JobService.ListJobs", + "service": { + "shortName": "JobService", + "fullName": "google.cloud.talent.v4.JobService" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_JobService_SearchJobs_async", + "title": "talent searchJobs Sample", + "origin": "API_DEFINITION", + "description": " Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest]. This call constrains the [visibility][google.cloud.talent.v4.Job.visibility] of jobs present in the database, and only returns jobs that the caller has permission to search against.", + "canonical": true, + "file": "job_service.search_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 291, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchJobs", + "fullName": "google.cloud.talent.v4.JobService.SearchJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "search_mode", + "type": ".google.cloud.talent.v4.SearchJobsRequest.SearchMode" + }, + { + "name": "request_metadata", + "type": ".google.cloud.talent.v4.RequestMetadata" + }, + { + "name": "job_query", + "type": ".google.cloud.talent.v4.JobQuery" + }, + { + "name": "enable_broadening", + "type": "TYPE_BOOL" + }, + { + "name": "histogram_queries", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "job_view", + "type": ".google.cloud.talent.v4.JobView" + }, + { + "name": "offset", + "type": "TYPE_INT32" + }, + { + "name": "max_page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "diversification_level", + "type": ".google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel" + }, + { + "name": "custom_ranking_info", + "type": ".google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo" + }, + { + "name": "disable_keyword_match", + "type": "TYPE_BOOL" + }, + { + "name": "keyword_match_mode", + "type": ".google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode" + } + ], + "resultType": ".google.cloud.talent.v4.SearchJobsResponse", + "client": { + "shortName": "JobServiceClient", + "fullName": "google.cloud.talent.v4.JobServiceClient" + }, + "method": { + "shortName": "SearchJobs", + "fullName": "google.cloud.talent.v4.JobService.SearchJobs", + "service": { + "shortName": "JobService", + "fullName": "google.cloud.talent.v4.JobService" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_JobService_SearchJobsForAlert_async", + "title": "talent searchJobsForAlert Sample", + "origin": "API_DEFINITION", + "description": " Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest]. This API call is intended for the use case of targeting passive job seekers (for example, job seekers who have signed up to receive email alerts about potential job opportunities), it has different algorithmic adjustments that are designed to specifically target passive job seekers. This call constrains the [visibility][google.cloud.talent.v4.Job.visibility] of jobs present in the database, and only returns jobs the caller has permission to search against.", + "canonical": true, + "file": "job_service.search_jobs_for_alert.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 291, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchJobsForAlert", + "fullName": "google.cloud.talent.v4.JobService.SearchJobsForAlert", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "search_mode", + "type": ".google.cloud.talent.v4.SearchJobsRequest.SearchMode" + }, + { + "name": "request_metadata", + "type": ".google.cloud.talent.v4.RequestMetadata" + }, + { + "name": "job_query", + "type": ".google.cloud.talent.v4.JobQuery" + }, + { + "name": "enable_broadening", + "type": "TYPE_BOOL" + }, + { + "name": "histogram_queries", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "job_view", + "type": ".google.cloud.talent.v4.JobView" + }, + { + "name": "offset", + "type": "TYPE_INT32" + }, + { + "name": "max_page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "diversification_level", + "type": ".google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel" + }, + { + "name": "custom_ranking_info", + "type": ".google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo" + }, + { + "name": "disable_keyword_match", + "type": "TYPE_BOOL" + }, + { + "name": "keyword_match_mode", + "type": ".google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode" + } + ], + "resultType": ".google.cloud.talent.v4.SearchJobsResponse", + "client": { + "shortName": "JobServiceClient", + "fullName": "google.cloud.talent.v4.JobServiceClient" + }, + "method": { + "shortName": "SearchJobsForAlert", + "fullName": "google.cloud.talent.v4.JobService.SearchJobsForAlert", + "service": { + "shortName": "JobService", + "fullName": "google.cloud.talent.v4.JobService" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_TenantService_CreateTenant_async", + "title": "talent createTenant Sample", + "origin": "API_DEFINITION", + "description": " Creates a new tenant entity.", + "canonical": true, + "file": "tenant_service.create_tenant.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTenant", + "fullName": "google.cloud.talent.v4.TenantService.CreateTenant", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "tenant", + "type": ".google.cloud.talent.v4.Tenant" + } + ], + "resultType": ".google.cloud.talent.v4.Tenant", + "client": { + "shortName": "TenantServiceClient", + "fullName": "google.cloud.talent.v4.TenantServiceClient" + }, + "method": { + "shortName": "CreateTenant", + "fullName": "google.cloud.talent.v4.TenantService.CreateTenant", + "service": { + "shortName": "TenantService", + "fullName": "google.cloud.talent.v4.TenantService" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_TenantService_GetTenant_async", + "title": "talent getTenant Sample", + "origin": "API_DEFINITION", + "description": " Retrieves specified tenant.", + "canonical": true, + "file": "tenant_service.get_tenant.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTenant", + "fullName": "google.cloud.talent.v4.TenantService.GetTenant", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.talent.v4.Tenant", + "client": { + "shortName": "TenantServiceClient", + "fullName": "google.cloud.talent.v4.TenantServiceClient" + }, + "method": { + "shortName": "GetTenant", + "fullName": "google.cloud.talent.v4.TenantService.GetTenant", + "service": { + "shortName": "TenantService", + "fullName": "google.cloud.talent.v4.TenantService" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_TenantService_UpdateTenant_async", + "title": "talent updateTenant Sample", + "origin": "API_DEFINITION", + "description": " Updates specified tenant.", + "canonical": true, + "file": "tenant_service.update_tenant.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTenant", + "fullName": "google.cloud.talent.v4.TenantService.UpdateTenant", + "async": true, + "parameters": [ + { + "name": "tenant", + "type": ".google.cloud.talent.v4.Tenant" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.talent.v4.Tenant", + "client": { + "shortName": "TenantServiceClient", + "fullName": "google.cloud.talent.v4.TenantServiceClient" + }, + "method": { + "shortName": "UpdateTenant", + "fullName": "google.cloud.talent.v4.TenantService.UpdateTenant", + "service": { + "shortName": "TenantService", + "fullName": "google.cloud.talent.v4.TenantService" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_TenantService_DeleteTenant_async", + "title": "talent deleteTenant Sample", + "origin": "API_DEFINITION", + "description": " Deletes specified tenant.", + "canonical": true, + "file": "tenant_service.delete_tenant.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTenant", + "fullName": "google.cloud.talent.v4.TenantService.DeleteTenant", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "TenantServiceClient", + "fullName": "google.cloud.talent.v4.TenantServiceClient" + }, + "method": { + "shortName": "DeleteTenant", + "fullName": "google.cloud.talent.v4.TenantService.DeleteTenant", + "service": { + "shortName": "TenantService", + "fullName": "google.cloud.talent.v4.TenantService" + } + } + } + }, + { + "regionTag": "jobs_v4_generated_TenantService_ListTenants_async", + "title": "talent listTenants Sample", + "origin": "API_DEFINITION", + "description": " Lists all tenants associated with the project.", + "canonical": true, + "file": "tenant_service.list_tenants.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTenants", + "fullName": "google.cloud.talent.v4.TenantService.ListTenants", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.talent.v4.ListTenantsResponse", + "client": { + "shortName": "TenantServiceClient", + "fullName": "google.cloud.talent.v4.TenantServiceClient" + }, + "method": { + "shortName": "ListTenants", + "fullName": "google.cloud.talent.v4.TenantService.ListTenants", + "service": { + "shortName": "TenantService", + "fullName": "google.cloud.talent.v4.TenantService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-talent/samples/generated/v4/tenant_service.create_tenant.js b/packages/google-cloud-talent/samples/generated/v4/tenant_service.create_tenant.js new file mode 100644 index 00000000000..2d87e569ecc --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/tenant_service.create_tenant.js @@ -0,0 +1,68 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, tenant) { + // [START jobs_v4_generated_TenantService_CreateTenant_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 under which the tenant is created. + * The format is "projects/{project_id}", for example, + * "projects/foo". + */ + // const parent = 'abc123' + /** + * Required. The tenant to be created. + */ + // const tenant = {} + + // Imports the Talent library + const {TenantServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new TenantServiceClient(); + + async function callCreateTenant() { + // Construct request + const request = { + parent, + tenant, + }; + + // Run request + const response = await talentClient.createTenant(request); + console.log(response); + } + + callCreateTenant(); + // [END jobs_v4_generated_TenantService_CreateTenant_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/tenant_service.delete_tenant.js b/packages/google-cloud-talent/samples/generated/v4/tenant_service.delete_tenant.js new file mode 100644 index 00000000000..2a4664caa39 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/tenant_service.delete_tenant.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START jobs_v4_generated_TenantService_DeleteTenant_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 tenant to be deleted. + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenants/bar". + */ + // const name = 'abc123' + + // Imports the Talent library + const {TenantServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new TenantServiceClient(); + + async function callDeleteTenant() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await talentClient.deleteTenant(request); + console.log(response); + } + + callDeleteTenant(); + // [END jobs_v4_generated_TenantService_DeleteTenant_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/tenant_service.get_tenant.js b/packages/google-cloud-talent/samples/generated/v4/tenant_service.get_tenant.js new file mode 100644 index 00000000000..6743e8f71e4 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/tenant_service.get_tenant.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START jobs_v4_generated_TenantService_GetTenant_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 tenant to be retrieved. + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenants/bar". + */ + // const name = 'abc123' + + // Imports the Talent library + const {TenantServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new TenantServiceClient(); + + async function callGetTenant() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await talentClient.getTenant(request); + console.log(response); + } + + callGetTenant(); + // [END jobs_v4_generated_TenantService_GetTenant_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/tenant_service.list_tenants.js b/packages/google-cloud-talent/samples/generated/v4/tenant_service.list_tenants.js new file mode 100644 index 00000000000..c53f997a400 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/tenant_service.list_tenants.js @@ -0,0 +1,74 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START jobs_v4_generated_TenantService_ListTenants_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 under which the tenant is created. + * The format is "projects/{project_id}", for example, + * "projects/foo". + */ + // const parent = 'abc123' + /** + * The starting indicator from which to return results. + */ + // const pageToken = 'abc123' + /** + * The maximum number of tenants to be returned, at most 100. + * Default is 100 if a non-positive number is provided. + */ + // const pageSize = 1234 + + // Imports the Talent library + const {TenantServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new TenantServiceClient(); + + async function callListTenants() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await talentClient.listTenantsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTenants(); + // [END jobs_v4_generated_TenantService_ListTenants_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4/tenant_service.update_tenant.js b/packages/google-cloud-talent/samples/generated/v4/tenant_service.update_tenant.js new file mode 100644 index 00000000000..45d51292322 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4/tenant_service.update_tenant.js @@ -0,0 +1,69 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(tenant) { + // [START jobs_v4_generated_TenantService_UpdateTenant_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 tenant resource to replace the current resource in the system. + */ + // const tenant = {} + /** + * Strongly recommended for the best service experience. + * If update_mask google.cloud.talent.v4.UpdateTenantRequest.update_mask is provided, only the specified fields in + * tenant google.cloud.talent.v4.UpdateTenantRequest.tenant are updated. Otherwise all the fields are updated. + * A field mask to specify the tenant fields to be updated. Only + * top level fields of Tenant google.cloud.talent.v4.Tenant are supported. + */ + // const updateMask = {} + + // Imports the Talent library + const {TenantServiceClient} = require('@google-cloud/talent').v4; + + // Instantiates a client + const talentClient = new TenantServiceClient(); + + async function callUpdateTenant() { + // Construct request + const request = { + tenant, + }; + + // Run request + const response = await talentClient.updateTenant(request); + console.log(response); + } + + callUpdateTenant(); + // [END jobs_v4_generated_TenantService_UpdateTenant_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/company_service.create_company.js b/packages/google-cloud-talent/samples/generated/v4beta1/company_service.create_company.js new file mode 100644 index 00000000000..772d0484772 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/company_service.create_company.js @@ -0,0 +1,69 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, company) { + // [START jobs_v4beta1_generated_CompanyService_CreateCompany_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 tenant under which the company is created. + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + * is created, for example, "projects/foo". + */ + // const parent = 'abc123' + /** + * Required. The company to be created. + */ + // const company = {} + + // Imports the Talent library + const {CompanyServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new CompanyServiceClient(); + + async function callCreateCompany() { + // Construct request + const request = { + parent, + company, + }; + + // Run request + const response = await talentClient.createCompany(request); + console.log(response); + } + + callCreateCompany(); + // [END jobs_v4beta1_generated_CompanyService_CreateCompany_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/company_service.delete_company.js b/packages/google-cloud-talent/samples/generated/v4beta1/company_service.delete_company.js new file mode 100644 index 00000000000..2bbc497be56 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/company_service.delete_company.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START jobs_v4beta1_generated_CompanyService_DeleteCompany_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 company to be deleted. + * The format is + * "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for + * example, "projects/foo/tenants/bar/companies/baz". + * If tenant id is unspecified, the default tenant is used, for + * example, "projects/foo/companies/bar". + */ + // const name = 'abc123' + + // Imports the Talent library + const {CompanyServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new CompanyServiceClient(); + + async function callDeleteCompany() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await talentClient.deleteCompany(request); + console.log(response); + } + + callDeleteCompany(); + // [END jobs_v4beta1_generated_CompanyService_DeleteCompany_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/company_service.get_company.js b/packages/google-cloud-talent/samples/generated/v4beta1/company_service.get_company.js new file mode 100644 index 00000000000..c2d74594719 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/company_service.get_company.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START jobs_v4beta1_generated_CompanyService_GetCompany_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 company to be retrieved. + * The format is + * "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for + * example, "projects/api-test-project/tenants/foo/companies/bar". + * If tenant id is unspecified, the default tenant is used, for + * example, "projects/api-test-project/companies/bar". + */ + // const name = 'abc123' + + // Imports the Talent library + const {CompanyServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new CompanyServiceClient(); + + async function callGetCompany() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await talentClient.getCompany(request); + console.log(response); + } + + callGetCompany(); + // [END jobs_v4beta1_generated_CompanyService_GetCompany_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/company_service.list_companies.js b/packages/google-cloud-talent/samples/generated/v4beta1/company_service.list_companies.js new file mode 100644 index 00000000000..880c105b79a --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/company_service.list_companies.js @@ -0,0 +1,83 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START jobs_v4beta1_generated_CompanyService_ListCompanies_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 tenant under which the company is created. + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenant/bar". + * If tenant id is unspecified, the default tenant will be used, for + * example, "projects/foo". + */ + // const parent = 'abc123' + /** + * The starting indicator from which to return results. + */ + // const pageToken = 'abc123' + /** + * The maximum number of companies to be returned, at most 100. + * Default is 100 if a non-positive number is provided. + */ + // const pageSize = 1234 + /** + * Set to true if the companies requested must have open jobs. + * Defaults to false. + * If true, at most page_size google.cloud.talent.v4beta1.ListCompaniesRequest.page_size of companies are fetched, among which + * only those with open jobs are returned. + */ + // const requireOpenJobs = true + + // Imports the Talent library + const {CompanyServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new CompanyServiceClient(); + + async function callListCompanies() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await talentClient.listCompaniesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCompanies(); + // [END jobs_v4beta1_generated_CompanyService_ListCompanies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/company_service.update_company.js b/packages/google-cloud-talent/samples/generated/v4beta1/company_service.update_company.js new file mode 100644 index 00000000000..62715f420e2 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/company_service.update_company.js @@ -0,0 +1,69 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(company) { + // [START jobs_v4beta1_generated_CompanyService_UpdateCompany_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 company resource to replace the current resource in the system. + */ + // const company = {} + /** + * Strongly recommended for the best service experience. + * If update_mask google.cloud.talent.v4beta1.UpdateCompanyRequest.update_mask is provided, only the specified fields in + * company google.cloud.talent.v4beta1.UpdateCompanyRequest.company are updated. Otherwise all the fields are updated. + * A field mask to specify the company fields to be updated. Only + * top level fields of Company google.cloud.talent.v4beta1.Company are supported. + */ + // const updateMask = {} + + // Imports the Talent library + const {CompanyServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new CompanyServiceClient(); + + async function callUpdateCompany() { + // Construct request + const request = { + company, + }; + + // Run request + const response = await talentClient.updateCompany(request); + console.log(response); + } + + callUpdateCompany(); + // [END jobs_v4beta1_generated_CompanyService_UpdateCompany_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/completion.complete_query.js b/packages/google-cloud-talent/samples/generated/v4beta1/completion.complete_query.js new file mode 100644 index 00000000000..9ca47610b70 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/completion.complete_query.js @@ -0,0 +1,102 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, query, pageSize) { + // [START jobs_v4beta1_generated_Completion_CompleteQuery_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 tenant the completion is performed within. + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenant/bar". + * If tenant id is unspecified, the default tenant is used, for + * example, "projects/foo". + */ + // const parent = 'abc123' + /** + * Required. The query used to generate suggestions. + * The maximum number of allowed characters is 255. + */ + // const query = 'abc123' + /** + * The list of languages of the query. This is + * the BCP-47 language code, such as "en-US" or "sr-Latn". + * For more information, see + * Tags for Identifying Languages (https://tools.ietf.org/html/bcp47). + * The maximum number of allowed characters is 255. + */ + // const languageCodes = 'abc123' + /** + * Required. Completion result count. + * The maximum allowed page size is 10. + */ + // const pageSize = 1234 + /** + * If provided, restricts completion to specified company. + * The format is + * "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for + * example, "projects/foo/tenants/bar/companies/baz". + * If tenant id is unspecified, the default tenant is used, for + * example, "projects/foo". + */ + // const company = 'abc123' + /** + * The scope of the completion. The defaults is CompletionScope.PUBLIC google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope.PUBLIC. + */ + // const scope = {} + /** + * The completion topic. The default is CompletionType.COMBINED google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType.COMBINED. + */ + // const type = {} + + // Imports the Talent library + const {CompletionClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new CompletionClient(); + + async function callCompleteQuery() { + // Construct request + const request = { + parent, + query, + pageSize, + }; + + // Run request + const response = await talentClient.completeQuery(request); + console.log(response); + } + + callCompleteQuery(); + // [END jobs_v4beta1_generated_Completion_CompleteQuery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/event_service.create_client_event.js b/packages/google-cloud-talent/samples/generated/v4beta1/event_service.create_client_event.js new file mode 100644 index 00000000000..93894679c98 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/event_service.create_client_event.js @@ -0,0 +1,70 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, clientEvent) { + // [START jobs_v4beta1_generated_EventService_CreateClientEvent_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 tenant under which the event is created. + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + * is created, for example, "projects/foo". + */ + // const parent = 'abc123' + /** + * Required. Events issued when end user interacts with customer's application that + * uses Cloud Talent Solution. + */ + // const clientEvent = {} + + // Imports the Talent library + const {EventServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new EventServiceClient(); + + async function callCreateClientEvent() { + // Construct request + const request = { + parent, + clientEvent, + }; + + // Run request + const response = await talentClient.createClientEvent(request); + console.log(response); + } + + callCreateClientEvent(); + // [END jobs_v4beta1_generated_EventService_CreateClientEvent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_create_jobs.js b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_create_jobs.js new file mode 100644 index 00000000000..221d392ed02 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_create_jobs.js @@ -0,0 +1,70 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, jobs) { + // [START jobs_v4beta1_generated_JobService_BatchCreateJobs_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 tenant under which the job is created. + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + * is created. For example, "projects/foo". + */ + // const parent = 'abc123' + /** + * Required. The jobs to be created. + */ + // const jobs = 1234 + + // Imports the Talent library + const {JobServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new JobServiceClient(); + + async function callBatchCreateJobs() { + // Construct request + const request = { + parent, + jobs, + }; + + // Run request + const [operation] = await talentClient.batchCreateJobs(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchCreateJobs(); + // [END jobs_v4beta1_generated_JobService_BatchCreateJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_delete_jobs.js b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_delete_jobs.js new file mode 100644 index 00000000000..a46daf0c1fa --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_delete_jobs.js @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, filter) { + // [START jobs_v4beta1_generated_JobService_BatchDeleteJobs_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 tenant under which the job is created. + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + * is created. For example, "projects/foo". + */ + // const parent = 'abc123' + /** + * Required. The filter string specifies the jobs to be deleted. + * Supported operator: =, AND + * The fields eligible for filtering are: + * * `companyName` (Required) + * * `requisitionId` (Required) + * Sample Query: companyName = "projects/foo/companies/bar" AND + * requisitionId = "req-1" + */ + // const filter = 'abc123' + + // Imports the Talent library + const {JobServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new JobServiceClient(); + + async function callBatchDeleteJobs() { + // Construct request + const request = { + parent, + filter, + }; + + // Run request + const response = await talentClient.batchDeleteJobs(request); + console.log(response); + } + + callBatchDeleteJobs(); + // [END jobs_v4beta1_generated_JobService_BatchDeleteJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_update_jobs.js b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_update_jobs.js new file mode 100644 index 00000000000..880e6036e48 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.batch_update_jobs.js @@ -0,0 +1,84 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, jobs) { + // [START jobs_v4beta1_generated_JobService_BatchUpdateJobs_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 tenant under which the job is created. + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + * is created. For example, "projects/foo". + */ + // const parent = 'abc123' + /** + * Required. The jobs to be updated. + */ + // const jobs = 1234 + /** + * Strongly recommended for the best service experience. Be aware that it will + * also increase latency when checking the status of a batch operation. + * If update_mask google.cloud.talent.v4beta1.BatchUpdateJobsRequest.update_mask is provided, only the specified fields in + * Job google.cloud.talent.v4beta1.Job are updated. Otherwise all the fields are updated. + * A field mask to restrict the fields that are updated. Only + * top level fields of Job google.cloud.talent.v4beta1.Job are supported. + * If update_mask google.cloud.talent.v4beta1.BatchUpdateJobsRequest.update_mask is provided, The Job google.cloud.talent.v4beta1.Job inside + * JobResult google.cloud.talent.v4beta1.JobOperationResult.JobResult + * will only contains fields that is updated, plus the Id of the Job. + * Otherwise, Job google.cloud.talent.v4beta1.Job will include all fields, which can yield a very + * large response. + */ + // const updateMask = {} + + // Imports the Talent library + const {JobServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new JobServiceClient(); + + async function callBatchUpdateJobs() { + // Construct request + const request = { + parent, + jobs, + }; + + // Run request + const [operation] = await talentClient.batchUpdateJobs(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchUpdateJobs(); + // [END jobs_v4beta1_generated_JobService_BatchUpdateJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.create_job.js b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.create_job.js new file mode 100644 index 00000000000..d08774346dc --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.create_job.js @@ -0,0 +1,69 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, job) { + // [START jobs_v4beta1_generated_JobService_CreateJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the tenant under which the job is created. + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenant/bar". If tenant id is unspecified a default tenant + * is created. For example, "projects/foo". + */ + // const parent = 'abc123' + /** + * Required. The Job to be created. + */ + // const job = {} + + // Imports the Talent library + const {JobServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new JobServiceClient(); + + async function callCreateJob() { + // Construct request + const request = { + parent, + job, + }; + + // Run request + const response = await talentClient.createJob(request); + console.log(response); + } + + callCreateJob(); + // [END jobs_v4beta1_generated_JobService_CreateJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.delete_job.js b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.delete_job.js new file mode 100644 index 00000000000..c9d1ec7b627 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.delete_job.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START jobs_v4beta1_generated_JobService_DeleteJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the job to be deleted. + * The format is + * "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For + * example, "projects/foo/tenants/bar/jobs/baz". + * If tenant id is unspecified, the default tenant is used. For + * example, "projects/foo/jobs/bar". + */ + // const name = 'abc123' + + // Imports the Talent library + const {JobServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new JobServiceClient(); + + async function callDeleteJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await talentClient.deleteJob(request); + console.log(response); + } + + callDeleteJob(); + // [END jobs_v4beta1_generated_JobService_DeleteJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.get_job.js b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.get_job.js new file mode 100644 index 00000000000..4a42661a325 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.get_job.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START jobs_v4beta1_generated_JobService_GetJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the job to retrieve. + * The format is + * "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For + * example, "projects/foo/tenants/bar/jobs/baz". + * If tenant id is unspecified, the default tenant is used. For + * example, "projects/foo/jobs/bar". + */ + // const name = 'abc123' + + // Imports the Talent library + const {JobServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new JobServiceClient(); + + async function callGetJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await talentClient.getJob(request); + console.log(response); + } + + callGetJob(); + // [END jobs_v4beta1_generated_JobService_GetJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.list_jobs.js b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.list_jobs.js new file mode 100644 index 00000000000..5176424701e --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.list_jobs.js @@ -0,0 +1,104 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, filter) { + // [START jobs_v4beta1_generated_JobService_ListJobs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the tenant under which the job is created. + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + * is created. For example, "projects/foo". + */ + // const parent = 'abc123' + /** + * Required. The filter string specifies the jobs to be enumerated. + * Supported operator: =, AND + * The fields eligible for filtering are: + * * `companyName` + * * `requisitionId` + * * `status` Available values: OPEN, EXPIRED, ALL. Defaults to + * OPEN if no value is specified. + * At least one of `companyName` and `requisitionId` must present or an + * INVALID_ARGUMENT error is thrown. + * Sample Query: + * * companyName = "projects/foo/tenants/bar/companies/baz" + * * companyName = "projects/foo/tenants/bar/companies/baz" AND + * requisitionId = "req-1" + * * companyName = "projects/foo/tenants/bar/companies/baz" AND + * status = "EXPIRED" + * * requisitionId = "req-1" + * * requisitionId = "req-1" AND status = "EXPIRED" + */ + // const filter = 'abc123' + /** + * The starting point of a query result. + */ + // const pageToken = 'abc123' + /** + * The maximum number of jobs to be returned per page of results. + * If job_view google.cloud.talent.v4beta1.ListJobsRequest.job_view is set to JobView.JOB_VIEW_ID_ONLY google.cloud.talent.v4beta1.JobView.JOB_VIEW_ID_ONLY, the maximum allowed + * page size is 1000. Otherwise, the maximum allowed page size is 100. + * Default is 100 if empty or a number < 1 is specified. + */ + // const pageSize = 1234 + /** + * The desired job attributes returned for jobs in the + * search response. Defaults to JobView.JOB_VIEW_FULL google.cloud.talent.v4beta1.JobView.JOB_VIEW_FULL if no value is + * specified. + */ + // const jobView = {} + + // Imports the Talent library + const {JobServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new JobServiceClient(); + + async function callListJobs() { + // Construct request + const request = { + parent, + filter, + }; + + // Run request + const iterable = await talentClient.listJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListJobs(); + // [END jobs_v4beta1_generated_JobService_ListJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.search_jobs.js b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.search_jobs.js new file mode 100644 index 00000000000..40408d5be23 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.search_jobs.js @@ -0,0 +1,303 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, requestMetadata) { + // [START jobs_v4beta1_generated_JobService_SearchJobs_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 tenant to search within. + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + * is created. For example, "projects/foo". + */ + // const parent = 'abc123' + /** + * Mode of a search. + * Defaults to SearchMode.JOB_SEARCH google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode.JOB_SEARCH. + */ + // const searchMode = {} + /** + * Required. The meta information collected about the job searcher, used to improve the + * search quality of the service. The identifiers (such as `user_id`) are + * provided by users, and must be unique and consistent. + */ + // const requestMetadata = {} + /** + * Query used to search against jobs, such as keyword, location filters, etc. + */ + // const jobQuery = {} + /** + * Controls whether to broaden the search when it produces sparse results. + * Broadened queries append results to the end of the matching results + * list. + * Defaults to false. + */ + // const enableBroadening = true + /** + * This field is deprecated. + */ + // const requirePreciseResultSize = true + /** + * An expression specifies a histogram request against matching jobs. + * Expression syntax is an aggregation function call with histogram facets and + * other options. + * Available aggregation function calls are: + * * `count(string_histogram_facet)`: Count the number of matching entities, + * for each distinct attribute value. + * * `count(numeric_histogram_facet, list of buckets)`: Count the number of + * matching entities within each bucket. + * A maximum of 200 histogram buckets are supported. + * Data types: + * * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + * * String: string like "any string with backslash escape for quote(\")." + * * Number: whole number and floating point number like 10, -1 and -0.01. + * * List: list of elements with comma(,) separator surrounded by square + * brackets, for example, 1, 2, 3 and "one", "two", "three". + * Built-in constants: + * * MIN (minimum number similar to java Double.MIN_VALUE) + * * MAX (maximum number similar to java Double.MAX_VALUE) + * Built-in functions: + * * bucket(start, end, label): bucket built-in function creates a bucket + * with range of start, end). Note that the end is exclusive, for example, + * bucket(1, MAX, "positive number") or bucket(1, 10). + * Job histogram facets: + * * company_display_name: histogram by Job.company_display_name google.cloud.talent.v4beta1.Job.company_display_name. + * * employment_type: histogram by Job.employment_types google.cloud.talent.v4beta1.Job.employment_types, for example, + * "FULL_TIME", "PART_TIME". + * * company_size (DEPRECATED): histogram by CompanySize google.cloud.talent.v4beta1.CompanySize, for example, + * "SMALL", "MEDIUM", "BIG". + * * publish_time_in_day: histogram by the Job.posting_publish_time google.cloud.talent.v4beta1.Job.posting_publish_time + * in days. + * Must specify list of numeric buckets in spec. + * * publish_time_in_month: histogram by the Job.posting_publish_time google.cloud.talent.v4beta1.Job.posting_publish_time + * in months. + * Must specify list of numeric buckets in spec. + * * publish_time_in_year: histogram by the Job.posting_publish_time google.cloud.talent.v4beta1.Job.posting_publish_time + * in years. + * Must specify list of numeric buckets in spec. + * * degree_types: histogram by the Job.degree_types google.cloud.talent.v4beta1.Job.degree_types, for example, + * "Bachelors", "Masters". + * * job_level: histogram by the Job.job_level google.cloud.talent.v4beta1.Job.job_level, for example, "Entry + * Level". + * * country: histogram by the country code of jobs, for example, "US", "FR". + * * admin1: histogram by the admin1 code of jobs, which is a global + * placeholder referring to the state, province, or the particular term a + * country uses to define the geographic structure below the country level, + * for example, "CA", "IL". + * * city: histogram by a combination of the "city name, admin1 code". For + * example, "Mountain View, CA", "New York, NY". + * * admin1_country: histogram by a combination of the "admin1 code, country", + * for example, "CA, US", "IL, US". + * * city_coordinate: histogram by the city center's GPS coordinates (latitude + * and longitude), for example, 37.4038522,-122.0987765. Since the + * coordinates of a city center can change, customers may need to refresh + * them periodically. + * * locale: histogram by the Job.language_code google.cloud.talent.v4beta1.Job.language_code, for example, "en-US", + * "fr-FR". + * * language: histogram by the language subtag of the Job.language_code google.cloud.talent.v4beta1.Job.language_code, + * for example, "en", "fr". + * * category: histogram by the JobCategory google.cloud.talent.v4beta1.JobCategory, for example, + * "COMPUTER_AND_IT", "HEALTHCARE". + * * base_compensation_unit: histogram by the + * CompensationInfo.CompensationUnit google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit of base + * salary, for example, "WEEKLY", "MONTHLY". + * * base_compensation: histogram by the base salary. Must specify list of + * numeric buckets to group results by. + * * annualized_base_compensation: histogram by the base annualized salary. + * Must specify list of numeric buckets to group results by. + * * annualized_total_compensation: histogram by the total annualized salary. + * Must specify list of numeric buckets to group results by. + * * string_custom_attribute: histogram by string Job.custom_attributes google.cloud.talent.v4beta1.Job.custom_attributes. + * Values can be accessed via square bracket notations like + * string_custom_attribute"key1". + * * numeric_custom_attribute: histogram by numeric Job.custom_attributes google.cloud.talent.v4beta1.Job.custom_attributes. + * Values can be accessed via square bracket notations like + * numeric_custom_attribute"key1". Must specify list of numeric buckets to + * group results by. + * Example expressions: + * * `count(admin1)` + * * `count(base_compensation, bucket(1000, 10000), bucket(10000, 100000), + * bucket(100000, MAX))` + * * `count(string_custom_attribute"some-string-custom-attribute")` + * * `count(numeric_custom_attribute"some-numeric-custom-attribute", + * bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative"))` + */ + // const histogramQueries = 1234 + /** + * The desired job attributes returned for jobs in the search response. + * Defaults to JobView.JOB_VIEW_SMALL google.cloud.talent.v4beta1.JobView.JOB_VIEW_SMALL if no value is specified. + */ + // const jobView = {} + /** + * An integer that specifies the current offset (that is, starting result + * location, amongst the jobs deemed by the API as relevant) in search + * results. This field is only considered if page_token google.cloud.talent.v4beta1.SearchJobsRequest.page_token is unset. + * The maximum allowed value is 5000. Otherwise an error is thrown. + * For example, 0 means to return results starting from the first matching + * job, and 10 means to return from the 11th job. This can be used for + * pagination, (for example, pageSize = 10 and offset = 10 means to return + * from the second page). + */ + // const offset = 1234 + /** + * A limit on the number of jobs returned in the search results. + * Increasing this value above the default value of 10 can increase search + * response time. The value can be between 1 and 100. + */ + // const pageSize = 1234 + /** + * The token specifying the current offset within + * search results. See SearchJobsResponse.next_page_token google.cloud.talent.v4beta1.SearchJobsResponse.next_page_token for + * an explanation of how to obtain the next set of query results. + */ + // const pageToken = 'abc123' + /** + * The criteria determining how search results are sorted. Default is + * `"relevance desc"`. + * Supported options are: + * * `"relevance desc"`: By relevance descending, as determined by the API + * algorithms. Relevance thresholding of query results is only available + * with this ordering. + * * `"posting_publish_time desc"`: By Job.posting_publish_time google.cloud.talent.v4beta1.Job.posting_publish_time + * descending. + * * `"posting_update_time desc"`: By Job.posting_update_time google.cloud.talent.v4beta1.Job.posting_update_time + * descending. + * * `"title"`: By Job.title google.cloud.talent.v4beta1.Job.title ascending. + * * `"title desc"`: By Job.title google.cloud.talent.v4beta1.Job.title descending. + * * `"annualized_base_compensation"`: By job's + * CompensationInfo.annualized_base_compensation_range google.cloud.talent.v4beta1.CompensationInfo.annualized_base_compensation_range ascending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_base_compensation desc"`: By job's + * CompensationInfo.annualized_base_compensation_range google.cloud.talent.v4beta1.CompensationInfo.annualized_base_compensation_range descending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_total_compensation"`: By job's + * CompensationInfo.annualized_total_compensation_range google.cloud.talent.v4beta1.CompensationInfo.annualized_total_compensation_range ascending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_total_compensation desc"`: By job's + * CompensationInfo.annualized_total_compensation_range google.cloud.talent.v4beta1.CompensationInfo.annualized_total_compensation_range descending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"custom_ranking desc"`: By the relevance score adjusted to the + * SearchJobsRequest.CustomRankingInfo.ranking_expression google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ranking_expression with weight + * factor assigned by + * SearchJobsRequest.CustomRankingInfo.importance_level google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.importance_level in descending + * order. + * * Location sorting: Use the special syntax to order jobs by distance:
+ * `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ * `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ * `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + * multiple locations. See details below.
+ * `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + * multiple locations. See details below.
+ * The string can have a maximum of 256 characters. When multiple distance + * centers are provided, a job that is close to any of the distance centers + * would have a high rank. When a job has multiple locations, the job + * location closest to one of the distance centers will be used. Jobs that + * don't have locations will be ranked at the bottom. Distance is calculated + * with a precision of 11.3 meters (37.4 feet). Diversification strategy is + * still applied unless explicitly disabled in + * diversification_level google.cloud.talent.v4beta1.SearchJobsRequest.diversification_level. + */ + // const orderBy = 'abc123' + /** + * Controls whether highly similar jobs are returned next to each other in + * the search results. Jobs are identified as highly similar based on + * their titles, job categories, and locations. Highly similar results are + * clustered so that only one representative job of the cluster is + * displayed to the job seeker higher up in the results, with the other jobs + * being displayed lower down in the results. + * Defaults to DiversificationLevel.SIMPLE google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel.SIMPLE if no value + * is specified. + */ + // const diversificationLevel = {} + /** + * Controls over how job documents get ranked on top of existing relevance + * score (determined by API algorithm). + */ + // const customRankingInfo = {} + /** + * This field is deprecated. Please use + * SearchJobsRequest.keyword_match_mode google.cloud.talent.v4beta1.SearchJobsRequest.keyword_match_mode going forward. + * To migrate, disable_keyword_match set to false maps to + * KeywordMatchMode.KEYWORD_MATCH_ALL google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL, and disable_keyword_match set to + * true maps to KeywordMatchMode.KEYWORD_MATCH_DISABLED google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_DISABLED. If + * SearchJobsRequest.keyword_match_mode google.cloud.talent.v4beta1.SearchJobsRequest.keyword_match_mode is set, this field is ignored. + * Controls whether to disable exact keyword match on Job.title google.cloud.talent.v4beta1.Job.title, + * Job.description google.cloud.talent.v4beta1.Job.description, Job.company_display_name google.cloud.talent.v4beta1.Job.company_display_name, Job.addresses google.cloud.talent.v4beta1.Job.addresses, + * Job.qualifications google.cloud.talent.v4beta1.Job.qualifications. When disable keyword match is turned off, a + * keyword match returns jobs that do not match given category filters when + * there are matching keywords. For example, for the query "program manager," + * a result is returned even if the job posting has the title "software + * developer," which doesn't fall into "program manager" ontology, but does + * have "program manager" appearing in its description. + * For queries like "cloud" that don't contain title or + * location specific ontology, jobs with "cloud" keyword matches are returned + * regardless of this flag's value. + * Use Company.keyword_searchable_job_custom_attributes google.cloud.talent.v4beta1.Company.keyword_searchable_job_custom_attributes if + * company-specific globally matched custom field/attribute string values are + * needed. Enabling keyword match improves recall of subsequent search + * requests. + * Defaults to false. + */ + // const disableKeywordMatch = true + /** + * Controls what keyword match options to use. + * Defaults to KeywordMatchMode.KEYWORD_MATCH_ALL google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL if no value + * is specified. + */ + // const keywordMatchMode = {} + + // Imports the Talent library + const {JobServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new JobServiceClient(); + + async function callSearchJobs() { + // Construct request + const request = { + parent, + requestMetadata, + }; + + // Run request + const response = await talentClient.searchJobs(request); + console.log(response); + } + + callSearchJobs(); + // [END jobs_v4beta1_generated_JobService_SearchJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.search_jobs_for_alert.js b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.search_jobs_for_alert.js new file mode 100644 index 00000000000..7b6a43cf041 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.search_jobs_for_alert.js @@ -0,0 +1,303 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, requestMetadata) { + // [START jobs_v4beta1_generated_JobService_SearchJobsForAlert_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 tenant to search within. + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + * is created. For example, "projects/foo". + */ + // const parent = 'abc123' + /** + * Mode of a search. + * Defaults to SearchMode.JOB_SEARCH google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode.JOB_SEARCH. + */ + // const searchMode = {} + /** + * Required. The meta information collected about the job searcher, used to improve the + * search quality of the service. The identifiers (such as `user_id`) are + * provided by users, and must be unique and consistent. + */ + // const requestMetadata = {} + /** + * Query used to search against jobs, such as keyword, location filters, etc. + */ + // const jobQuery = {} + /** + * Controls whether to broaden the search when it produces sparse results. + * Broadened queries append results to the end of the matching results + * list. + * Defaults to false. + */ + // const enableBroadening = true + /** + * This field is deprecated. + */ + // const requirePreciseResultSize = true + /** + * An expression specifies a histogram request against matching jobs. + * Expression syntax is an aggregation function call with histogram facets and + * other options. + * Available aggregation function calls are: + * * `count(string_histogram_facet)`: Count the number of matching entities, + * for each distinct attribute value. + * * `count(numeric_histogram_facet, list of buckets)`: Count the number of + * matching entities within each bucket. + * A maximum of 200 histogram buckets are supported. + * Data types: + * * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + * * String: string like "any string with backslash escape for quote(\")." + * * Number: whole number and floating point number like 10, -1 and -0.01. + * * List: list of elements with comma(,) separator surrounded by square + * brackets, for example, 1, 2, 3 and "one", "two", "three". + * Built-in constants: + * * MIN (minimum number similar to java Double.MIN_VALUE) + * * MAX (maximum number similar to java Double.MAX_VALUE) + * Built-in functions: + * * bucket(start, end, label): bucket built-in function creates a bucket + * with range of start, end). Note that the end is exclusive, for example, + * bucket(1, MAX, "positive number") or bucket(1, 10). + * Job histogram facets: + * * company_display_name: histogram by Job.company_display_name google.cloud.talent.v4beta1.Job.company_display_name. + * * employment_type: histogram by Job.employment_types google.cloud.talent.v4beta1.Job.employment_types, for example, + * "FULL_TIME", "PART_TIME". + * * company_size (DEPRECATED): histogram by CompanySize google.cloud.talent.v4beta1.CompanySize, for example, + * "SMALL", "MEDIUM", "BIG". + * * publish_time_in_day: histogram by the Job.posting_publish_time google.cloud.talent.v4beta1.Job.posting_publish_time + * in days. + * Must specify list of numeric buckets in spec. + * * publish_time_in_month: histogram by the Job.posting_publish_time google.cloud.talent.v4beta1.Job.posting_publish_time + * in months. + * Must specify list of numeric buckets in spec. + * * publish_time_in_year: histogram by the Job.posting_publish_time google.cloud.talent.v4beta1.Job.posting_publish_time + * in years. + * Must specify list of numeric buckets in spec. + * * degree_types: histogram by the Job.degree_types google.cloud.talent.v4beta1.Job.degree_types, for example, + * "Bachelors", "Masters". + * * job_level: histogram by the Job.job_level google.cloud.talent.v4beta1.Job.job_level, for example, "Entry + * Level". + * * country: histogram by the country code of jobs, for example, "US", "FR". + * * admin1: histogram by the admin1 code of jobs, which is a global + * placeholder referring to the state, province, or the particular term a + * country uses to define the geographic structure below the country level, + * for example, "CA", "IL". + * * city: histogram by a combination of the "city name, admin1 code". For + * example, "Mountain View, CA", "New York, NY". + * * admin1_country: histogram by a combination of the "admin1 code, country", + * for example, "CA, US", "IL, US". + * * city_coordinate: histogram by the city center's GPS coordinates (latitude + * and longitude), for example, 37.4038522,-122.0987765. Since the + * coordinates of a city center can change, customers may need to refresh + * them periodically. + * * locale: histogram by the Job.language_code google.cloud.talent.v4beta1.Job.language_code, for example, "en-US", + * "fr-FR". + * * language: histogram by the language subtag of the Job.language_code google.cloud.talent.v4beta1.Job.language_code, + * for example, "en", "fr". + * * category: histogram by the JobCategory google.cloud.talent.v4beta1.JobCategory, for example, + * "COMPUTER_AND_IT", "HEALTHCARE". + * * base_compensation_unit: histogram by the + * CompensationInfo.CompensationUnit google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit of base + * salary, for example, "WEEKLY", "MONTHLY". + * * base_compensation: histogram by the base salary. Must specify list of + * numeric buckets to group results by. + * * annualized_base_compensation: histogram by the base annualized salary. + * Must specify list of numeric buckets to group results by. + * * annualized_total_compensation: histogram by the total annualized salary. + * Must specify list of numeric buckets to group results by. + * * string_custom_attribute: histogram by string Job.custom_attributes google.cloud.talent.v4beta1.Job.custom_attributes. + * Values can be accessed via square bracket notations like + * string_custom_attribute"key1". + * * numeric_custom_attribute: histogram by numeric Job.custom_attributes google.cloud.talent.v4beta1.Job.custom_attributes. + * Values can be accessed via square bracket notations like + * numeric_custom_attribute"key1". Must specify list of numeric buckets to + * group results by. + * Example expressions: + * * `count(admin1)` + * * `count(base_compensation, bucket(1000, 10000), bucket(10000, 100000), + * bucket(100000, MAX))` + * * `count(string_custom_attribute"some-string-custom-attribute")` + * * `count(numeric_custom_attribute"some-numeric-custom-attribute", + * bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative"))` + */ + // const histogramQueries = 1234 + /** + * The desired job attributes returned for jobs in the search response. + * Defaults to JobView.JOB_VIEW_SMALL google.cloud.talent.v4beta1.JobView.JOB_VIEW_SMALL if no value is specified. + */ + // const jobView = {} + /** + * An integer that specifies the current offset (that is, starting result + * location, amongst the jobs deemed by the API as relevant) in search + * results. This field is only considered if page_token google.cloud.talent.v4beta1.SearchJobsRequest.page_token is unset. + * The maximum allowed value is 5000. Otherwise an error is thrown. + * For example, 0 means to return results starting from the first matching + * job, and 10 means to return from the 11th job. This can be used for + * pagination, (for example, pageSize = 10 and offset = 10 means to return + * from the second page). + */ + // const offset = 1234 + /** + * A limit on the number of jobs returned in the search results. + * Increasing this value above the default value of 10 can increase search + * response time. The value can be between 1 and 100. + */ + // const pageSize = 1234 + /** + * The token specifying the current offset within + * search results. See SearchJobsResponse.next_page_token google.cloud.talent.v4beta1.SearchJobsResponse.next_page_token for + * an explanation of how to obtain the next set of query results. + */ + // const pageToken = 'abc123' + /** + * The criteria determining how search results are sorted. Default is + * `"relevance desc"`. + * Supported options are: + * * `"relevance desc"`: By relevance descending, as determined by the API + * algorithms. Relevance thresholding of query results is only available + * with this ordering. + * * `"posting_publish_time desc"`: By Job.posting_publish_time google.cloud.talent.v4beta1.Job.posting_publish_time + * descending. + * * `"posting_update_time desc"`: By Job.posting_update_time google.cloud.talent.v4beta1.Job.posting_update_time + * descending. + * * `"title"`: By Job.title google.cloud.talent.v4beta1.Job.title ascending. + * * `"title desc"`: By Job.title google.cloud.talent.v4beta1.Job.title descending. + * * `"annualized_base_compensation"`: By job's + * CompensationInfo.annualized_base_compensation_range google.cloud.talent.v4beta1.CompensationInfo.annualized_base_compensation_range ascending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_base_compensation desc"`: By job's + * CompensationInfo.annualized_base_compensation_range google.cloud.talent.v4beta1.CompensationInfo.annualized_base_compensation_range descending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_total_compensation"`: By job's + * CompensationInfo.annualized_total_compensation_range google.cloud.talent.v4beta1.CompensationInfo.annualized_total_compensation_range ascending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_total_compensation desc"`: By job's + * CompensationInfo.annualized_total_compensation_range google.cloud.talent.v4beta1.CompensationInfo.annualized_total_compensation_range descending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"custom_ranking desc"`: By the relevance score adjusted to the + * SearchJobsRequest.CustomRankingInfo.ranking_expression google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ranking_expression with weight + * factor assigned by + * SearchJobsRequest.CustomRankingInfo.importance_level google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.importance_level in descending + * order. + * * Location sorting: Use the special syntax to order jobs by distance:
+ * `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ * `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ * `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + * multiple locations. See details below.
+ * `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + * multiple locations. See details below.
+ * The string can have a maximum of 256 characters. When multiple distance + * centers are provided, a job that is close to any of the distance centers + * would have a high rank. When a job has multiple locations, the job + * location closest to one of the distance centers will be used. Jobs that + * don't have locations will be ranked at the bottom. Distance is calculated + * with a precision of 11.3 meters (37.4 feet). Diversification strategy is + * still applied unless explicitly disabled in + * diversification_level google.cloud.talent.v4beta1.SearchJobsRequest.diversification_level. + */ + // const orderBy = 'abc123' + /** + * Controls whether highly similar jobs are returned next to each other in + * the search results. Jobs are identified as highly similar based on + * their titles, job categories, and locations. Highly similar results are + * clustered so that only one representative job of the cluster is + * displayed to the job seeker higher up in the results, with the other jobs + * being displayed lower down in the results. + * Defaults to DiversificationLevel.SIMPLE google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel.SIMPLE if no value + * is specified. + */ + // const diversificationLevel = {} + /** + * Controls over how job documents get ranked on top of existing relevance + * score (determined by API algorithm). + */ + // const customRankingInfo = {} + /** + * This field is deprecated. Please use + * SearchJobsRequest.keyword_match_mode google.cloud.talent.v4beta1.SearchJobsRequest.keyword_match_mode going forward. + * To migrate, disable_keyword_match set to false maps to + * KeywordMatchMode.KEYWORD_MATCH_ALL google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL, and disable_keyword_match set to + * true maps to KeywordMatchMode.KEYWORD_MATCH_DISABLED google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_DISABLED. If + * SearchJobsRequest.keyword_match_mode google.cloud.talent.v4beta1.SearchJobsRequest.keyword_match_mode is set, this field is ignored. + * Controls whether to disable exact keyword match on Job.title google.cloud.talent.v4beta1.Job.title, + * Job.description google.cloud.talent.v4beta1.Job.description, Job.company_display_name google.cloud.talent.v4beta1.Job.company_display_name, Job.addresses google.cloud.talent.v4beta1.Job.addresses, + * Job.qualifications google.cloud.talent.v4beta1.Job.qualifications. When disable keyword match is turned off, a + * keyword match returns jobs that do not match given category filters when + * there are matching keywords. For example, for the query "program manager," + * a result is returned even if the job posting has the title "software + * developer," which doesn't fall into "program manager" ontology, but does + * have "program manager" appearing in its description. + * For queries like "cloud" that don't contain title or + * location specific ontology, jobs with "cloud" keyword matches are returned + * regardless of this flag's value. + * Use Company.keyword_searchable_job_custom_attributes google.cloud.talent.v4beta1.Company.keyword_searchable_job_custom_attributes if + * company-specific globally matched custom field/attribute string values are + * needed. Enabling keyword match improves recall of subsequent search + * requests. + * Defaults to false. + */ + // const disableKeywordMatch = true + /** + * Controls what keyword match options to use. + * Defaults to KeywordMatchMode.KEYWORD_MATCH_ALL google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL if no value + * is specified. + */ + // const keywordMatchMode = {} + + // Imports the Talent library + const {JobServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new JobServiceClient(); + + async function callSearchJobsForAlert() { + // Construct request + const request = { + parent, + requestMetadata, + }; + + // Run request + const response = await talentClient.searchJobsForAlert(request); + console.log(response); + } + + callSearchJobsForAlert(); + // [END jobs_v4beta1_generated_JobService_SearchJobsForAlert_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/job_service.update_job.js b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.update_job.js new file mode 100644 index 00000000000..9ab18315a1a --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/job_service.update_job.js @@ -0,0 +1,69 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(job) { + // [START jobs_v4beta1_generated_JobService_UpdateJob_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 Job to be updated. + */ + // const job = {} + /** + * Strongly recommended for the best service experience. + * If update_mask google.cloud.talent.v4beta1.UpdateJobRequest.update_mask is provided, only the specified fields in + * job google.cloud.talent.v4beta1.UpdateJobRequest.job are updated. Otherwise all the fields are updated. + * A field mask to restrict the fields that are updated. Only + * top level fields of Job google.cloud.talent.v4beta1.Job are supported. + */ + // const updateMask = {} + + // Imports the Talent library + const {JobServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new JobServiceClient(); + + async function callUpdateJob() { + // Construct request + const request = { + job, + }; + + // Run request + const response = await talentClient.updateJob(request); + console.log(response); + } + + callUpdateJob(); + // [END jobs_v4beta1_generated_JobService_UpdateJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/snippet_metadata.google.cloud.talent.v4beta1.json b/packages/google-cloud-talent/samples/generated/v4beta1/snippet_metadata.google.cloud.talent.v4beta1.json new file mode 100644 index 00000000000..284376f8d00 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/snippet_metadata.google.cloud.talent.v4beta1.json @@ -0,0 +1,1119 @@ +{ + "clientLibrary": { + "name": "nodejs-talent", + "version": "5.0.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.talent.v4beta1", + "version": "v4beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "jobs_v4beta1_generated_CompanyService_CreateCompany_async", + "title": "talent createCompany Sample", + "origin": "API_DEFINITION", + "description": " Creates a new company entity.", + "canonical": true, + "file": "company_service.create_company.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCompany", + "fullName": "google.cloud.talent.v4beta1.CompanyService.CreateCompany", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "company", + "type": ".google.cloud.talent.v4beta1.Company" + } + ], + "resultType": ".google.cloud.talent.v4beta1.Company", + "client": { + "shortName": "CompanyServiceClient", + "fullName": "google.cloud.talent.v4beta1.CompanyServiceClient" + }, + "method": { + "shortName": "CreateCompany", + "fullName": "google.cloud.talent.v4beta1.CompanyService.CreateCompany", + "service": { + "shortName": "CompanyService", + "fullName": "google.cloud.talent.v4beta1.CompanyService" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_CompanyService_GetCompany_async", + "title": "talent getCompany Sample", + "origin": "API_DEFINITION", + "description": " Retrieves specified company.", + "canonical": true, + "file": "company_service.get_company.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCompany", + "fullName": "google.cloud.talent.v4beta1.CompanyService.GetCompany", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.talent.v4beta1.Company", + "client": { + "shortName": "CompanyServiceClient", + "fullName": "google.cloud.talent.v4beta1.CompanyServiceClient" + }, + "method": { + "shortName": "GetCompany", + "fullName": "google.cloud.talent.v4beta1.CompanyService.GetCompany", + "service": { + "shortName": "CompanyService", + "fullName": "google.cloud.talent.v4beta1.CompanyService" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_CompanyService_UpdateCompany_async", + "title": "talent updateCompany Sample", + "origin": "API_DEFINITION", + "description": " Updates specified company.", + "canonical": true, + "file": "company_service.update_company.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCompany", + "fullName": "google.cloud.talent.v4beta1.CompanyService.UpdateCompany", + "async": true, + "parameters": [ + { + "name": "company", + "type": ".google.cloud.talent.v4beta1.Company" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.talent.v4beta1.Company", + "client": { + "shortName": "CompanyServiceClient", + "fullName": "google.cloud.talent.v4beta1.CompanyServiceClient" + }, + "method": { + "shortName": "UpdateCompany", + "fullName": "google.cloud.talent.v4beta1.CompanyService.UpdateCompany", + "service": { + "shortName": "CompanyService", + "fullName": "google.cloud.talent.v4beta1.CompanyService" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_CompanyService_DeleteCompany_async", + "title": "talent deleteCompany Sample", + "origin": "API_DEFINITION", + "description": " Deletes specified company. Prerequisite: The company has no jobs associated with it.", + "canonical": true, + "file": "company_service.delete_company.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCompany", + "fullName": "google.cloud.talent.v4beta1.CompanyService.DeleteCompany", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "CompanyServiceClient", + "fullName": "google.cloud.talent.v4beta1.CompanyServiceClient" + }, + "method": { + "shortName": "DeleteCompany", + "fullName": "google.cloud.talent.v4beta1.CompanyService.DeleteCompany", + "service": { + "shortName": "CompanyService", + "fullName": "google.cloud.talent.v4beta1.CompanyService" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_CompanyService_ListCompanies_async", + "title": "talent listCompanies Sample", + "origin": "API_DEFINITION", + "description": " Lists all companies associated with the project.", + "canonical": true, + "file": "company_service.list_companies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCompanies", + "fullName": "google.cloud.talent.v4beta1.CompanyService.ListCompanies", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "require_open_jobs", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.talent.v4beta1.ListCompaniesResponse", + "client": { + "shortName": "CompanyServiceClient", + "fullName": "google.cloud.talent.v4beta1.CompanyServiceClient" + }, + "method": { + "shortName": "ListCompanies", + "fullName": "google.cloud.talent.v4beta1.CompanyService.ListCompanies", + "service": { + "shortName": "CompanyService", + "fullName": "google.cloud.talent.v4beta1.CompanyService" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_Completion_CompleteQuery_async", + "title": "talent completeQuery Sample", + "origin": "API_DEFINITION", + "description": " Completes the specified prefix with keyword suggestions. Intended for use by a job search auto-complete search box.", + "canonical": true, + "file": "completion.complete_query.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 94, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CompleteQuery", + "fullName": "google.cloud.talent.v4beta1.Completion.CompleteQuery", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "language_codes", + "type": "TYPE_STRING[]" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "company", + "type": "TYPE_STRING" + }, + { + "name": "scope", + "type": ".google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope" + }, + { + "name": "type", + "type": ".google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType" + } + ], + "resultType": ".google.cloud.talent.v4beta1.CompleteQueryResponse", + "client": { + "shortName": "CompletionClient", + "fullName": "google.cloud.talent.v4beta1.CompletionClient" + }, + "method": { + "shortName": "CompleteQuery", + "fullName": "google.cloud.talent.v4beta1.Completion.CompleteQuery", + "service": { + "shortName": "Completion", + "fullName": "google.cloud.talent.v4beta1.Completion" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_EventService_CreateClientEvent_async", + "title": "talent createClientEvent Sample", + "origin": "API_DEFINITION", + "description": " Report events issued when end user interacts with customer's application that uses Cloud Talent Solution. You may inspect the created events in [self service tools](https://console.cloud.google.com/talent-solution/overview). [Learn more](https://cloud.google.com/talent-solution/docs/management-tools) about self service tools.", + "canonical": true, + "file": "event_service.create_client_event.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateClientEvent", + "fullName": "google.cloud.talent.v4beta1.EventService.CreateClientEvent", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "client_event", + "type": ".google.cloud.talent.v4beta1.ClientEvent" + } + ], + "resultType": ".google.cloud.talent.v4beta1.ClientEvent", + "client": { + "shortName": "EventServiceClient", + "fullName": "google.cloud.talent.v4beta1.EventServiceClient" + }, + "method": { + "shortName": "CreateClientEvent", + "fullName": "google.cloud.talent.v4beta1.EventService.CreateClientEvent", + "service": { + "shortName": "EventService", + "fullName": "google.cloud.talent.v4beta1.EventService" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_JobService_CreateJob_async", + "title": "talent createJob Sample", + "origin": "API_DEFINITION", + "description": " Creates a new job. Typically, the job becomes searchable within 10 seconds, but it may take up to 5 minutes.", + "canonical": true, + "file": "job_service.create_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateJob", + "fullName": "google.cloud.talent.v4beta1.JobService.CreateJob", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "job", + "type": ".google.cloud.talent.v4beta1.Job" + } + ], + "resultType": ".google.cloud.talent.v4beta1.Job", + "client": { + "shortName": "JobServiceClient", + "fullName": "google.cloud.talent.v4beta1.JobServiceClient" + }, + "method": { + "shortName": "CreateJob", + "fullName": "google.cloud.talent.v4beta1.JobService.CreateJob", + "service": { + "shortName": "JobService", + "fullName": "google.cloud.talent.v4beta1.JobService" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_JobService_BatchCreateJobs_async", + "title": "talent batchCreateJobs Sample", + "origin": "API_DEFINITION", + "description": " Begins executing a batch create jobs operation.", + "canonical": true, + "file": "job_service.batch_create_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchCreateJobs", + "fullName": "google.cloud.talent.v4beta1.JobService.BatchCreateJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "jobs", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "JobServiceClient", + "fullName": "google.cloud.talent.v4beta1.JobServiceClient" + }, + "method": { + "shortName": "BatchCreateJobs", + "fullName": "google.cloud.talent.v4beta1.JobService.BatchCreateJobs", + "service": { + "shortName": "JobService", + "fullName": "google.cloud.talent.v4beta1.JobService" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_JobService_GetJob_async", + "title": "talent getJob Sample", + "origin": "API_DEFINITION", + "description": " Retrieves the specified job, whose status is OPEN or recently EXPIRED within the last 90 days.", + "canonical": true, + "file": "job_service.get_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJob", + "fullName": "google.cloud.talent.v4beta1.JobService.GetJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.talent.v4beta1.Job", + "client": { + "shortName": "JobServiceClient", + "fullName": "google.cloud.talent.v4beta1.JobServiceClient" + }, + "method": { + "shortName": "GetJob", + "fullName": "google.cloud.talent.v4beta1.JobService.GetJob", + "service": { + "shortName": "JobService", + "fullName": "google.cloud.talent.v4beta1.JobService" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_JobService_UpdateJob_async", + "title": "talent updateJob Sample", + "origin": "API_DEFINITION", + "description": " Updates specified job. Typically, updated contents become visible in search results within 10 seconds, but it may take up to 5 minutes.", + "canonical": true, + "file": "job_service.update_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateJob", + "fullName": "google.cloud.talent.v4beta1.JobService.UpdateJob", + "async": true, + "parameters": [ + { + "name": "job", + "type": ".google.cloud.talent.v4beta1.Job" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.talent.v4beta1.Job", + "client": { + "shortName": "JobServiceClient", + "fullName": "google.cloud.talent.v4beta1.JobServiceClient" + }, + "method": { + "shortName": "UpdateJob", + "fullName": "google.cloud.talent.v4beta1.JobService.UpdateJob", + "service": { + "shortName": "JobService", + "fullName": "google.cloud.talent.v4beta1.JobService" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_JobService_BatchUpdateJobs_async", + "title": "talent batchUpdateJobs Sample", + "origin": "API_DEFINITION", + "description": " Begins executing a batch update jobs operation.", + "canonical": true, + "file": "job_service.batch_update_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchUpdateJobs", + "fullName": "google.cloud.talent.v4beta1.JobService.BatchUpdateJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "jobs", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "JobServiceClient", + "fullName": "google.cloud.talent.v4beta1.JobServiceClient" + }, + "method": { + "shortName": "BatchUpdateJobs", + "fullName": "google.cloud.talent.v4beta1.JobService.BatchUpdateJobs", + "service": { + "shortName": "JobService", + "fullName": "google.cloud.talent.v4beta1.JobService" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_JobService_DeleteJob_async", + "title": "talent deleteJob Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified job. Typically, the job becomes unsearchable within 10 seconds, but it may take up to 5 minutes.", + "canonical": true, + "file": "job_service.delete_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteJob", + "fullName": "google.cloud.talent.v4beta1.JobService.DeleteJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "JobServiceClient", + "fullName": "google.cloud.talent.v4beta1.JobServiceClient" + }, + "method": { + "shortName": "DeleteJob", + "fullName": "google.cloud.talent.v4beta1.JobService.DeleteJob", + "service": { + "shortName": "JobService", + "fullName": "google.cloud.talent.v4beta1.JobService" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_JobService_BatchDeleteJobs_async", + "title": "talent batchDeleteJobs Sample", + "origin": "API_DEFINITION", + "description": " Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s by filter.", + "canonical": true, + "file": "job_service.batch_delete_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchDeleteJobs", + "fullName": "google.cloud.talent.v4beta1.JobService.BatchDeleteJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "JobServiceClient", + "fullName": "google.cloud.talent.v4beta1.JobServiceClient" + }, + "method": { + "shortName": "BatchDeleteJobs", + "fullName": "google.cloud.talent.v4beta1.JobService.BatchDeleteJobs", + "service": { + "shortName": "JobService", + "fullName": "google.cloud.talent.v4beta1.JobService" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_JobService_ListJobs_async", + "title": "talent listJobs Sample", + "origin": "API_DEFINITION", + "description": " Lists jobs by filter.", + "canonical": true, + "file": "job_service.list_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 96, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListJobs", + "fullName": "google.cloud.talent.v4beta1.JobService.ListJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "job_view", + "type": ".google.cloud.talent.v4beta1.JobView" + } + ], + "resultType": ".google.cloud.talent.v4beta1.ListJobsResponse", + "client": { + "shortName": "JobServiceClient", + "fullName": "google.cloud.talent.v4beta1.JobServiceClient" + }, + "method": { + "shortName": "ListJobs", + "fullName": "google.cloud.talent.v4beta1.JobService.ListJobs", + "service": { + "shortName": "JobService", + "fullName": "google.cloud.talent.v4beta1.JobService" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_JobService_SearchJobs_async", + "title": "talent searchJobs Sample", + "origin": "API_DEFINITION", + "description": " Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest]. This call constrains the [visibility][google.cloud.talent.v4beta1.Job.visibility] of jobs present in the database, and only returns jobs that the caller has permission to search against.", + "canonical": true, + "file": "job_service.search_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 295, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchJobs", + "fullName": "google.cloud.talent.v4beta1.JobService.SearchJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "search_mode", + "type": ".google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode" + }, + { + "name": "request_metadata", + "type": ".google.cloud.talent.v4beta1.RequestMetadata" + }, + { + "name": "job_query", + "type": ".google.cloud.talent.v4beta1.JobQuery" + }, + { + "name": "enable_broadening", + "type": "TYPE_BOOL" + }, + { + "name": "require_precise_result_size", + "type": "TYPE_BOOL" + }, + { + "name": "histogram_queries", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "job_view", + "type": ".google.cloud.talent.v4beta1.JobView" + }, + { + "name": "offset", + "type": "TYPE_INT32" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "diversification_level", + "type": ".google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel" + }, + { + "name": "custom_ranking_info", + "type": ".google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo" + }, + { + "name": "disable_keyword_match", + "type": "TYPE_BOOL" + }, + { + "name": "keyword_match_mode", + "type": ".google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode" + } + ], + "resultType": ".google.cloud.talent.v4beta1.SearchJobsResponse", + "client": { + "shortName": "JobServiceClient", + "fullName": "google.cloud.talent.v4beta1.JobServiceClient" + }, + "method": { + "shortName": "SearchJobs", + "fullName": "google.cloud.talent.v4beta1.JobService.SearchJobs", + "service": { + "shortName": "JobService", + "fullName": "google.cloud.talent.v4beta1.JobService" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_JobService_SearchJobsForAlert_async", + "title": "talent searchJobsForAlert Sample", + "origin": "API_DEFINITION", + "description": " Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest]. This API call is intended for the use case of targeting passive job seekers (for example, job seekers who have signed up to receive email alerts about potential job opportunities), and has different algorithmic adjustments that are targeted to passive job seekers. This call constrains the [visibility][google.cloud.talent.v4beta1.Job.visibility] of jobs present in the database, and only returns jobs the caller has permission to search against.", + "canonical": true, + "file": "job_service.search_jobs_for_alert.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 295, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchJobsForAlert", + "fullName": "google.cloud.talent.v4beta1.JobService.SearchJobsForAlert", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "search_mode", + "type": ".google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode" + }, + { + "name": "request_metadata", + "type": ".google.cloud.talent.v4beta1.RequestMetadata" + }, + { + "name": "job_query", + "type": ".google.cloud.talent.v4beta1.JobQuery" + }, + { + "name": "enable_broadening", + "type": "TYPE_BOOL" + }, + { + "name": "require_precise_result_size", + "type": "TYPE_BOOL" + }, + { + "name": "histogram_queries", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "job_view", + "type": ".google.cloud.talent.v4beta1.JobView" + }, + { + "name": "offset", + "type": "TYPE_INT32" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "diversification_level", + "type": ".google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel" + }, + { + "name": "custom_ranking_info", + "type": ".google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo" + }, + { + "name": "disable_keyword_match", + "type": "TYPE_BOOL" + }, + { + "name": "keyword_match_mode", + "type": ".google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode" + } + ], + "resultType": ".google.cloud.talent.v4beta1.SearchJobsResponse", + "client": { + "shortName": "JobServiceClient", + "fullName": "google.cloud.talent.v4beta1.JobServiceClient" + }, + "method": { + "shortName": "SearchJobsForAlert", + "fullName": "google.cloud.talent.v4beta1.JobService.SearchJobsForAlert", + "service": { + "shortName": "JobService", + "fullName": "google.cloud.talent.v4beta1.JobService" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_TenantService_CreateTenant_async", + "title": "talent createTenant Sample", + "origin": "API_DEFINITION", + "description": " Creates a new tenant entity.", + "canonical": true, + "file": "tenant_service.create_tenant.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTenant", + "fullName": "google.cloud.talent.v4beta1.TenantService.CreateTenant", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "tenant", + "type": ".google.cloud.talent.v4beta1.Tenant" + } + ], + "resultType": ".google.cloud.talent.v4beta1.Tenant", + "client": { + "shortName": "TenantServiceClient", + "fullName": "google.cloud.talent.v4beta1.TenantServiceClient" + }, + "method": { + "shortName": "CreateTenant", + "fullName": "google.cloud.talent.v4beta1.TenantService.CreateTenant", + "service": { + "shortName": "TenantService", + "fullName": "google.cloud.talent.v4beta1.TenantService" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_TenantService_GetTenant_async", + "title": "talent getTenant Sample", + "origin": "API_DEFINITION", + "description": " Retrieves specified tenant.", + "canonical": true, + "file": "tenant_service.get_tenant.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTenant", + "fullName": "google.cloud.talent.v4beta1.TenantService.GetTenant", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.talent.v4beta1.Tenant", + "client": { + "shortName": "TenantServiceClient", + "fullName": "google.cloud.talent.v4beta1.TenantServiceClient" + }, + "method": { + "shortName": "GetTenant", + "fullName": "google.cloud.talent.v4beta1.TenantService.GetTenant", + "service": { + "shortName": "TenantService", + "fullName": "google.cloud.talent.v4beta1.TenantService" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_TenantService_UpdateTenant_async", + "title": "talent updateTenant Sample", + "origin": "API_DEFINITION", + "description": " Updates specified tenant.", + "canonical": true, + "file": "tenant_service.update_tenant.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTenant", + "fullName": "google.cloud.talent.v4beta1.TenantService.UpdateTenant", + "async": true, + "parameters": [ + { + "name": "tenant", + "type": ".google.cloud.talent.v4beta1.Tenant" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.talent.v4beta1.Tenant", + "client": { + "shortName": "TenantServiceClient", + "fullName": "google.cloud.talent.v4beta1.TenantServiceClient" + }, + "method": { + "shortName": "UpdateTenant", + "fullName": "google.cloud.talent.v4beta1.TenantService.UpdateTenant", + "service": { + "shortName": "TenantService", + "fullName": "google.cloud.talent.v4beta1.TenantService" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_TenantService_DeleteTenant_async", + "title": "talent deleteTenant Sample", + "origin": "API_DEFINITION", + "description": " Deletes specified tenant.", + "canonical": true, + "file": "tenant_service.delete_tenant.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTenant", + "fullName": "google.cloud.talent.v4beta1.TenantService.DeleteTenant", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "TenantServiceClient", + "fullName": "google.cloud.talent.v4beta1.TenantServiceClient" + }, + "method": { + "shortName": "DeleteTenant", + "fullName": "google.cloud.talent.v4beta1.TenantService.DeleteTenant", + "service": { + "shortName": "TenantService", + "fullName": "google.cloud.talent.v4beta1.TenantService" + } + } + } + }, + { + "regionTag": "jobs_v4beta1_generated_TenantService_ListTenants_async", + "title": "talent listTenants Sample", + "origin": "API_DEFINITION", + "description": " Lists all tenants associated with the project.", + "canonical": true, + "file": "tenant_service.list_tenants.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTenants", + "fullName": "google.cloud.talent.v4beta1.TenantService.ListTenants", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.talent.v4beta1.ListTenantsResponse", + "client": { + "shortName": "TenantServiceClient", + "fullName": "google.cloud.talent.v4beta1.TenantServiceClient" + }, + "method": { + "shortName": "ListTenants", + "fullName": "google.cloud.talent.v4beta1.TenantService.ListTenants", + "service": { + "shortName": "TenantService", + "fullName": "google.cloud.talent.v4beta1.TenantService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.create_tenant.js b/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.create_tenant.js new file mode 100644 index 00000000000..39802780392 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.create_tenant.js @@ -0,0 +1,68 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, tenant) { + // [START jobs_v4beta1_generated_TenantService_CreateTenant_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 under which the tenant is created. + * The format is "projects/{project_id}", for example, + * "projects/foo". + */ + // const parent = 'abc123' + /** + * Required. The tenant to be created. + */ + // const tenant = {} + + // Imports the Talent library + const {TenantServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new TenantServiceClient(); + + async function callCreateTenant() { + // Construct request + const request = { + parent, + tenant, + }; + + // Run request + const response = await talentClient.createTenant(request); + console.log(response); + } + + callCreateTenant(); + // [END jobs_v4beta1_generated_TenantService_CreateTenant_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.delete_tenant.js b/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.delete_tenant.js new file mode 100644 index 00000000000..87a9b941e01 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.delete_tenant.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START jobs_v4beta1_generated_TenantService_DeleteTenant_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 tenant to be deleted. + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenants/bar". + */ + // const name = 'abc123' + + // Imports the Talent library + const {TenantServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new TenantServiceClient(); + + async function callDeleteTenant() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await talentClient.deleteTenant(request); + console.log(response); + } + + callDeleteTenant(); + // [END jobs_v4beta1_generated_TenantService_DeleteTenant_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.get_tenant.js b/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.get_tenant.js new file mode 100644 index 00000000000..dc8e2c49f4b --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.get_tenant.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START jobs_v4beta1_generated_TenantService_GetTenant_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 tenant to be retrieved. + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenants/bar". + */ + // const name = 'abc123' + + // Imports the Talent library + const {TenantServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new TenantServiceClient(); + + async function callGetTenant() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await talentClient.getTenant(request); + console.log(response); + } + + callGetTenant(); + // [END jobs_v4beta1_generated_TenantService_GetTenant_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.list_tenants.js b/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.list_tenants.js new file mode 100644 index 00000000000..1a1eae144c3 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.list_tenants.js @@ -0,0 +1,74 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START jobs_v4beta1_generated_TenantService_ListTenants_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 under which the tenant is created. + * The format is "projects/{project_id}", for example, + * "projects/foo". + */ + // const parent = 'abc123' + /** + * The starting indicator from which to return results. + */ + // const pageToken = 'abc123' + /** + * The maximum number of tenants to be returned, at most 100. + * Default is 100 if a non-positive number is provided. + */ + // const pageSize = 1234 + + // Imports the Talent library + const {TenantServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new TenantServiceClient(); + + async function callListTenants() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await talentClient.listTenantsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTenants(); + // [END jobs_v4beta1_generated_TenantService_ListTenants_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.update_tenant.js b/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.update_tenant.js new file mode 100644 index 00000000000..7be262f2a00 --- /dev/null +++ b/packages/google-cloud-talent/samples/generated/v4beta1/tenant_service.update_tenant.js @@ -0,0 +1,69 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(tenant) { + // [START jobs_v4beta1_generated_TenantService_UpdateTenant_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 tenant resource to replace the current resource in the system. + */ + // const tenant = {} + /** + * Strongly recommended for the best service experience. + * If update_mask google.cloud.talent.v4beta1.UpdateTenantRequest.update_mask is provided, only the specified fields in + * tenant google.cloud.talent.v4beta1.UpdateTenantRequest.tenant are updated. Otherwise all the fields are updated. + * A field mask to specify the tenant fields to be updated. Only + * top level fields of Tenant google.cloud.talent.v4beta1.Tenant are supported. + */ + // const updateMask = {} + + // Imports the Talent library + const {TenantServiceClient} = require('@google-cloud/talent').v4beta1; + + // Instantiates a client + const talentClient = new TenantServiceClient(); + + async function callUpdateTenant() { + // Construct request + const request = { + tenant, + }; + + // Run request + const response = await talentClient.updateTenant(request); + console.log(response); + } + + callUpdateTenant(); + // [END jobs_v4beta1_generated_TenantService_UpdateTenant_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-talent/samples/package.json b/packages/google-cloud-talent/samples/package.json new file mode 100644 index 00000000000..f14e53e652b --- /dev/null +++ b/packages/google-cloud-talent/samples/package.json @@ -0,0 +1,30 @@ +{ + "name": "@google-cloud/talent-samples", + "description": "Samples for the Cloud Talent Solution client library for Node.js", + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "repository": "googleapis/nodejs-talent", + "private": true, + "files": [ + "*.js" + ], + "scripts": { + "test": "mocha --timeout 600000", + "lint": "eslint src --ext .ts", + "lint:fix": "npm run lint -- --fix" + }, + "dependencies": { + "@google-cloud/talent": "^5.0.1", + "uuid": "^9.0.0", + "yargs": "^16.0.3" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^18.0.0", + "chai": "^4.2.0", + "mocha": "^8.1.3" + } +} diff --git a/packages/google-cloud-talent/samples/quickstart.js b/packages/google-cloud-talent/samples/quickstart.js new file mode 100644 index 00000000000..016ff5054ca --- /dev/null +++ b/packages/google-cloud-talent/samples/quickstart.js @@ -0,0 +1,13 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. diff --git a/packages/google-cloud-talent/src/index.ts b/packages/google-cloud-talent/src/index.ts new file mode 100644 index 00000000000..2eabffe4681 --- /dev/null +++ b/packages/google-cloud-talent/src/index.ts @@ -0,0 +1,52 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v4 from './v4'; +import * as v4beta1 from './v4beta1'; + +const CompanyServiceClient = v4.CompanyServiceClient; +type CompanyServiceClient = v4.CompanyServiceClient; +const CompletionClient = v4.CompletionClient; +type CompletionClient = v4.CompletionClient; +const EventServiceClient = v4.EventServiceClient; +type EventServiceClient = v4.EventServiceClient; +const JobServiceClient = v4.JobServiceClient; +type JobServiceClient = v4.JobServiceClient; +const TenantServiceClient = v4.TenantServiceClient; +type TenantServiceClient = v4.TenantServiceClient; + +export { + v4, + v4beta1, + CompanyServiceClient, + CompletionClient, + EventServiceClient, + JobServiceClient, + TenantServiceClient, +}; +export default { + v4, + v4beta1, + CompanyServiceClient, + CompletionClient, + EventServiceClient, + JobServiceClient, + TenantServiceClient, +}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-talent/src/v4/company_service_client.ts b/packages/google-cloud-talent/src/v4/company_service_client.ts new file mode 100644 index 00000000000..6301ba7431f --- /dev/null +++ b/packages/google-cloud-talent/src/v4/company_service_client.ts @@ -0,0 +1,1071 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v4/company_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './company_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service that handles company management, including CRUD and enumeration. + * @class + * @memberof v4 + */ +export class CompanyServiceClient { + 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}; + companyServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CompanyServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new CompanyServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof CompanyServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + companyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}/companies/{company}' + ), + jobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}/jobs/{job}' + ), + tenantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}' + ), + }; + + // 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 = { + listCompanies: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'companies' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.talent.v4.CompanyService', + 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.companyServiceStub) { + return this.companyServiceStub; + } + + // Put together the "service stub" for + // google.cloud.talent.v4.CompanyService. + this.companyServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.talent.v4.CompanyService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.talent.v4.CompanyService, + 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 companyServiceStubMethods = [ + 'createCompany', + 'getCompany', + 'updateCompany', + 'deleteCompany', + 'listCompanies', + ]; + for (const methodName of companyServiceStubMethods) { + const callPromise = this.companyServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.companyServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'jobs.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 'jobs.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', + 'https://www.googleapis.com/auth/jobs', + ]; + } + + 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 new company entity. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the tenant under which the company is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenants/bar". + * @param {google.cloud.talent.v4.Company} request.company + * Required. The company to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Company]{@link google.cloud.talent.v4.Company}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4/company_service.create_company.js + * region_tag:jobs_v4_generated_CompanyService_CreateCompany_async + */ + createCompany( + request?: protos.google.cloud.talent.v4.ICreateCompanyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4.ICompany, + protos.google.cloud.talent.v4.ICreateCompanyRequest | undefined, + {} | undefined + ] + >; + createCompany( + request: protos.google.cloud.talent.v4.ICreateCompanyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4.ICompany, + protos.google.cloud.talent.v4.ICreateCompanyRequest | null | undefined, + {} | null | undefined + > + ): void; + createCompany( + request: protos.google.cloud.talent.v4.ICreateCompanyRequest, + callback: Callback< + protos.google.cloud.talent.v4.ICompany, + protos.google.cloud.talent.v4.ICreateCompanyRequest | null | undefined, + {} | null | undefined + > + ): void; + createCompany( + request?: protos.google.cloud.talent.v4.ICreateCompanyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4.ICompany, + | protos.google.cloud.talent.v4.ICreateCompanyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4.ICompany, + protos.google.cloud.talent.v4.ICreateCompanyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4.ICompany, + protos.google.cloud.talent.v4.ICreateCompanyRequest | 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.createCompany(request, options, callback); + } + /** + * Retrieves specified company. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the company to be retrieved. + * + * The format is + * "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for + * example, "projects/api-test-project/tenants/foo/companies/bar". + * @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 [Company]{@link google.cloud.talent.v4.Company}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4/company_service.get_company.js + * region_tag:jobs_v4_generated_CompanyService_GetCompany_async + */ + getCompany( + request?: protos.google.cloud.talent.v4.IGetCompanyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4.ICompany, + protos.google.cloud.talent.v4.IGetCompanyRequest | undefined, + {} | undefined + ] + >; + getCompany( + request: protos.google.cloud.talent.v4.IGetCompanyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4.ICompany, + protos.google.cloud.talent.v4.IGetCompanyRequest | null | undefined, + {} | null | undefined + > + ): void; + getCompany( + request: protos.google.cloud.talent.v4.IGetCompanyRequest, + callback: Callback< + protos.google.cloud.talent.v4.ICompany, + protos.google.cloud.talent.v4.IGetCompanyRequest | null | undefined, + {} | null | undefined + > + ): void; + getCompany( + request?: protos.google.cloud.talent.v4.IGetCompanyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4.ICompany, + protos.google.cloud.talent.v4.IGetCompanyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4.ICompany, + protos.google.cloud.talent.v4.IGetCompanyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4.ICompany, + protos.google.cloud.talent.v4.IGetCompanyRequest | 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.getCompany(request, options, callback); + } + /** + * Updates specified company. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.talent.v4.Company} request.company + * Required. The company resource to replace the current resource in the system. + * @param {google.protobuf.FieldMask} request.updateMask + * Strongly recommended for the best service experience. + * + * If {@link google.cloud.talent.v4.UpdateCompanyRequest.update_mask|update_mask} is provided, only the specified fields in + * {@link google.cloud.talent.v4.UpdateCompanyRequest.company|company} are updated. Otherwise all the fields are updated. + * + * A field mask to specify the company fields to be updated. Only + * top level fields of {@link google.cloud.talent.v4.Company|Company} are supported. + * @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 [Company]{@link google.cloud.talent.v4.Company}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4/company_service.update_company.js + * region_tag:jobs_v4_generated_CompanyService_UpdateCompany_async + */ + updateCompany( + request?: protos.google.cloud.talent.v4.IUpdateCompanyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4.ICompany, + protos.google.cloud.talent.v4.IUpdateCompanyRequest | undefined, + {} | undefined + ] + >; + updateCompany( + request: protos.google.cloud.talent.v4.IUpdateCompanyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4.ICompany, + protos.google.cloud.talent.v4.IUpdateCompanyRequest | null | undefined, + {} | null | undefined + > + ): void; + updateCompany( + request: protos.google.cloud.talent.v4.IUpdateCompanyRequest, + callback: Callback< + protos.google.cloud.talent.v4.ICompany, + protos.google.cloud.talent.v4.IUpdateCompanyRequest | null | undefined, + {} | null | undefined + > + ): void; + updateCompany( + request?: protos.google.cloud.talent.v4.IUpdateCompanyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4.ICompany, + | protos.google.cloud.talent.v4.IUpdateCompanyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4.ICompany, + protos.google.cloud.talent.v4.IUpdateCompanyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4.ICompany, + protos.google.cloud.talent.v4.IUpdateCompanyRequest | 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({ + 'company.name': request.company!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateCompany(request, options, callback); + } + /** + * Deletes specified company. + * Prerequisite: The company has no jobs associated with it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the company to be deleted. + * + * The format is + * "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for + * example, "projects/foo/tenants/bar/companies/baz". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4/company_service.delete_company.js + * region_tag:jobs_v4_generated_CompanyService_DeleteCompany_async + */ + deleteCompany( + request?: protos.google.cloud.talent.v4.IDeleteCompanyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4.IDeleteCompanyRequest | undefined, + {} | undefined + ] + >; + deleteCompany( + request: protos.google.cloud.talent.v4.IDeleteCompanyRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4.IDeleteCompanyRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteCompany( + request: protos.google.cloud.talent.v4.IDeleteCompanyRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4.IDeleteCompanyRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteCompany( + request?: protos.google.cloud.talent.v4.IDeleteCompanyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.talent.v4.IDeleteCompanyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4.IDeleteCompanyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4.IDeleteCompanyRequest | 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.deleteCompany(request, options, callback); + } + + /** + * Lists all companies associated with the project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the tenant under which the company is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenants/bar". + * @param {string} request.pageToken + * The starting indicator from which to return results. + * @param {number} request.pageSize + * The maximum number of companies to be returned, at most 100. + * Default is 100 if a non-positive number is provided. + * @param {boolean} request.requireOpenJobs + * Set to true if the companies requested must have open jobs. + * + * Defaults to false. + * + * If true, at most {@link google.cloud.talent.v4.ListCompaniesRequest.page_size|page_size} of companies are fetched, among which + * only those with open jobs are returned. + * @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 [Company]{@link google.cloud.talent.v4.Company}. + * 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 `listCompaniesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCompanies( + request?: protos.google.cloud.talent.v4.IListCompaniesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4.ICompany[], + protos.google.cloud.talent.v4.IListCompaniesRequest | null, + protos.google.cloud.talent.v4.IListCompaniesResponse + ] + >; + listCompanies( + request: protos.google.cloud.talent.v4.IListCompaniesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.talent.v4.IListCompaniesRequest, + protos.google.cloud.talent.v4.IListCompaniesResponse | null | undefined, + protos.google.cloud.talent.v4.ICompany + > + ): void; + listCompanies( + request: protos.google.cloud.talent.v4.IListCompaniesRequest, + callback: PaginationCallback< + protos.google.cloud.talent.v4.IListCompaniesRequest, + protos.google.cloud.talent.v4.IListCompaniesResponse | null | undefined, + protos.google.cloud.talent.v4.ICompany + > + ): void; + listCompanies( + request?: protos.google.cloud.talent.v4.IListCompaniesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.talent.v4.IListCompaniesRequest, + | protos.google.cloud.talent.v4.IListCompaniesResponse + | null + | undefined, + protos.google.cloud.talent.v4.ICompany + >, + callback?: PaginationCallback< + protos.google.cloud.talent.v4.IListCompaniesRequest, + protos.google.cloud.talent.v4.IListCompaniesResponse | null | undefined, + protos.google.cloud.talent.v4.ICompany + > + ): Promise< + [ + protos.google.cloud.talent.v4.ICompany[], + protos.google.cloud.talent.v4.IListCompaniesRequest | null, + protos.google.cloud.talent.v4.IListCompaniesResponse + ] + > | 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.listCompanies(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 tenant under which the company is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenants/bar". + * @param {string} request.pageToken + * The starting indicator from which to return results. + * @param {number} request.pageSize + * The maximum number of companies to be returned, at most 100. + * Default is 100 if a non-positive number is provided. + * @param {boolean} request.requireOpenJobs + * Set to true if the companies requested must have open jobs. + * + * Defaults to false. + * + * If true, at most {@link google.cloud.talent.v4.ListCompaniesRequest.page_size|page_size} of companies are fetched, among which + * only those with open jobs are returned. + * @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 [Company]{@link google.cloud.talent.v4.Company} 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 `listCompaniesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCompaniesStream( + request?: protos.google.cloud.talent.v4.IListCompaniesRequest, + 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['listCompanies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCompanies.createStream( + this.innerApiCalls.listCompanies as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listCompanies`, 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 tenant under which the company is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenants/bar". + * @param {string} request.pageToken + * The starting indicator from which to return results. + * @param {number} request.pageSize + * The maximum number of companies to be returned, at most 100. + * Default is 100 if a non-positive number is provided. + * @param {boolean} request.requireOpenJobs + * Set to true if the companies requested must have open jobs. + * + * Defaults to false. + * + * If true, at most {@link google.cloud.talent.v4.ListCompaniesRequest.page_size|page_size} of companies are fetched, among which + * only those with open jobs are returned. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Company]{@link google.cloud.talent.v4.Company}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v4/company_service.list_companies.js + * region_tag:jobs_v4_generated_CompanyService_ListCompanies_async + */ + listCompaniesAsync( + request?: protos.google.cloud.talent.v4.IListCompaniesRequest, + 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['listCompanies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCompanies.asyncIterate( + this.innerApiCalls['listCompanies'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified company resource name string. + * + * @param {string} project + * @param {string} tenant + * @param {string} company + * @returns {string} Resource name string. + */ + companyPath(project: string, tenant: string, company: string) { + return this.pathTemplates.companyPathTemplate.render({ + project: project, + tenant: tenant, + company: company, + }); + } + + /** + * Parse the project from Company resource. + * + * @param {string} companyName + * A fully-qualified path representing Company resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCompanyName(companyName: string) { + return this.pathTemplates.companyPathTemplate.match(companyName).project; + } + + /** + * Parse the tenant from Company resource. + * + * @param {string} companyName + * A fully-qualified path representing Company resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromCompanyName(companyName: string) { + return this.pathTemplates.companyPathTemplate.match(companyName).tenant; + } + + /** + * Parse the company from Company resource. + * + * @param {string} companyName + * A fully-qualified path representing Company resource. + * @returns {string} A string representing the company. + */ + matchCompanyFromCompanyName(companyName: string) { + return this.pathTemplates.companyPathTemplate.match(companyName).company; + } + + /** + * Return a fully-qualified job resource name string. + * + * @param {string} project + * @param {string} tenant + * @param {string} job + * @returns {string} Resource name string. + */ + jobPath(project: string, tenant: string, job: string) { + return this.pathTemplates.jobPathTemplate.render({ + project: project, + tenant: tenant, + job: job, + }); + } + + /** + * Parse the project from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).project; + } + + /** + * Parse the tenant from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).tenant; + } + + /** + * Parse the job from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the job. + */ + matchJobFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).job; + } + + /** + * Return a fully-qualified tenant resource name string. + * + * @param {string} project + * @param {string} tenant + * @returns {string} Resource name string. + */ + tenantPath(project: string, tenant: string) { + return this.pathTemplates.tenantPathTemplate.render({ + project: project, + tenant: tenant, + }); + } + + /** + * Parse the project from Tenant resource. + * + * @param {string} tenantName + * A fully-qualified path representing Tenant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTenantName(tenantName: string) { + return this.pathTemplates.tenantPathTemplate.match(tenantName).project; + } + + /** + * Parse the tenant from Tenant resource. + * + * @param {string} tenantName + * A fully-qualified path representing Tenant resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromTenantName(tenantName: string) { + return this.pathTemplates.tenantPathTemplate.match(tenantName).tenant; + } + + /** + * 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.companyServiceStub && !this._terminated) { + return this.companyServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-talent/src/v4/company_service_client_config.json b/packages/google-cloud-talent/src/v4/company_service_client_config.json new file mode 100644 index 00000000000..df0be95b2d7 --- /dev/null +++ b/packages/google-cloud-talent/src/v4/company_service_client_config.json @@ -0,0 +1,51 @@ +{ + "interfaces": { + "google.cloud.talent.v4.CompanyService": { + "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": { + "CreateCompany": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetCompany": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateCompany": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCompany": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListCompanies": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-talent/src/v4/company_service_proto_list.json b/packages/google-cloud-talent/src/v4/company_service_proto_list.json new file mode 100644 index 00000000000..bcae136acc1 --- /dev/null +++ b/packages/google-cloud-talent/src/v4/company_service_proto_list.json @@ -0,0 +1,14 @@ +[ + "../../protos/google/cloud/talent/v4/common.proto", + "../../protos/google/cloud/talent/v4/company.proto", + "../../protos/google/cloud/talent/v4/company_service.proto", + "../../protos/google/cloud/talent/v4/completion_service.proto", + "../../protos/google/cloud/talent/v4/event.proto", + "../../protos/google/cloud/talent/v4/event_service.proto", + "../../protos/google/cloud/talent/v4/filters.proto", + "../../protos/google/cloud/talent/v4/histogram.proto", + "../../protos/google/cloud/talent/v4/job.proto", + "../../protos/google/cloud/talent/v4/job_service.proto", + "../../protos/google/cloud/talent/v4/tenant.proto", + "../../protos/google/cloud/talent/v4/tenant_service.proto" +] diff --git a/packages/google-cloud-talent/src/v4/completion_client.ts b/packages/google-cloud-talent/src/v4/completion_client.ts new file mode 100644 index 00000000000..2eea28beeb0 --- /dev/null +++ b/packages/google-cloud-talent/src/v4/completion_client.ts @@ -0,0 +1,590 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v4/completion_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './completion_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service handles auto completion. + * @class + * @memberof v4 + */ +export class CompletionClient { + 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}; + completionStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CompletionClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new CompletionClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof CompletionClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + companyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}/companies/{company}' + ), + jobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}/jobs/{job}' + ), + tenantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.talent.v4.Completion', + 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.completionStub) { + return this.completionStub; + } + + // Put together the "service stub" for + // google.cloud.talent.v4.Completion. + this.completionStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.talent.v4.Completion' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.talent.v4.Completion, + 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 completionStubMethods = ['completeQuery']; + for (const methodName of completionStubMethods) { + const callPromise = this.completionStub.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 = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.completionStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'jobs.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 'jobs.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', + 'https://www.googleapis.com/auth/jobs', + ]; + } + + 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 -- + // ------------------- + /** + * Completes the specified prefix with keyword suggestions. + * Intended for use by a job search auto-complete search box. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.tenant + * Required. Resource name of tenant the completion is performed within. + * + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenants/bar". + * @param {string} request.query + * Required. The query used to generate suggestions. + * + * The maximum number of allowed characters is 255. + * @param {string[]} request.languageCodes + * The list of languages of the query. This is + * the BCP-47 language code, such as "en-US" or "sr-Latn". + * For more information, see + * [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + * + * The maximum number of allowed characters is 255. + * @param {number} request.pageSize + * Required. Completion result count. + * + * The maximum allowed page size is 10. + * @param {string} request.company + * If provided, restricts completion to specified company. + * + * The format is + * "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for + * example, "projects/foo/tenants/bar/companies/baz". + * @param {google.cloud.talent.v4.CompleteQueryRequest.CompletionScope} request.scope + * The scope of the completion. The defaults is {@link google.cloud.talent.v4.CompleteQueryRequest.CompletionScope.PUBLIC|CompletionScope.PUBLIC}. + * @param {google.cloud.talent.v4.CompleteQueryRequest.CompletionType} request.type + * The completion topic. The default is {@link google.cloud.talent.v4.CompleteQueryRequest.CompletionType.COMBINED|CompletionType.COMBINED}. + * @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 [CompleteQueryResponse]{@link google.cloud.talent.v4.CompleteQueryResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4/completion.complete_query.js + * region_tag:jobs_v4_generated_Completion_CompleteQuery_async + */ + completeQuery( + request?: protos.google.cloud.talent.v4.ICompleteQueryRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4.ICompleteQueryResponse, + protos.google.cloud.talent.v4.ICompleteQueryRequest | undefined, + {} | undefined + ] + >; + completeQuery( + request: protos.google.cloud.talent.v4.ICompleteQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4.ICompleteQueryResponse, + protos.google.cloud.talent.v4.ICompleteQueryRequest | null | undefined, + {} | null | undefined + > + ): void; + completeQuery( + request: protos.google.cloud.talent.v4.ICompleteQueryRequest, + callback: Callback< + protos.google.cloud.talent.v4.ICompleteQueryResponse, + protos.google.cloud.talent.v4.ICompleteQueryRequest | null | undefined, + {} | null | undefined + > + ): void; + completeQuery( + request?: protos.google.cloud.talent.v4.ICompleteQueryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4.ICompleteQueryResponse, + | protos.google.cloud.talent.v4.ICompleteQueryRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4.ICompleteQueryResponse, + protos.google.cloud.talent.v4.ICompleteQueryRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4.ICompleteQueryResponse, + protos.google.cloud.talent.v4.ICompleteQueryRequest | 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({ + tenant: request.tenant ?? '', + }); + this.initialize(); + return this.innerApiCalls.completeQuery(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified company resource name string. + * + * @param {string} project + * @param {string} tenant + * @param {string} company + * @returns {string} Resource name string. + */ + companyPath(project: string, tenant: string, company: string) { + return this.pathTemplates.companyPathTemplate.render({ + project: project, + tenant: tenant, + company: company, + }); + } + + /** + * Parse the project from Company resource. + * + * @param {string} companyName + * A fully-qualified path representing Company resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCompanyName(companyName: string) { + return this.pathTemplates.companyPathTemplate.match(companyName).project; + } + + /** + * Parse the tenant from Company resource. + * + * @param {string} companyName + * A fully-qualified path representing Company resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromCompanyName(companyName: string) { + return this.pathTemplates.companyPathTemplate.match(companyName).tenant; + } + + /** + * Parse the company from Company resource. + * + * @param {string} companyName + * A fully-qualified path representing Company resource. + * @returns {string} A string representing the company. + */ + matchCompanyFromCompanyName(companyName: string) { + return this.pathTemplates.companyPathTemplate.match(companyName).company; + } + + /** + * Return a fully-qualified job resource name string. + * + * @param {string} project + * @param {string} tenant + * @param {string} job + * @returns {string} Resource name string. + */ + jobPath(project: string, tenant: string, job: string) { + return this.pathTemplates.jobPathTemplate.render({ + project: project, + tenant: tenant, + job: job, + }); + } + + /** + * Parse the project from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).project; + } + + /** + * Parse the tenant from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).tenant; + } + + /** + * Parse the job from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the job. + */ + matchJobFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).job; + } + + /** + * Return a fully-qualified tenant resource name string. + * + * @param {string} project + * @param {string} tenant + * @returns {string} Resource name string. + */ + tenantPath(project: string, tenant: string) { + return this.pathTemplates.tenantPathTemplate.render({ + project: project, + tenant: tenant, + }); + } + + /** + * Parse the project from Tenant resource. + * + * @param {string} tenantName + * A fully-qualified path representing Tenant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTenantName(tenantName: string) { + return this.pathTemplates.tenantPathTemplate.match(tenantName).project; + } + + /** + * Parse the tenant from Tenant resource. + * + * @param {string} tenantName + * A fully-qualified path representing Tenant resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromTenantName(tenantName: string) { + return this.pathTemplates.tenantPathTemplate.match(tenantName).tenant; + } + + /** + * 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.completionStub && !this._terminated) { + return this.completionStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-talent/src/v4/completion_client_config.json b/packages/google-cloud-talent/src/v4/completion_client_config.json new file mode 100644 index 00000000000..88a9a634818 --- /dev/null +++ b/packages/google-cloud-talent/src/v4/completion_client_config.json @@ -0,0 +1,31 @@ +{ + "interfaces": { + "google.cloud.talent.v4.Completion": { + "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": { + "CompleteQuery": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-talent/src/v4/completion_proto_list.json b/packages/google-cloud-talent/src/v4/completion_proto_list.json new file mode 100644 index 00000000000..bcae136acc1 --- /dev/null +++ b/packages/google-cloud-talent/src/v4/completion_proto_list.json @@ -0,0 +1,14 @@ +[ + "../../protos/google/cloud/talent/v4/common.proto", + "../../protos/google/cloud/talent/v4/company.proto", + "../../protos/google/cloud/talent/v4/company_service.proto", + "../../protos/google/cloud/talent/v4/completion_service.proto", + "../../protos/google/cloud/talent/v4/event.proto", + "../../protos/google/cloud/talent/v4/event_service.proto", + "../../protos/google/cloud/talent/v4/filters.proto", + "../../protos/google/cloud/talent/v4/histogram.proto", + "../../protos/google/cloud/talent/v4/job.proto", + "../../protos/google/cloud/talent/v4/job_service.proto", + "../../protos/google/cloud/talent/v4/tenant.proto", + "../../protos/google/cloud/talent/v4/tenant_service.proto" +] diff --git a/packages/google-cloud-talent/src/v4/event_service_client.ts b/packages/google-cloud-talent/src/v4/event_service_client.ts new file mode 100644 index 00000000000..d261d13536a --- /dev/null +++ b/packages/google-cloud-talent/src/v4/event_service_client.ts @@ -0,0 +1,579 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v4/event_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './event_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service handles client event report. + * @class + * @memberof v4 + */ +export class EventServiceClient { + 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}; + eventServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of EventServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new EventServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof EventServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + companyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}/companies/{company}' + ), + jobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}/jobs/{job}' + ), + tenantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.talent.v4.EventService', + 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.eventServiceStub) { + return this.eventServiceStub; + } + + // Put together the "service stub" for + // google.cloud.talent.v4.EventService. + this.eventServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.talent.v4.EventService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.talent.v4.EventService, + 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 eventServiceStubMethods = ['createClientEvent']; + for (const methodName of eventServiceStubMethods) { + const callPromise = this.eventServiceStub.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 = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.eventServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'jobs.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 'jobs.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', + 'https://www.googleapis.com/auth/jobs', + ]; + } + + 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 -- + // ------------------- + /** + * Report events issued when end user interacts with customer's application + * that uses Cloud Talent Solution. You may inspect the created events in + * [self service + * tools](https://console.cloud.google.com/talent-solution/overview). + * [Learn + * more](https://cloud.google.com/talent-solution/docs/management-tools) + * about self service tools. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the tenant under which the event is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenants/bar". + * @param {google.cloud.talent.v4.ClientEvent} request.clientEvent + * Required. Events issued when end user interacts with customer's application that + * uses Cloud Talent Solution. + * @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 [ClientEvent]{@link google.cloud.talent.v4.ClientEvent}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4/event_service.create_client_event.js + * region_tag:jobs_v4_generated_EventService_CreateClientEvent_async + */ + createClientEvent( + request?: protos.google.cloud.talent.v4.ICreateClientEventRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4.IClientEvent, + protos.google.cloud.talent.v4.ICreateClientEventRequest | undefined, + {} | undefined + ] + >; + createClientEvent( + request: protos.google.cloud.talent.v4.ICreateClientEventRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4.IClientEvent, + | protos.google.cloud.talent.v4.ICreateClientEventRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createClientEvent( + request: protos.google.cloud.talent.v4.ICreateClientEventRequest, + callback: Callback< + protos.google.cloud.talent.v4.IClientEvent, + | protos.google.cloud.talent.v4.ICreateClientEventRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createClientEvent( + request?: protos.google.cloud.talent.v4.ICreateClientEventRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4.IClientEvent, + | protos.google.cloud.talent.v4.ICreateClientEventRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4.IClientEvent, + | protos.google.cloud.talent.v4.ICreateClientEventRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4.IClientEvent, + protos.google.cloud.talent.v4.ICreateClientEventRequest | 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.createClientEvent(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified company resource name string. + * + * @param {string} project + * @param {string} tenant + * @param {string} company + * @returns {string} Resource name string. + */ + companyPath(project: string, tenant: string, company: string) { + return this.pathTemplates.companyPathTemplate.render({ + project: project, + tenant: tenant, + company: company, + }); + } + + /** + * Parse the project from Company resource. + * + * @param {string} companyName + * A fully-qualified path representing Company resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCompanyName(companyName: string) { + return this.pathTemplates.companyPathTemplate.match(companyName).project; + } + + /** + * Parse the tenant from Company resource. + * + * @param {string} companyName + * A fully-qualified path representing Company resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromCompanyName(companyName: string) { + return this.pathTemplates.companyPathTemplate.match(companyName).tenant; + } + + /** + * Parse the company from Company resource. + * + * @param {string} companyName + * A fully-qualified path representing Company resource. + * @returns {string} A string representing the company. + */ + matchCompanyFromCompanyName(companyName: string) { + return this.pathTemplates.companyPathTemplate.match(companyName).company; + } + + /** + * Return a fully-qualified job resource name string. + * + * @param {string} project + * @param {string} tenant + * @param {string} job + * @returns {string} Resource name string. + */ + jobPath(project: string, tenant: string, job: string) { + return this.pathTemplates.jobPathTemplate.render({ + project: project, + tenant: tenant, + job: job, + }); + } + + /** + * Parse the project from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).project; + } + + /** + * Parse the tenant from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).tenant; + } + + /** + * Parse the job from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the job. + */ + matchJobFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).job; + } + + /** + * Return a fully-qualified tenant resource name string. + * + * @param {string} project + * @param {string} tenant + * @returns {string} Resource name string. + */ + tenantPath(project: string, tenant: string) { + return this.pathTemplates.tenantPathTemplate.render({ + project: project, + tenant: tenant, + }); + } + + /** + * Parse the project from Tenant resource. + * + * @param {string} tenantName + * A fully-qualified path representing Tenant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTenantName(tenantName: string) { + return this.pathTemplates.tenantPathTemplate.match(tenantName).project; + } + + /** + * Parse the tenant from Tenant resource. + * + * @param {string} tenantName + * A fully-qualified path representing Tenant resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromTenantName(tenantName: string) { + return this.pathTemplates.tenantPathTemplate.match(tenantName).tenant; + } + + /** + * 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.eventServiceStub && !this._terminated) { + return this.eventServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-talent/src/v4/event_service_client_config.json b/packages/google-cloud-talent/src/v4/event_service_client_config.json new file mode 100644 index 00000000000..d74e3f69f6f --- /dev/null +++ b/packages/google-cloud-talent/src/v4/event_service_client_config.json @@ -0,0 +1,31 @@ +{ + "interfaces": { + "google.cloud.talent.v4.EventService": { + "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": { + "CreateClientEvent": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-talent/src/v4/event_service_proto_list.json b/packages/google-cloud-talent/src/v4/event_service_proto_list.json new file mode 100644 index 00000000000..bcae136acc1 --- /dev/null +++ b/packages/google-cloud-talent/src/v4/event_service_proto_list.json @@ -0,0 +1,14 @@ +[ + "../../protos/google/cloud/talent/v4/common.proto", + "../../protos/google/cloud/talent/v4/company.proto", + "../../protos/google/cloud/talent/v4/company_service.proto", + "../../protos/google/cloud/talent/v4/completion_service.proto", + "../../protos/google/cloud/talent/v4/event.proto", + "../../protos/google/cloud/talent/v4/event_service.proto", + "../../protos/google/cloud/talent/v4/filters.proto", + "../../protos/google/cloud/talent/v4/histogram.proto", + "../../protos/google/cloud/talent/v4/job.proto", + "../../protos/google/cloud/talent/v4/job_service.proto", + "../../protos/google/cloud/talent/v4/tenant.proto", + "../../protos/google/cloud/talent/v4/tenant_service.proto" +] diff --git a/packages/google-cloud-talent/src/v4/gapic_metadata.json b/packages/google-cloud-talent/src/v4/gapic_metadata.json new file mode 100644 index 00000000000..4c06b32f63e --- /dev/null +++ b/packages/google-cloud-talent/src/v4/gapic_metadata.json @@ -0,0 +1,311 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.talent.v4", + "libraryPackage": "@google-cloud/talent", + "services": { + "CompanyService": { + "clients": { + "grpc": { + "libraryClient": "CompanyServiceClient", + "rpcs": { + "CreateCompany": { + "methods": [ + "createCompany" + ] + }, + "GetCompany": { + "methods": [ + "getCompany" + ] + }, + "UpdateCompany": { + "methods": [ + "updateCompany" + ] + }, + "DeleteCompany": { + "methods": [ + "deleteCompany" + ] + }, + "ListCompanies": { + "methods": [ + "listCompanies", + "listCompaniesStream", + "listCompaniesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CompanyServiceClient", + "rpcs": { + "CreateCompany": { + "methods": [ + "createCompany" + ] + }, + "GetCompany": { + "methods": [ + "getCompany" + ] + }, + "UpdateCompany": { + "methods": [ + "updateCompany" + ] + }, + "DeleteCompany": { + "methods": [ + "deleteCompany" + ] + }, + "ListCompanies": { + "methods": [ + "listCompanies", + "listCompaniesStream", + "listCompaniesAsync" + ] + } + } + } + } + }, + "Completion": { + "clients": { + "grpc": { + "libraryClient": "CompletionClient", + "rpcs": { + "CompleteQuery": { + "methods": [ + "completeQuery" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CompletionClient", + "rpcs": { + "CompleteQuery": { + "methods": [ + "completeQuery" + ] + } + } + } + } + }, + "EventService": { + "clients": { + "grpc": { + "libraryClient": "EventServiceClient", + "rpcs": { + "CreateClientEvent": { + "methods": [ + "createClientEvent" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "EventServiceClient", + "rpcs": { + "CreateClientEvent": { + "methods": [ + "createClientEvent" + ] + } + } + } + } + }, + "JobService": { + "clients": { + "grpc": { + "libraryClient": "JobServiceClient", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "UpdateJob": { + "methods": [ + "updateJob" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "SearchJobs": { + "methods": [ + "searchJobs" + ] + }, + "SearchJobsForAlert": { + "methods": [ + "searchJobsForAlert" + ] + }, + "BatchCreateJobs": { + "methods": [ + "batchCreateJobs" + ] + }, + "BatchUpdateJobs": { + "methods": [ + "batchUpdateJobs" + ] + }, + "BatchDeleteJobs": { + "methods": [ + "batchDeleteJobs" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "JobServiceClient", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "UpdateJob": { + "methods": [ + "updateJob" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "SearchJobs": { + "methods": [ + "searchJobs" + ] + }, + "SearchJobsForAlert": { + "methods": [ + "searchJobsForAlert" + ] + }, + "BatchCreateJobs": { + "methods": [ + "batchCreateJobs" + ] + }, + "BatchUpdateJobs": { + "methods": [ + "batchUpdateJobs" + ] + }, + "BatchDeleteJobs": { + "methods": [ + "batchDeleteJobs" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + } + } + } + } + }, + "TenantService": { + "clients": { + "grpc": { + "libraryClient": "TenantServiceClient", + "rpcs": { + "CreateTenant": { + "methods": [ + "createTenant" + ] + }, + "GetTenant": { + "methods": [ + "getTenant" + ] + }, + "UpdateTenant": { + "methods": [ + "updateTenant" + ] + }, + "DeleteTenant": { + "methods": [ + "deleteTenant" + ] + }, + "ListTenants": { + "methods": [ + "listTenants", + "listTenantsStream", + "listTenantsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TenantServiceClient", + "rpcs": { + "CreateTenant": { + "methods": [ + "createTenant" + ] + }, + "GetTenant": { + "methods": [ + "getTenant" + ] + }, + "UpdateTenant": { + "methods": [ + "updateTenant" + ] + }, + "DeleteTenant": { + "methods": [ + "deleteTenant" + ] + }, + "ListTenants": { + "methods": [ + "listTenants", + "listTenantsStream", + "listTenantsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-talent/src/v4/index.ts b/packages/google-cloud-talent/src/v4/index.ts new file mode 100644 index 00000000000..ae43ee2aedb --- /dev/null +++ b/packages/google-cloud-talent/src/v4/index.ts @@ -0,0 +1,23 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {CompanyServiceClient} from './company_service_client'; +export {CompletionClient} from './completion_client'; +export {EventServiceClient} from './event_service_client'; +export {JobServiceClient} from './job_service_client'; +export {TenantServiceClient} from './tenant_service_client'; diff --git a/packages/google-cloud-talent/src/v4/job_service_client.ts b/packages/google-cloud-talent/src/v4/job_service_client.ts new file mode 100644 index 00000000000..e57e541435a --- /dev/null +++ b/packages/google-cloud-talent/src/v4/job_service_client.ts @@ -0,0 +1,2346 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v4/job_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './job_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service handles job management, including job CRUD, enumeration and search. + * @class + * @memberof v4 + */ +export class JobServiceClient { + 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; + jobServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of JobServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new JobServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof JobServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + companyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}/companies/{company}' + ), + jobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}/jobs/{job}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + tenantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listJobs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'jobs' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v4/{name=projects/*/operations/*}', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const batchCreateJobsResponse = protoFilesRoot.lookup( + '.google.cloud.talent.v4.BatchCreateJobsResponse' + ) as gax.protobuf.Type; + const batchCreateJobsMetadata = protoFilesRoot.lookup( + '.google.cloud.talent.v4.BatchOperationMetadata' + ) as gax.protobuf.Type; + const batchUpdateJobsResponse = protoFilesRoot.lookup( + '.google.cloud.talent.v4.BatchUpdateJobsResponse' + ) as gax.protobuf.Type; + const batchUpdateJobsMetadata = protoFilesRoot.lookup( + '.google.cloud.talent.v4.BatchOperationMetadata' + ) as gax.protobuf.Type; + const batchDeleteJobsResponse = protoFilesRoot.lookup( + '.google.cloud.talent.v4.BatchDeleteJobsResponse' + ) as gax.protobuf.Type; + const batchDeleteJobsMetadata = protoFilesRoot.lookup( + '.google.cloud.talent.v4.BatchOperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + batchCreateJobs: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchCreateJobsResponse.decode.bind(batchCreateJobsResponse), + batchCreateJobsMetadata.decode.bind(batchCreateJobsMetadata) + ), + batchUpdateJobs: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchUpdateJobsResponse.decode.bind(batchUpdateJobsResponse), + batchUpdateJobsMetadata.decode.bind(batchUpdateJobsMetadata) + ), + batchDeleteJobs: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchDeleteJobsResponse.decode.bind(batchDeleteJobsResponse), + batchDeleteJobsMetadata.decode.bind(batchDeleteJobsMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.talent.v4.JobService', + 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.jobServiceStub) { + return this.jobServiceStub; + } + + // Put together the "service stub" for + // google.cloud.talent.v4.JobService. + this.jobServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.talent.v4.JobService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.talent.v4.JobService, + 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 jobServiceStubMethods = [ + 'createJob', + 'batchCreateJobs', + 'getJob', + 'updateJob', + 'batchUpdateJobs', + 'deleteJob', + 'batchDeleteJobs', + 'listJobs', + 'searchJobs', + 'searchJobsForAlert', + ]; + for (const methodName of jobServiceStubMethods) { + const callPromise = this.jobServiceStub.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.jobServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'jobs.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 'jobs.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', + 'https://www.googleapis.com/auth/jobs', + ]; + } + + 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 new job. + * + * Typically, the job becomes searchable within 10 seconds, but it may take + * up to 5 minutes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the tenant under which the job is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenants/bar". + * @param {google.cloud.talent.v4.Job} request.job + * Required. The Job to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Job]{@link google.cloud.talent.v4.Job}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4/job_service.create_job.js + * region_tag:jobs_v4_generated_JobService_CreateJob_async + */ + createJob( + request?: protos.google.cloud.talent.v4.ICreateJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4.IJob, + protos.google.cloud.talent.v4.ICreateJobRequest | undefined, + {} | undefined + ] + >; + createJob( + request: protos.google.cloud.talent.v4.ICreateJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4.IJob, + protos.google.cloud.talent.v4.ICreateJobRequest | null | undefined, + {} | null | undefined + > + ): void; + createJob( + request: protos.google.cloud.talent.v4.ICreateJobRequest, + callback: Callback< + protos.google.cloud.talent.v4.IJob, + protos.google.cloud.talent.v4.ICreateJobRequest | null | undefined, + {} | null | undefined + > + ): void; + createJob( + request?: protos.google.cloud.talent.v4.ICreateJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4.IJob, + protos.google.cloud.talent.v4.ICreateJobRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4.IJob, + protos.google.cloud.talent.v4.ICreateJobRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4.IJob, + protos.google.cloud.talent.v4.ICreateJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createJob(request, options, callback); + } + /** + * Retrieves the specified job, whose status is OPEN or recently EXPIRED + * within the last 90 days. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the job to retrieve. + * + * The format is + * "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For + * example, "projects/foo/tenants/bar/jobs/baz". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Job]{@link google.cloud.talent.v4.Job}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4/job_service.get_job.js + * region_tag:jobs_v4_generated_JobService_GetJob_async + */ + getJob( + request?: protos.google.cloud.talent.v4.IGetJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4.IJob, + protos.google.cloud.talent.v4.IGetJobRequest | undefined, + {} | undefined + ] + >; + getJob( + request: protos.google.cloud.talent.v4.IGetJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4.IJob, + protos.google.cloud.talent.v4.IGetJobRequest | null | undefined, + {} | null | undefined + > + ): void; + getJob( + request: protos.google.cloud.talent.v4.IGetJobRequest, + callback: Callback< + protos.google.cloud.talent.v4.IJob, + protos.google.cloud.talent.v4.IGetJobRequest | null | undefined, + {} | null | undefined + > + ): void; + getJob( + request?: protos.google.cloud.talent.v4.IGetJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4.IJob, + protos.google.cloud.talent.v4.IGetJobRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4.IJob, + protos.google.cloud.talent.v4.IGetJobRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4.IJob, + protos.google.cloud.talent.v4.IGetJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getJob(request, options, callback); + } + /** + * Updates specified job. + * + * Typically, updated contents become visible in search results within 10 + * seconds, but it may take up to 5 minutes. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.talent.v4.Job} request.job + * Required. The Job to be updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Strongly recommended for the best service experience. + * + * If {@link google.cloud.talent.v4.UpdateJobRequest.update_mask|update_mask} is provided, only the specified fields in + * {@link google.cloud.talent.v4.UpdateJobRequest.job|job} are updated. Otherwise all the fields are updated. + * + * A field mask to restrict the fields that are updated. Only + * top level fields of {@link google.cloud.talent.v4.Job|Job} are supported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Job]{@link google.cloud.talent.v4.Job}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4/job_service.update_job.js + * region_tag:jobs_v4_generated_JobService_UpdateJob_async + */ + updateJob( + request?: protos.google.cloud.talent.v4.IUpdateJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4.IJob, + protos.google.cloud.talent.v4.IUpdateJobRequest | undefined, + {} | undefined + ] + >; + updateJob( + request: protos.google.cloud.talent.v4.IUpdateJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4.IJob, + protos.google.cloud.talent.v4.IUpdateJobRequest | null | undefined, + {} | null | undefined + > + ): void; + updateJob( + request: protos.google.cloud.talent.v4.IUpdateJobRequest, + callback: Callback< + protos.google.cloud.talent.v4.IJob, + protos.google.cloud.talent.v4.IUpdateJobRequest | null | undefined, + {} | null | undefined + > + ): void; + updateJob( + request?: protos.google.cloud.talent.v4.IUpdateJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4.IJob, + protos.google.cloud.talent.v4.IUpdateJobRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4.IJob, + protos.google.cloud.talent.v4.IUpdateJobRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4.IJob, + protos.google.cloud.talent.v4.IUpdateJobRequest | 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({ + 'job.name': request.job!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateJob(request, options, callback); + } + /** + * Deletes the specified job. + * + * Typically, the job becomes unsearchable within 10 seconds, but it may take + * up to 5 minutes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the job to be deleted. + * + * The format is + * "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For + * example, "projects/foo/tenants/bar/jobs/baz". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4/job_service.delete_job.js + * region_tag:jobs_v4_generated_JobService_DeleteJob_async + */ + deleteJob( + request?: protos.google.cloud.talent.v4.IDeleteJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4.IDeleteJobRequest | undefined, + {} | undefined + ] + >; + deleteJob( + request: protos.google.cloud.talent.v4.IDeleteJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4.IDeleteJobRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteJob( + request: protos.google.cloud.talent.v4.IDeleteJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4.IDeleteJobRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteJob( + request?: protos.google.cloud.talent.v4.IDeleteJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4.IDeleteJobRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4.IDeleteJobRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4.IDeleteJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteJob(request, options, callback); + } + /** + * Searches for jobs using the provided {@link google.cloud.talent.v4.SearchJobsRequest|SearchJobsRequest}. + * + * This call constrains the {@link google.cloud.talent.v4.Job.visibility|visibility} of jobs + * present in the database, and only returns jobs that the caller has + * permission to search against. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the tenant to search within. + * + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenants/bar". + * @param {google.cloud.talent.v4.SearchJobsRequest.SearchMode} request.searchMode + * Mode of a search. + * + * Defaults to {@link google.cloud.talent.v4.SearchJobsRequest.SearchMode.JOB_SEARCH|SearchMode.JOB_SEARCH}. + * @param {google.cloud.talent.v4.RequestMetadata} request.requestMetadata + * Required. The meta information collected about the job searcher, used to improve the + * search quality of the service. The identifiers (such as `user_id`) are + * provided by users, and must be unique and consistent. + * @param {google.cloud.talent.v4.JobQuery} request.jobQuery + * Query used to search against jobs, such as keyword, location filters, etc. + * @param {boolean} request.enableBroadening + * Controls whether to broaden the search when it produces sparse results. + * Broadened queries append results to the end of the matching results + * list. + * + * Defaults to false. + * @param {number[]} request.histogramQueries + * An expression specifies a histogram request against matching jobs. + * + * Expression syntax is an aggregation function call with histogram facets and + * other options. + * + * Available aggregation function calls are: + * * `count(string_histogram_facet)`: Count the number of matching entities, + * for each distinct attribute value. + * * `count(numeric_histogram_facet, list of buckets)`: Count the number of + * matching entities within each bucket. + * + * A maximum of 200 histogram buckets are supported. + * + * Data types: + * + * * Histogram facet: facet names with format `{@link a-zA-Z0-9_|a-zA-Z}+`. + * * String: string like "any string with backslash escape for quote(\")." + * * Number: whole number and floating point number like 10, -1 and -0.01. + * * List: list of elements with comma(,) separator surrounded by square + * brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + * + * Built-in constants: + * + * * MIN (minimum number similar to java Double.MIN_VALUE) + * * MAX (maximum number similar to java Double.MAX_VALUE) + * + * Built-in functions: + * + * * bucket(start, end[, label]): bucket built-in function creates a bucket + * with range of [start, end). Note that the end is exclusive, for example, + * bucket(1, MAX, "positive number") or bucket(1, 10). + * + * Job histogram facets: + * + * * company_display_name: histogram by {@link google.cloud.talent.v4.Job.company_display_name|Job.company_display_name}. + * * employment_type: histogram by {@link google.cloud.talent.v4.Job.employment_types|Job.employment_types}, for example, + * "FULL_TIME", "PART_TIME". + * * company_size (DEPRECATED): histogram by {@link google.cloud.talent.v4.CompanySize|CompanySize}, for example, + * "SMALL", "MEDIUM", "BIG". + * * publish_time_in_day: histogram by the {@link google.cloud.talent.v4.Job.posting_publish_time|Job.posting_publish_time} + * in days. + * Must specify list of numeric buckets in spec. + * * publish_time_in_month: histogram by the {@link google.cloud.talent.v4.Job.posting_publish_time|Job.posting_publish_time} + * in months. + * Must specify list of numeric buckets in spec. + * * publish_time_in_year: histogram by the {@link google.cloud.talent.v4.Job.posting_publish_time|Job.posting_publish_time} + * in years. + * Must specify list of numeric buckets in spec. + * * degree_types: histogram by the {@link google.cloud.talent.v4.Job.degree_types|Job.degree_types}, for example, + * "Bachelors", "Masters". + * * job_level: histogram by the {@link google.cloud.talent.v4.Job.job_level|Job.job_level}, for example, "Entry + * Level". + * * country: histogram by the country code of jobs, for example, "US", "FR". + * * admin1: histogram by the admin1 code of jobs, which is a global + * placeholder referring to the state, province, or the particular term a + * country uses to define the geographic structure below the country level, + * for example, "CA", "IL". + * * city: histogram by a combination of the "city name, admin1 code". For + * example, "Mountain View, CA", "New York, NY". + * * admin1_country: histogram by a combination of the "admin1 code, country", + * for example, "CA, US", "IL, US". + * * city_coordinate: histogram by the city center's GPS coordinates (latitude + * and longitude), for example, 37.4038522,-122.0987765. Since the + * coordinates of a city center can change, customers may need to refresh + * them periodically. + * * locale: histogram by the {@link google.cloud.talent.v4.Job.language_code|Job.language_code}, for example, "en-US", + * "fr-FR". + * * language: histogram by the language subtag of the {@link google.cloud.talent.v4.Job.language_code|Job.language_code}, + * for example, "en", "fr". + * * category: histogram by the {@link google.cloud.talent.v4.JobCategory|JobCategory}, for example, + * "COMPUTER_AND_IT", "HEALTHCARE". + * * base_compensation_unit: histogram by the + * {@link google.cloud.talent.v4.CompensationInfo.CompensationUnit|CompensationInfo.CompensationUnit} of base + * salary, for example, "WEEKLY", "MONTHLY". + * * base_compensation: histogram by the base salary. Must specify list of + * numeric buckets to group results by. + * * annualized_base_compensation: histogram by the base annualized salary. + * Must specify list of numeric buckets to group results by. + * * annualized_total_compensation: histogram by the total annualized salary. + * Must specify list of numeric buckets to group results by. + * * string_custom_attribute: histogram by string {@link google.cloud.talent.v4.Job.custom_attributes|Job.custom_attributes}. + * Values can be accessed via square bracket notations like + * string_custom_attribute["key1"]. + * * numeric_custom_attribute: histogram by numeric {@link google.cloud.talent.v4.Job.custom_attributes|Job.custom_attributes}. + * Values can be accessed via square bracket notations like + * numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + * group results by. + * + * Example expressions: + * + * * `count(admin1)` + * * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + * bucket(100000, MAX)])` + * * `count(string_custom_attribute["some-string-custom-attribute"])` + * * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + * [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + * @param {google.cloud.talent.v4.JobView} request.jobView + * The desired job attributes returned for jobs in the search response. + * Defaults to {@link google.cloud.talent.v4.JobView.JOB_VIEW_SMALL|JobView.JOB_VIEW_SMALL} if no value is specified. + * @param {number} request.offset + * An integer that specifies the current offset (that is, starting result + * location, amongst the jobs deemed by the API as relevant) in search + * results. This field is only considered if {@link google.cloud.talent.v4.SearchJobsRequest.page_token|page_token} is unset. + * + * The maximum allowed value is 5000. Otherwise an error is thrown. + * + * For example, 0 means to return results starting from the first matching + * job, and 10 means to return from the 11th job. This can be used for + * pagination, (for example, pageSize = 10 and offset = 10 means to return + * from the second page). + * @param {number} request.maxPageSize + * A limit on the number of jobs returned in the search results. + * Increasing this value above the default value of 10 can increase search + * response time. The value can be between 1 and 100. + * @param {string} request.pageToken + * The token specifying the current offset within + * search results. See {@link google.cloud.talent.v4.SearchJobsResponse.next_page_token|SearchJobsResponse.next_page_token} for + * an explanation of how to obtain the next set of query results. + * @param {string} request.orderBy + * The criteria determining how search results are sorted. Default is + * `"relevance desc"`. + * + * Supported options are: + * + * * `"relevance desc"`: By relevance descending, as determined by the API + * algorithms. Relevance thresholding of query results is only available + * with this ordering. + * * `"posting_publish_time desc"`: By {@link google.cloud.talent.v4.Job.posting_publish_time|Job.posting_publish_time} + * descending. + * * `"posting_update_time desc"`: By {@link google.cloud.talent.v4.Job.posting_update_time|Job.posting_update_time} + * descending. + * * `"title"`: By {@link google.cloud.talent.v4.Job.title|Job.title} ascending. + * * `"title desc"`: By {@link google.cloud.talent.v4.Job.title|Job.title} descending. + * * `"annualized_base_compensation"`: By job's + * {@link google.cloud.talent.v4.CompensationInfo.annualized_base_compensation_range|CompensationInfo.annualized_base_compensation_range} ascending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_base_compensation desc"`: By job's + * {@link google.cloud.talent.v4.CompensationInfo.annualized_base_compensation_range|CompensationInfo.annualized_base_compensation_range} descending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_total_compensation"`: By job's + * {@link google.cloud.talent.v4.CompensationInfo.annualized_total_compensation_range|CompensationInfo.annualized_total_compensation_range} ascending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_total_compensation desc"`: By job's + * {@link google.cloud.talent.v4.CompensationInfo.annualized_total_compensation_range|CompensationInfo.annualized_total_compensation_range} descending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"custom_ranking desc"`: By the relevance score adjusted to the + * {@link google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ranking_expression|SearchJobsRequest.CustomRankingInfo.ranking_expression} with weight + * factor assigned by + * {@link google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.importance_level|SearchJobsRequest.CustomRankingInfo.importance_level} in descending + * order. + * * Location sorting: Use the special syntax to order jobs by distance:
+ * `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ * `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ * `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + * multiple locations. See details below.
+ * `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + * multiple locations. See details below.
+ * The string can have a maximum of 256 characters. When multiple distance + * centers are provided, a job that is close to any of the distance centers + * would have a high rank. When a job has multiple locations, the job + * location closest to one of the distance centers will be used. Jobs that + * don't have locations will be ranked at the bottom. Distance is calculated + * with a precision of 11.3 meters (37.4 feet). Diversification strategy is + * still applied unless explicitly disabled in + * {@link google.cloud.talent.v4.SearchJobsRequest.diversification_level|diversification_level}. + * @param {google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel} request.diversificationLevel + * Controls whether highly similar jobs are returned next to each other in + * the search results. Jobs are identified as highly similar based on + * their titles, job categories, and locations. Highly similar results are + * clustered so that only one representative job of the cluster is + * displayed to the job seeker higher up in the results, with the other jobs + * being displayed lower down in the results. + * + * Defaults to {@link google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel.SIMPLE|DiversificationLevel.SIMPLE} if no value + * is specified. + * @param {google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo} request.customRankingInfo + * Controls over how job documents get ranked on top of existing relevance + * score (determined by API algorithm). + * @param {boolean} request.disableKeywordMatch + * This field is deprecated. Please use + * {@link google.cloud.talent.v4.SearchJobsRequest.keyword_match_mode|SearchJobsRequest.keyword_match_mode} going forward. + * + * To migrate, disable_keyword_match set to false maps to + * {@link google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL|KeywordMatchMode.KEYWORD_MATCH_ALL}, and disable_keyword_match set to + * true maps to {@link google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_DISABLED|KeywordMatchMode.KEYWORD_MATCH_DISABLED}. If + * {@link google.cloud.talent.v4.SearchJobsRequest.keyword_match_mode|SearchJobsRequest.keyword_match_mode} is set, this field is ignored. + * + * Controls whether to disable exact keyword match on {@link google.cloud.talent.v4.Job.title|Job.title}, + * {@link google.cloud.talent.v4.Job.description|Job.description}, {@link google.cloud.talent.v4.Job.company_display_name|Job.company_display_name}, {@link google.cloud.talent.v4.Job.addresses|Job.addresses}, + * {@link google.cloud.talent.v4.Job.qualifications|Job.qualifications}. When disable keyword match is turned off, a + * keyword match returns jobs that do not match given category filters when + * there are matching keywords. For example, for the query "program manager," + * a result is returned even if the job posting has the title "software + * developer," which doesn't fall into "program manager" ontology, but does + * have "program manager" appearing in its description. + * + * For queries like "cloud" that don't contain title or + * location specific ontology, jobs with "cloud" keyword matches are returned + * regardless of this flag's value. + * + * Use {@link google.cloud.talent.v4.Company.keyword_searchable_job_custom_attributes|Company.keyword_searchable_job_custom_attributes} if + * company-specific globally matched custom field/attribute string values are + * needed. Enabling keyword match improves recall of subsequent search + * requests. + * + * Defaults to false. + * @param {google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode} request.keywordMatchMode + * Controls what keyword match options to use. If both keyword_match_mode and + * disable_keyword_match are set, keyword_match_mode will take precedence. + * + * Defaults to {@link google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL|KeywordMatchMode.KEYWORD_MATCH_ALL} if no value + * is specified. + * @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 [SearchJobsResponse]{@link google.cloud.talent.v4.SearchJobsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4/job_service.search_jobs.js + * region_tag:jobs_v4_generated_JobService_SearchJobs_async + */ + searchJobs( + request?: protos.google.cloud.talent.v4.ISearchJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4.ISearchJobsResponse, + protos.google.cloud.talent.v4.ISearchJobsRequest | undefined, + {} | undefined + ] + >; + searchJobs( + request: protos.google.cloud.talent.v4.ISearchJobsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4.ISearchJobsResponse, + protos.google.cloud.talent.v4.ISearchJobsRequest | null | undefined, + {} | null | undefined + > + ): void; + searchJobs( + request: protos.google.cloud.talent.v4.ISearchJobsRequest, + callback: Callback< + protos.google.cloud.talent.v4.ISearchJobsResponse, + protos.google.cloud.talent.v4.ISearchJobsRequest | null | undefined, + {} | null | undefined + > + ): void; + searchJobs( + request?: protos.google.cloud.talent.v4.ISearchJobsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4.ISearchJobsResponse, + protos.google.cloud.talent.v4.ISearchJobsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4.ISearchJobsResponse, + protos.google.cloud.talent.v4.ISearchJobsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4.ISearchJobsResponse, + protos.google.cloud.talent.v4.ISearchJobsRequest | 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.searchJobs(request, options, callback); + } + /** + * Searches for jobs using the provided {@link google.cloud.talent.v4.SearchJobsRequest|SearchJobsRequest}. + * + * This API call is intended for the use case of targeting passive job + * seekers (for example, job seekers who have signed up to receive email + * alerts about potential job opportunities), it has different algorithmic + * adjustments that are designed to specifically target passive job seekers. + * + * This call constrains the {@link google.cloud.talent.v4.Job.visibility|visibility} of jobs + * present in the database, and only returns jobs the caller has + * permission to search against. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the tenant to search within. + * + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenants/bar". + * @param {google.cloud.talent.v4.SearchJobsRequest.SearchMode} request.searchMode + * Mode of a search. + * + * Defaults to {@link google.cloud.talent.v4.SearchJobsRequest.SearchMode.JOB_SEARCH|SearchMode.JOB_SEARCH}. + * @param {google.cloud.talent.v4.RequestMetadata} request.requestMetadata + * Required. The meta information collected about the job searcher, used to improve the + * search quality of the service. The identifiers (such as `user_id`) are + * provided by users, and must be unique and consistent. + * @param {google.cloud.talent.v4.JobQuery} request.jobQuery + * Query used to search against jobs, such as keyword, location filters, etc. + * @param {boolean} request.enableBroadening + * Controls whether to broaden the search when it produces sparse results. + * Broadened queries append results to the end of the matching results + * list. + * + * Defaults to false. + * @param {number[]} request.histogramQueries + * An expression specifies a histogram request against matching jobs. + * + * Expression syntax is an aggregation function call with histogram facets and + * other options. + * + * Available aggregation function calls are: + * * `count(string_histogram_facet)`: Count the number of matching entities, + * for each distinct attribute value. + * * `count(numeric_histogram_facet, list of buckets)`: Count the number of + * matching entities within each bucket. + * + * A maximum of 200 histogram buckets are supported. + * + * Data types: + * + * * Histogram facet: facet names with format `{@link a-zA-Z0-9_|a-zA-Z}+`. + * * String: string like "any string with backslash escape for quote(\")." + * * Number: whole number and floating point number like 10, -1 and -0.01. + * * List: list of elements with comma(,) separator surrounded by square + * brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + * + * Built-in constants: + * + * * MIN (minimum number similar to java Double.MIN_VALUE) + * * MAX (maximum number similar to java Double.MAX_VALUE) + * + * Built-in functions: + * + * * bucket(start, end[, label]): bucket built-in function creates a bucket + * with range of [start, end). Note that the end is exclusive, for example, + * bucket(1, MAX, "positive number") or bucket(1, 10). + * + * Job histogram facets: + * + * * company_display_name: histogram by {@link google.cloud.talent.v4.Job.company_display_name|Job.company_display_name}. + * * employment_type: histogram by {@link google.cloud.talent.v4.Job.employment_types|Job.employment_types}, for example, + * "FULL_TIME", "PART_TIME". + * * company_size (DEPRECATED): histogram by {@link google.cloud.talent.v4.CompanySize|CompanySize}, for example, + * "SMALL", "MEDIUM", "BIG". + * * publish_time_in_day: histogram by the {@link google.cloud.talent.v4.Job.posting_publish_time|Job.posting_publish_time} + * in days. + * Must specify list of numeric buckets in spec. + * * publish_time_in_month: histogram by the {@link google.cloud.talent.v4.Job.posting_publish_time|Job.posting_publish_time} + * in months. + * Must specify list of numeric buckets in spec. + * * publish_time_in_year: histogram by the {@link google.cloud.talent.v4.Job.posting_publish_time|Job.posting_publish_time} + * in years. + * Must specify list of numeric buckets in spec. + * * degree_types: histogram by the {@link google.cloud.talent.v4.Job.degree_types|Job.degree_types}, for example, + * "Bachelors", "Masters". + * * job_level: histogram by the {@link google.cloud.talent.v4.Job.job_level|Job.job_level}, for example, "Entry + * Level". + * * country: histogram by the country code of jobs, for example, "US", "FR". + * * admin1: histogram by the admin1 code of jobs, which is a global + * placeholder referring to the state, province, or the particular term a + * country uses to define the geographic structure below the country level, + * for example, "CA", "IL". + * * city: histogram by a combination of the "city name, admin1 code". For + * example, "Mountain View, CA", "New York, NY". + * * admin1_country: histogram by a combination of the "admin1 code, country", + * for example, "CA, US", "IL, US". + * * city_coordinate: histogram by the city center's GPS coordinates (latitude + * and longitude), for example, 37.4038522,-122.0987765. Since the + * coordinates of a city center can change, customers may need to refresh + * them periodically. + * * locale: histogram by the {@link google.cloud.talent.v4.Job.language_code|Job.language_code}, for example, "en-US", + * "fr-FR". + * * language: histogram by the language subtag of the {@link google.cloud.talent.v4.Job.language_code|Job.language_code}, + * for example, "en", "fr". + * * category: histogram by the {@link google.cloud.talent.v4.JobCategory|JobCategory}, for example, + * "COMPUTER_AND_IT", "HEALTHCARE". + * * base_compensation_unit: histogram by the + * {@link google.cloud.talent.v4.CompensationInfo.CompensationUnit|CompensationInfo.CompensationUnit} of base + * salary, for example, "WEEKLY", "MONTHLY". + * * base_compensation: histogram by the base salary. Must specify list of + * numeric buckets to group results by. + * * annualized_base_compensation: histogram by the base annualized salary. + * Must specify list of numeric buckets to group results by. + * * annualized_total_compensation: histogram by the total annualized salary. + * Must specify list of numeric buckets to group results by. + * * string_custom_attribute: histogram by string {@link google.cloud.talent.v4.Job.custom_attributes|Job.custom_attributes}. + * Values can be accessed via square bracket notations like + * string_custom_attribute["key1"]. + * * numeric_custom_attribute: histogram by numeric {@link google.cloud.talent.v4.Job.custom_attributes|Job.custom_attributes}. + * Values can be accessed via square bracket notations like + * numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + * group results by. + * + * Example expressions: + * + * * `count(admin1)` + * * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + * bucket(100000, MAX)])` + * * `count(string_custom_attribute["some-string-custom-attribute"])` + * * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + * [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + * @param {google.cloud.talent.v4.JobView} request.jobView + * The desired job attributes returned for jobs in the search response. + * Defaults to {@link google.cloud.talent.v4.JobView.JOB_VIEW_SMALL|JobView.JOB_VIEW_SMALL} if no value is specified. + * @param {number} request.offset + * An integer that specifies the current offset (that is, starting result + * location, amongst the jobs deemed by the API as relevant) in search + * results. This field is only considered if {@link google.cloud.talent.v4.SearchJobsRequest.page_token|page_token} is unset. + * + * The maximum allowed value is 5000. Otherwise an error is thrown. + * + * For example, 0 means to return results starting from the first matching + * job, and 10 means to return from the 11th job. This can be used for + * pagination, (for example, pageSize = 10 and offset = 10 means to return + * from the second page). + * @param {number} request.maxPageSize + * A limit on the number of jobs returned in the search results. + * Increasing this value above the default value of 10 can increase search + * response time. The value can be between 1 and 100. + * @param {string} request.pageToken + * The token specifying the current offset within + * search results. See {@link google.cloud.talent.v4.SearchJobsResponse.next_page_token|SearchJobsResponse.next_page_token} for + * an explanation of how to obtain the next set of query results. + * @param {string} request.orderBy + * The criteria determining how search results are sorted. Default is + * `"relevance desc"`. + * + * Supported options are: + * + * * `"relevance desc"`: By relevance descending, as determined by the API + * algorithms. Relevance thresholding of query results is only available + * with this ordering. + * * `"posting_publish_time desc"`: By {@link google.cloud.talent.v4.Job.posting_publish_time|Job.posting_publish_time} + * descending. + * * `"posting_update_time desc"`: By {@link google.cloud.talent.v4.Job.posting_update_time|Job.posting_update_time} + * descending. + * * `"title"`: By {@link google.cloud.talent.v4.Job.title|Job.title} ascending. + * * `"title desc"`: By {@link google.cloud.talent.v4.Job.title|Job.title} descending. + * * `"annualized_base_compensation"`: By job's + * {@link google.cloud.talent.v4.CompensationInfo.annualized_base_compensation_range|CompensationInfo.annualized_base_compensation_range} ascending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_base_compensation desc"`: By job's + * {@link google.cloud.talent.v4.CompensationInfo.annualized_base_compensation_range|CompensationInfo.annualized_base_compensation_range} descending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_total_compensation"`: By job's + * {@link google.cloud.talent.v4.CompensationInfo.annualized_total_compensation_range|CompensationInfo.annualized_total_compensation_range} ascending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_total_compensation desc"`: By job's + * {@link google.cloud.talent.v4.CompensationInfo.annualized_total_compensation_range|CompensationInfo.annualized_total_compensation_range} descending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"custom_ranking desc"`: By the relevance score adjusted to the + * {@link google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ranking_expression|SearchJobsRequest.CustomRankingInfo.ranking_expression} with weight + * factor assigned by + * {@link google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.importance_level|SearchJobsRequest.CustomRankingInfo.importance_level} in descending + * order. + * * Location sorting: Use the special syntax to order jobs by distance:
+ * `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ * `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ * `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + * multiple locations. See details below.
+ * `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + * multiple locations. See details below.
+ * The string can have a maximum of 256 characters. When multiple distance + * centers are provided, a job that is close to any of the distance centers + * would have a high rank. When a job has multiple locations, the job + * location closest to one of the distance centers will be used. Jobs that + * don't have locations will be ranked at the bottom. Distance is calculated + * with a precision of 11.3 meters (37.4 feet). Diversification strategy is + * still applied unless explicitly disabled in + * {@link google.cloud.talent.v4.SearchJobsRequest.diversification_level|diversification_level}. + * @param {google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel} request.diversificationLevel + * Controls whether highly similar jobs are returned next to each other in + * the search results. Jobs are identified as highly similar based on + * their titles, job categories, and locations. Highly similar results are + * clustered so that only one representative job of the cluster is + * displayed to the job seeker higher up in the results, with the other jobs + * being displayed lower down in the results. + * + * Defaults to {@link google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel.SIMPLE|DiversificationLevel.SIMPLE} if no value + * is specified. + * @param {google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo} request.customRankingInfo + * Controls over how job documents get ranked on top of existing relevance + * score (determined by API algorithm). + * @param {boolean} request.disableKeywordMatch + * This field is deprecated. Please use + * {@link google.cloud.talent.v4.SearchJobsRequest.keyword_match_mode|SearchJobsRequest.keyword_match_mode} going forward. + * + * To migrate, disable_keyword_match set to false maps to + * {@link google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL|KeywordMatchMode.KEYWORD_MATCH_ALL}, and disable_keyword_match set to + * true maps to {@link google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_DISABLED|KeywordMatchMode.KEYWORD_MATCH_DISABLED}. If + * {@link google.cloud.talent.v4.SearchJobsRequest.keyword_match_mode|SearchJobsRequest.keyword_match_mode} is set, this field is ignored. + * + * Controls whether to disable exact keyword match on {@link google.cloud.talent.v4.Job.title|Job.title}, + * {@link google.cloud.talent.v4.Job.description|Job.description}, {@link google.cloud.talent.v4.Job.company_display_name|Job.company_display_name}, {@link google.cloud.talent.v4.Job.addresses|Job.addresses}, + * {@link google.cloud.talent.v4.Job.qualifications|Job.qualifications}. When disable keyword match is turned off, a + * keyword match returns jobs that do not match given category filters when + * there are matching keywords. For example, for the query "program manager," + * a result is returned even if the job posting has the title "software + * developer," which doesn't fall into "program manager" ontology, but does + * have "program manager" appearing in its description. + * + * For queries like "cloud" that don't contain title or + * location specific ontology, jobs with "cloud" keyword matches are returned + * regardless of this flag's value. + * + * Use {@link google.cloud.talent.v4.Company.keyword_searchable_job_custom_attributes|Company.keyword_searchable_job_custom_attributes} if + * company-specific globally matched custom field/attribute string values are + * needed. Enabling keyword match improves recall of subsequent search + * requests. + * + * Defaults to false. + * @param {google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode} request.keywordMatchMode + * Controls what keyword match options to use. If both keyword_match_mode and + * disable_keyword_match are set, keyword_match_mode will take precedence. + * + * Defaults to {@link google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL|KeywordMatchMode.KEYWORD_MATCH_ALL} if no value + * is specified. + * @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 [SearchJobsResponse]{@link google.cloud.talent.v4.SearchJobsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4/job_service.search_jobs_for_alert.js + * region_tag:jobs_v4_generated_JobService_SearchJobsForAlert_async + */ + searchJobsForAlert( + request?: protos.google.cloud.talent.v4.ISearchJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4.ISearchJobsResponse, + protos.google.cloud.talent.v4.ISearchJobsRequest | undefined, + {} | undefined + ] + >; + searchJobsForAlert( + request: protos.google.cloud.talent.v4.ISearchJobsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4.ISearchJobsResponse, + protos.google.cloud.talent.v4.ISearchJobsRequest | null | undefined, + {} | null | undefined + > + ): void; + searchJobsForAlert( + request: protos.google.cloud.talent.v4.ISearchJobsRequest, + callback: Callback< + protos.google.cloud.talent.v4.ISearchJobsResponse, + protos.google.cloud.talent.v4.ISearchJobsRequest | null | undefined, + {} | null | undefined + > + ): void; + searchJobsForAlert( + request?: protos.google.cloud.talent.v4.ISearchJobsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4.ISearchJobsResponse, + protos.google.cloud.talent.v4.ISearchJobsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4.ISearchJobsResponse, + protos.google.cloud.talent.v4.ISearchJobsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4.ISearchJobsResponse, + protos.google.cloud.talent.v4.ISearchJobsRequest | 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.searchJobsForAlert(request, options, callback); + } + + /** + * Begins executing a batch create jobs operation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the tenant under which the job is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenants/bar". + * @param {number[]} request.jobs + * Required. The jobs to be created. + * A maximum of 200 jobs can be created in a batch. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v4/job_service.batch_create_jobs.js + * region_tag:jobs_v4_generated_JobService_BatchCreateJobs_async + */ + batchCreateJobs( + request?: protos.google.cloud.talent.v4.IBatchCreateJobsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.talent.v4.IBatchCreateJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchCreateJobs( + request: protos.google.cloud.talent.v4.IBatchCreateJobsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.talent.v4.IBatchCreateJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchCreateJobs( + request: protos.google.cloud.talent.v4.IBatchCreateJobsRequest, + callback: Callback< + LROperation< + protos.google.cloud.talent.v4.IBatchCreateJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchCreateJobs( + request?: protos.google.cloud.talent.v4.IBatchCreateJobsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.talent.v4.IBatchCreateJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.talent.v4.IBatchCreateJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.talent.v4.IBatchCreateJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >, + 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.batchCreateJobs(request, options, callback); + } + /** + * Check the status of the long running operation returned by `batchCreateJobs()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v4/job_service.batch_create_jobs.js + * region_tag:jobs_v4_generated_JobService_BatchCreateJobs_async + */ + async checkBatchCreateJobsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.talent.v4.BatchCreateJobsResponse, + protos.google.cloud.talent.v4.BatchOperationMetadata + > + > { + 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.batchCreateJobs, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.talent.v4.BatchCreateJobsResponse, + protos.google.cloud.talent.v4.BatchOperationMetadata + >; + } + /** + * Begins executing a batch update jobs operation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the tenant under which the job is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenants/bar". + * @param {number[]} request.jobs + * Required. The jobs to be updated. + * A maximum of 200 jobs can be updated in a batch. + * @param {google.protobuf.FieldMask} request.updateMask + * Strongly recommended for the best service experience. Be aware that it will + * also increase latency when checking the status of a batch operation. + * + * If {@link google.cloud.talent.v4.BatchUpdateJobsRequest.update_mask|update_mask} is provided, only the specified fields in + * {@link google.cloud.talent.v4.Job|Job} are updated. Otherwise all the fields are updated. + * + * A field mask to restrict the fields that are updated. Only + * top level fields of {@link google.cloud.talent.v4.Job|Job} are supported. + * + * If {@link google.cloud.talent.v4.BatchUpdateJobsRequest.update_mask|update_mask} is provided, The {@link google.cloud.talent.v4.Job|Job} inside + * {@link JobOperationResult.JobResult|JobResult} + * will only contains fields that is updated, plus the Id of the Job. + * Otherwise, {@link google.cloud.talent.v4.Job|Job} will include all fields, which can yield a very + * large response. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v4/job_service.batch_update_jobs.js + * region_tag:jobs_v4_generated_JobService_BatchUpdateJobs_async + */ + batchUpdateJobs( + request?: protos.google.cloud.talent.v4.IBatchUpdateJobsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.talent.v4.IBatchUpdateJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchUpdateJobs( + request: protos.google.cloud.talent.v4.IBatchUpdateJobsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.talent.v4.IBatchUpdateJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchUpdateJobs( + request: protos.google.cloud.talent.v4.IBatchUpdateJobsRequest, + callback: Callback< + LROperation< + protos.google.cloud.talent.v4.IBatchUpdateJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchUpdateJobs( + request?: protos.google.cloud.talent.v4.IBatchUpdateJobsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.talent.v4.IBatchUpdateJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.talent.v4.IBatchUpdateJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.talent.v4.IBatchUpdateJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >, + 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.batchUpdateJobs(request, options, callback); + } + /** + * Check the status of the long running operation returned by `batchUpdateJobs()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v4/job_service.batch_update_jobs.js + * region_tag:jobs_v4_generated_JobService_BatchUpdateJobs_async + */ + async checkBatchUpdateJobsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.talent.v4.BatchUpdateJobsResponse, + protos.google.cloud.talent.v4.BatchOperationMetadata + > + > { + 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.batchUpdateJobs, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.talent.v4.BatchUpdateJobsResponse, + protos.google.cloud.talent.v4.BatchOperationMetadata + >; + } + /** + * Begins executing a batch delete jobs operation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the tenant under which the job is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenants/bar". + * + * The parent of all of the jobs specified in `names` must match this field. + * @param {string[]} request.names + * The names of the jobs to delete. + * + * The format is "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". + * For example, "projects/foo/tenants/bar/jobs/baz". + * + * A maximum of 200 jobs can be deleted in a batch. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v4/job_service.batch_delete_jobs.js + * region_tag:jobs_v4_generated_JobService_BatchDeleteJobs_async + */ + batchDeleteJobs( + request?: protos.google.cloud.talent.v4.IBatchDeleteJobsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.talent.v4.IBatchDeleteJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchDeleteJobs( + request: protos.google.cloud.talent.v4.IBatchDeleteJobsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.talent.v4.IBatchDeleteJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchDeleteJobs( + request: protos.google.cloud.talent.v4.IBatchDeleteJobsRequest, + callback: Callback< + LROperation< + protos.google.cloud.talent.v4.IBatchDeleteJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchDeleteJobs( + request?: protos.google.cloud.talent.v4.IBatchDeleteJobsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.talent.v4.IBatchDeleteJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.talent.v4.IBatchDeleteJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.talent.v4.IBatchDeleteJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >, + 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.batchDeleteJobs(request, options, callback); + } + /** + * Check the status of the long running operation returned by `batchDeleteJobs()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v4/job_service.batch_delete_jobs.js + * region_tag:jobs_v4_generated_JobService_BatchDeleteJobs_async + */ + async checkBatchDeleteJobsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.talent.v4.BatchDeleteJobsResponse, + protos.google.cloud.talent.v4.BatchOperationMetadata + > + > { + 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.batchDeleteJobs, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.talent.v4.BatchDeleteJobsResponse, + protos.google.cloud.talent.v4.BatchOperationMetadata + >; + } + /** + * Lists jobs by filter. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the tenant under which the job is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenants/bar". + * @param {string} request.filter + * Required. The filter string specifies the jobs to be enumerated. + * + * Supported operator: =, AND + * + * The fields eligible for filtering are: + * + * * `companyName` + * * `requisitionId` + * * `status` Available values: OPEN, EXPIRED, ALL. Defaults to + * OPEN if no value is specified. + * + * At least one of `companyName` and `requisitionId` must present or an + * INVALID_ARGUMENT error is thrown. + * + * Sample Query: + * + * * companyName = "projects/foo/tenants/bar/companies/baz" + * * companyName = "projects/foo/tenants/bar/companies/baz" AND + * requisitionId = "req-1" + * * companyName = "projects/foo/tenants/bar/companies/baz" AND + * status = "EXPIRED" + * * requisitionId = "req-1" + * * requisitionId = "req-1" AND status = "EXPIRED" + * @param {string} request.pageToken + * The starting point of a query result. + * @param {number} request.pageSize + * The maximum number of jobs to be returned per page of results. + * + * If {@link google.cloud.talent.v4.ListJobsRequest.job_view|job_view} is set to {@link google.cloud.talent.v4.JobView.JOB_VIEW_ID_ONLY|JobView.JOB_VIEW_ID_ONLY}, the maximum allowed + * page size is 1000. Otherwise, the maximum allowed page size is 100. + * + * Default is 100 if empty or a number < 1 is specified. + * @param {google.cloud.talent.v4.JobView} request.jobView + * The desired job attributes returned for jobs in the + * search response. Defaults to {@link google.cloud.talent.v4.JobView.JOB_VIEW_FULL|JobView.JOB_VIEW_FULL} if no value is + * specified. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Job]{@link google.cloud.talent.v4.Job}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listJobs( + request?: protos.google.cloud.talent.v4.IListJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4.IJob[], + protos.google.cloud.talent.v4.IListJobsRequest | null, + protos.google.cloud.talent.v4.IListJobsResponse + ] + >; + listJobs( + request: protos.google.cloud.talent.v4.IListJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.talent.v4.IListJobsRequest, + protos.google.cloud.talent.v4.IListJobsResponse | null | undefined, + protos.google.cloud.talent.v4.IJob + > + ): void; + listJobs( + request: protos.google.cloud.talent.v4.IListJobsRequest, + callback: PaginationCallback< + protos.google.cloud.talent.v4.IListJobsRequest, + protos.google.cloud.talent.v4.IListJobsResponse | null | undefined, + protos.google.cloud.talent.v4.IJob + > + ): void; + listJobs( + request?: protos.google.cloud.talent.v4.IListJobsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.talent.v4.IListJobsRequest, + protos.google.cloud.talent.v4.IListJobsResponse | null | undefined, + protos.google.cloud.talent.v4.IJob + >, + callback?: PaginationCallback< + protos.google.cloud.talent.v4.IListJobsRequest, + protos.google.cloud.talent.v4.IListJobsResponse | null | undefined, + protos.google.cloud.talent.v4.IJob + > + ): Promise< + [ + protos.google.cloud.talent.v4.IJob[], + protos.google.cloud.talent.v4.IListJobsRequest | null, + protos.google.cloud.talent.v4.IListJobsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listJobs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the tenant under which the job is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenants/bar". + * @param {string} request.filter + * Required. The filter string specifies the jobs to be enumerated. + * + * Supported operator: =, AND + * + * The fields eligible for filtering are: + * + * * `companyName` + * * `requisitionId` + * * `status` Available values: OPEN, EXPIRED, ALL. Defaults to + * OPEN if no value is specified. + * + * At least one of `companyName` and `requisitionId` must present or an + * INVALID_ARGUMENT error is thrown. + * + * Sample Query: + * + * * companyName = "projects/foo/tenants/bar/companies/baz" + * * companyName = "projects/foo/tenants/bar/companies/baz" AND + * requisitionId = "req-1" + * * companyName = "projects/foo/tenants/bar/companies/baz" AND + * status = "EXPIRED" + * * requisitionId = "req-1" + * * requisitionId = "req-1" AND status = "EXPIRED" + * @param {string} request.pageToken + * The starting point of a query result. + * @param {number} request.pageSize + * The maximum number of jobs to be returned per page of results. + * + * If {@link google.cloud.talent.v4.ListJobsRequest.job_view|job_view} is set to {@link google.cloud.talent.v4.JobView.JOB_VIEW_ID_ONLY|JobView.JOB_VIEW_ID_ONLY}, the maximum allowed + * page size is 1000. Otherwise, the maximum allowed page size is 100. + * + * Default is 100 if empty or a number < 1 is specified. + * @param {google.cloud.talent.v4.JobView} request.jobView + * The desired job attributes returned for jobs in the + * search response. Defaults to {@link google.cloud.talent.v4.JobView.JOB_VIEW_FULL|JobView.JOB_VIEW_FULL} if no value is + * specified. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Job]{@link google.cloud.talent.v4.Job} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listJobsStream( + request?: protos.google.cloud.talent.v4.IListJobsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobs.createStream( + this.innerApiCalls.listJobs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the tenant under which the job is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenants/bar". + * @param {string} request.filter + * Required. The filter string specifies the jobs to be enumerated. + * + * Supported operator: =, AND + * + * The fields eligible for filtering are: + * + * * `companyName` + * * `requisitionId` + * * `status` Available values: OPEN, EXPIRED, ALL. Defaults to + * OPEN if no value is specified. + * + * At least one of `companyName` and `requisitionId` must present or an + * INVALID_ARGUMENT error is thrown. + * + * Sample Query: + * + * * companyName = "projects/foo/tenants/bar/companies/baz" + * * companyName = "projects/foo/tenants/bar/companies/baz" AND + * requisitionId = "req-1" + * * companyName = "projects/foo/tenants/bar/companies/baz" AND + * status = "EXPIRED" + * * requisitionId = "req-1" + * * requisitionId = "req-1" AND status = "EXPIRED" + * @param {string} request.pageToken + * The starting point of a query result. + * @param {number} request.pageSize + * The maximum number of jobs to be returned per page of results. + * + * If {@link google.cloud.talent.v4.ListJobsRequest.job_view|job_view} is set to {@link google.cloud.talent.v4.JobView.JOB_VIEW_ID_ONLY|JobView.JOB_VIEW_ID_ONLY}, the maximum allowed + * page size is 1000. Otherwise, the maximum allowed page size is 100. + * + * Default is 100 if empty or a number < 1 is specified. + * @param {google.cloud.talent.v4.JobView} request.jobView + * The desired job attributes returned for jobs in the + * search response. Defaults to {@link google.cloud.talent.v4.JobView.JOB_VIEW_FULL|JobView.JOB_VIEW_FULL} if no value is + * specified. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Job]{@link google.cloud.talent.v4.Job}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v4/job_service.list_jobs.js + * region_tag:jobs_v4_generated_JobService_ListJobs_async + */ + listJobsAsync( + request?: protos.google.cloud.talent.v4.IListJobsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobs.asyncIterate( + this.innerApiCalls['listJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified company resource name string. + * + * @param {string} project + * @param {string} tenant + * @param {string} company + * @returns {string} Resource name string. + */ + companyPath(project: string, tenant: string, company: string) { + return this.pathTemplates.companyPathTemplate.render({ + project: project, + tenant: tenant, + company: company, + }); + } + + /** + * Parse the project from Company resource. + * + * @param {string} companyName + * A fully-qualified path representing Company resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCompanyName(companyName: string) { + return this.pathTemplates.companyPathTemplate.match(companyName).project; + } + + /** + * Parse the tenant from Company resource. + * + * @param {string} companyName + * A fully-qualified path representing Company resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromCompanyName(companyName: string) { + return this.pathTemplates.companyPathTemplate.match(companyName).tenant; + } + + /** + * Parse the company from Company resource. + * + * @param {string} companyName + * A fully-qualified path representing Company resource. + * @returns {string} A string representing the company. + */ + matchCompanyFromCompanyName(companyName: string) { + return this.pathTemplates.companyPathTemplate.match(companyName).company; + } + + /** + * Return a fully-qualified job resource name string. + * + * @param {string} project + * @param {string} tenant + * @param {string} job + * @returns {string} Resource name string. + */ + jobPath(project: string, tenant: string, job: string) { + return this.pathTemplates.jobPathTemplate.render({ + project: project, + tenant: tenant, + job: job, + }); + } + + /** + * Parse the project from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).project; + } + + /** + * Parse the tenant from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).tenant; + } + + /** + * Parse the job from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the job. + */ + matchJobFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).job; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified tenant resource name string. + * + * @param {string} project + * @param {string} tenant + * @returns {string} Resource name string. + */ + tenantPath(project: string, tenant: string) { + return this.pathTemplates.tenantPathTemplate.render({ + project: project, + tenant: tenant, + }); + } + + /** + * Parse the project from Tenant resource. + * + * @param {string} tenantName + * A fully-qualified path representing Tenant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTenantName(tenantName: string) { + return this.pathTemplates.tenantPathTemplate.match(tenantName).project; + } + + /** + * Parse the tenant from Tenant resource. + * + * @param {string} tenantName + * A fully-qualified path representing Tenant resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromTenantName(tenantName: string) { + return this.pathTemplates.tenantPathTemplate.match(tenantName).tenant; + } + + /** + * 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.jobServiceStub && !this._terminated) { + return this.jobServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-talent/src/v4/job_service_client_config.json b/packages/google-cloud-talent/src/v4/job_service_client_config.json new file mode 100644 index 00000000000..cf9e4788d65 --- /dev/null +++ b/packages/google-cloud-talent/src/v4/job_service_client_config.json @@ -0,0 +1,76 @@ +{ + "interfaces": { + "google.cloud.talent.v4.JobService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateJob": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchCreateJobs": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetJob": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateJob": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchUpdateJobs": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteJob": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "BatchDeleteJobs": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListJobs": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "SearchJobs": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SearchJobsForAlert": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-talent/src/v4/job_service_proto_list.json b/packages/google-cloud-talent/src/v4/job_service_proto_list.json new file mode 100644 index 00000000000..bcae136acc1 --- /dev/null +++ b/packages/google-cloud-talent/src/v4/job_service_proto_list.json @@ -0,0 +1,14 @@ +[ + "../../protos/google/cloud/talent/v4/common.proto", + "../../protos/google/cloud/talent/v4/company.proto", + "../../protos/google/cloud/talent/v4/company_service.proto", + "../../protos/google/cloud/talent/v4/completion_service.proto", + "../../protos/google/cloud/talent/v4/event.proto", + "../../protos/google/cloud/talent/v4/event_service.proto", + "../../protos/google/cloud/talent/v4/filters.proto", + "../../protos/google/cloud/talent/v4/histogram.proto", + "../../protos/google/cloud/talent/v4/job.proto", + "../../protos/google/cloud/talent/v4/job_service.proto", + "../../protos/google/cloud/talent/v4/tenant.proto", + "../../protos/google/cloud/talent/v4/tenant_service.proto" +] diff --git a/packages/google-cloud-talent/src/v4/tenant_service_client.ts b/packages/google-cloud-talent/src/v4/tenant_service_client.ts new file mode 100644 index 00000000000..d9e1412aaac --- /dev/null +++ b/packages/google-cloud-talent/src/v4/tenant_service_client.ts @@ -0,0 +1,1065 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v4/tenant_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './tenant_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service that handles tenant management, including CRUD and enumeration. + * @class + * @memberof v4 + */ +export class TenantServiceClient { + 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}; + tenantServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TenantServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new TenantServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof TenantServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + companyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}/companies/{company}' + ), + jobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}/jobs/{job}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + tenantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}' + ), + }; + + // 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 = { + listTenants: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'tenants' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.talent.v4.TenantService', + 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.tenantServiceStub) { + return this.tenantServiceStub; + } + + // Put together the "service stub" for + // google.cloud.talent.v4.TenantService. + this.tenantServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.talent.v4.TenantService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.talent.v4.TenantService, + 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 tenantServiceStubMethods = [ + 'createTenant', + 'getTenant', + 'updateTenant', + 'deleteTenant', + 'listTenants', + ]; + for (const methodName of tenantServiceStubMethods) { + const callPromise = this.tenantServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.tenantServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'jobs.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 'jobs.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', + 'https://www.googleapis.com/auth/jobs', + ]; + } + + 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 new tenant entity. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the project under which the tenant is created. + * + * The format is "projects/{project_id}", for example, + * "projects/foo". + * @param {google.cloud.talent.v4.Tenant} request.tenant + * Required. The tenant to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Tenant]{@link google.cloud.talent.v4.Tenant}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4/tenant_service.create_tenant.js + * region_tag:jobs_v4_generated_TenantService_CreateTenant_async + */ + createTenant( + request?: protos.google.cloud.talent.v4.ICreateTenantRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4.ITenant, + protos.google.cloud.talent.v4.ICreateTenantRequest | undefined, + {} | undefined + ] + >; + createTenant( + request: protos.google.cloud.talent.v4.ICreateTenantRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4.ITenant, + protos.google.cloud.talent.v4.ICreateTenantRequest | null | undefined, + {} | null | undefined + > + ): void; + createTenant( + request: protos.google.cloud.talent.v4.ICreateTenantRequest, + callback: Callback< + protos.google.cloud.talent.v4.ITenant, + protos.google.cloud.talent.v4.ICreateTenantRequest | null | undefined, + {} | null | undefined + > + ): void; + createTenant( + request?: protos.google.cloud.talent.v4.ICreateTenantRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4.ITenant, + protos.google.cloud.talent.v4.ICreateTenantRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4.ITenant, + protos.google.cloud.talent.v4.ICreateTenantRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4.ITenant, + protos.google.cloud.talent.v4.ICreateTenantRequest | 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.createTenant(request, options, callback); + } + /** + * Retrieves specified tenant. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the tenant to be retrieved. + * + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenants/bar". + * @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 [Tenant]{@link google.cloud.talent.v4.Tenant}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4/tenant_service.get_tenant.js + * region_tag:jobs_v4_generated_TenantService_GetTenant_async + */ + getTenant( + request?: protos.google.cloud.talent.v4.IGetTenantRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4.ITenant, + protos.google.cloud.talent.v4.IGetTenantRequest | undefined, + {} | undefined + ] + >; + getTenant( + request: protos.google.cloud.talent.v4.IGetTenantRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4.ITenant, + protos.google.cloud.talent.v4.IGetTenantRequest | null | undefined, + {} | null | undefined + > + ): void; + getTenant( + request: protos.google.cloud.talent.v4.IGetTenantRequest, + callback: Callback< + protos.google.cloud.talent.v4.ITenant, + protos.google.cloud.talent.v4.IGetTenantRequest | null | undefined, + {} | null | undefined + > + ): void; + getTenant( + request?: protos.google.cloud.talent.v4.IGetTenantRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4.ITenant, + protos.google.cloud.talent.v4.IGetTenantRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4.ITenant, + protos.google.cloud.talent.v4.IGetTenantRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4.ITenant, + protos.google.cloud.talent.v4.IGetTenantRequest | 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.getTenant(request, options, callback); + } + /** + * Updates specified tenant. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.talent.v4.Tenant} request.tenant + * Required. The tenant resource to replace the current resource in the system. + * @param {google.protobuf.FieldMask} request.updateMask + * Strongly recommended for the best service experience. + * + * If {@link google.cloud.talent.v4.UpdateTenantRequest.update_mask|update_mask} is provided, only the specified fields in + * {@link google.cloud.talent.v4.UpdateTenantRequest.tenant|tenant} are updated. Otherwise all the fields are updated. + * + * A field mask to specify the tenant fields to be updated. Only + * top level fields of {@link google.cloud.talent.v4.Tenant|Tenant} are supported. + * @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 [Tenant]{@link google.cloud.talent.v4.Tenant}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4/tenant_service.update_tenant.js + * region_tag:jobs_v4_generated_TenantService_UpdateTenant_async + */ + updateTenant( + request?: protos.google.cloud.talent.v4.IUpdateTenantRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4.ITenant, + protos.google.cloud.talent.v4.IUpdateTenantRequest | undefined, + {} | undefined + ] + >; + updateTenant( + request: protos.google.cloud.talent.v4.IUpdateTenantRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4.ITenant, + protos.google.cloud.talent.v4.IUpdateTenantRequest | null | undefined, + {} | null | undefined + > + ): void; + updateTenant( + request: protos.google.cloud.talent.v4.IUpdateTenantRequest, + callback: Callback< + protos.google.cloud.talent.v4.ITenant, + protos.google.cloud.talent.v4.IUpdateTenantRequest | null | undefined, + {} | null | undefined + > + ): void; + updateTenant( + request?: protos.google.cloud.talent.v4.IUpdateTenantRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4.ITenant, + protos.google.cloud.talent.v4.IUpdateTenantRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4.ITenant, + protos.google.cloud.talent.v4.IUpdateTenantRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4.ITenant, + protos.google.cloud.talent.v4.IUpdateTenantRequest | 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({ + 'tenant.name': request.tenant!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateTenant(request, options, callback); + } + /** + * Deletes specified tenant. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the tenant to be deleted. + * + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenants/bar". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4/tenant_service.delete_tenant.js + * region_tag:jobs_v4_generated_TenantService_DeleteTenant_async + */ + deleteTenant( + request?: protos.google.cloud.talent.v4.IDeleteTenantRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4.IDeleteTenantRequest | undefined, + {} | undefined + ] + >; + deleteTenant( + request: protos.google.cloud.talent.v4.IDeleteTenantRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4.IDeleteTenantRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteTenant( + request: protos.google.cloud.talent.v4.IDeleteTenantRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4.IDeleteTenantRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteTenant( + request?: protos.google.cloud.talent.v4.IDeleteTenantRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4.IDeleteTenantRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4.IDeleteTenantRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4.IDeleteTenantRequest | 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.deleteTenant(request, options, callback); + } + + /** + * Lists all tenants associated with the project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the project under which the tenant is created. + * + * The format is "projects/{project_id}", for example, + * "projects/foo". + * @param {string} request.pageToken + * The starting indicator from which to return results. + * @param {number} request.pageSize + * The maximum number of tenants to be returned, at most 100. + * Default is 100 if a non-positive number is provided. + * @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 [Tenant]{@link google.cloud.talent.v4.Tenant}. + * 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 `listTenantsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTenants( + request?: protos.google.cloud.talent.v4.IListTenantsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4.ITenant[], + protos.google.cloud.talent.v4.IListTenantsRequest | null, + protos.google.cloud.talent.v4.IListTenantsResponse + ] + >; + listTenants( + request: protos.google.cloud.talent.v4.IListTenantsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.talent.v4.IListTenantsRequest, + protos.google.cloud.talent.v4.IListTenantsResponse | null | undefined, + protos.google.cloud.talent.v4.ITenant + > + ): void; + listTenants( + request: protos.google.cloud.talent.v4.IListTenantsRequest, + callback: PaginationCallback< + protos.google.cloud.talent.v4.IListTenantsRequest, + protos.google.cloud.talent.v4.IListTenantsResponse | null | undefined, + protos.google.cloud.talent.v4.ITenant + > + ): void; + listTenants( + request?: protos.google.cloud.talent.v4.IListTenantsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.talent.v4.IListTenantsRequest, + protos.google.cloud.talent.v4.IListTenantsResponse | null | undefined, + protos.google.cloud.talent.v4.ITenant + >, + callback?: PaginationCallback< + protos.google.cloud.talent.v4.IListTenantsRequest, + protos.google.cloud.talent.v4.IListTenantsResponse | null | undefined, + protos.google.cloud.talent.v4.ITenant + > + ): Promise< + [ + protos.google.cloud.talent.v4.ITenant[], + protos.google.cloud.talent.v4.IListTenantsRequest | null, + protos.google.cloud.talent.v4.IListTenantsResponse + ] + > | 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.listTenants(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 under which the tenant is created. + * + * The format is "projects/{project_id}", for example, + * "projects/foo". + * @param {string} request.pageToken + * The starting indicator from which to return results. + * @param {number} request.pageSize + * The maximum number of tenants to be returned, at most 100. + * Default is 100 if a non-positive number is provided. + * @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 [Tenant]{@link google.cloud.talent.v4.Tenant} 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 `listTenantsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTenantsStream( + request?: protos.google.cloud.talent.v4.IListTenantsRequest, + 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['listTenants']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTenants.createStream( + this.innerApiCalls.listTenants as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTenants`, 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 under which the tenant is created. + * + * The format is "projects/{project_id}", for example, + * "projects/foo". + * @param {string} request.pageToken + * The starting indicator from which to return results. + * @param {number} request.pageSize + * The maximum number of tenants to be returned, at most 100. + * Default is 100 if a non-positive number is provided. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Tenant]{@link google.cloud.talent.v4.Tenant}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v4/tenant_service.list_tenants.js + * region_tag:jobs_v4_generated_TenantService_ListTenants_async + */ + listTenantsAsync( + request?: protos.google.cloud.talent.v4.IListTenantsRequest, + 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['listTenants']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTenants.asyncIterate( + this.innerApiCalls['listTenants'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified company resource name string. + * + * @param {string} project + * @param {string} tenant + * @param {string} company + * @returns {string} Resource name string. + */ + companyPath(project: string, tenant: string, company: string) { + return this.pathTemplates.companyPathTemplate.render({ + project: project, + tenant: tenant, + company: company, + }); + } + + /** + * Parse the project from Company resource. + * + * @param {string} companyName + * A fully-qualified path representing Company resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCompanyName(companyName: string) { + return this.pathTemplates.companyPathTemplate.match(companyName).project; + } + + /** + * Parse the tenant from Company resource. + * + * @param {string} companyName + * A fully-qualified path representing Company resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromCompanyName(companyName: string) { + return this.pathTemplates.companyPathTemplate.match(companyName).tenant; + } + + /** + * Parse the company from Company resource. + * + * @param {string} companyName + * A fully-qualified path representing Company resource. + * @returns {string} A string representing the company. + */ + matchCompanyFromCompanyName(companyName: string) { + return this.pathTemplates.companyPathTemplate.match(companyName).company; + } + + /** + * Return a fully-qualified job resource name string. + * + * @param {string} project + * @param {string} tenant + * @param {string} job + * @returns {string} Resource name string. + */ + jobPath(project: string, tenant: string, job: string) { + return this.pathTemplates.jobPathTemplate.render({ + project: project, + tenant: tenant, + job: job, + }); + } + + /** + * Parse the project from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).project; + } + + /** + * Parse the tenant from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).tenant; + } + + /** + * Parse the job from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the job. + */ + matchJobFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).job; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified tenant resource name string. + * + * @param {string} project + * @param {string} tenant + * @returns {string} Resource name string. + */ + tenantPath(project: string, tenant: string) { + return this.pathTemplates.tenantPathTemplate.render({ + project: project, + tenant: tenant, + }); + } + + /** + * Parse the project from Tenant resource. + * + * @param {string} tenantName + * A fully-qualified path representing Tenant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTenantName(tenantName: string) { + return this.pathTemplates.tenantPathTemplate.match(tenantName).project; + } + + /** + * Parse the tenant from Tenant resource. + * + * @param {string} tenantName + * A fully-qualified path representing Tenant resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromTenantName(tenantName: string) { + return this.pathTemplates.tenantPathTemplate.match(tenantName).tenant; + } + + /** + * 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.tenantServiceStub && !this._terminated) { + return this.tenantServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-talent/src/v4/tenant_service_client_config.json b/packages/google-cloud-talent/src/v4/tenant_service_client_config.json new file mode 100644 index 00000000000..478061cc99c --- /dev/null +++ b/packages/google-cloud-talent/src/v4/tenant_service_client_config.json @@ -0,0 +1,51 @@ +{ + "interfaces": { + "google.cloud.talent.v4.TenantService": { + "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": { + "CreateTenant": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTenant": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateTenant": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTenant": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListTenants": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-talent/src/v4/tenant_service_proto_list.json b/packages/google-cloud-talent/src/v4/tenant_service_proto_list.json new file mode 100644 index 00000000000..bcae136acc1 --- /dev/null +++ b/packages/google-cloud-talent/src/v4/tenant_service_proto_list.json @@ -0,0 +1,14 @@ +[ + "../../protos/google/cloud/talent/v4/common.proto", + "../../protos/google/cloud/talent/v4/company.proto", + "../../protos/google/cloud/talent/v4/company_service.proto", + "../../protos/google/cloud/talent/v4/completion_service.proto", + "../../protos/google/cloud/talent/v4/event.proto", + "../../protos/google/cloud/talent/v4/event_service.proto", + "../../protos/google/cloud/talent/v4/filters.proto", + "../../protos/google/cloud/talent/v4/histogram.proto", + "../../protos/google/cloud/talent/v4/job.proto", + "../../protos/google/cloud/talent/v4/job_service.proto", + "../../protos/google/cloud/talent/v4/tenant.proto", + "../../protos/google/cloud/talent/v4/tenant_service.proto" +] diff --git a/packages/google-cloud-talent/src/v4beta1/company_service_client.ts b/packages/google-cloud-talent/src/v4beta1/company_service_client.ts new file mode 100644 index 00000000000..39befe95de5 --- /dev/null +++ b/packages/google-cloud-talent/src/v4beta1/company_service_client.ts @@ -0,0 +1,1234 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v4beta1/company_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './company_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service that handles company management, including CRUD and enumeration. + * @class + * @memberof v4beta1 + */ +export class CompanyServiceClient { + 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}; + companyServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CompanyServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new CompanyServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof CompanyServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectCompanyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/companies/{company}' + ), + projectJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/jobs/{job}' + ), + projectTenantCompanyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}/companies/{company}' + ), + projectTenantJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}/jobs/{job}' + ), + tenantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}' + ), + }; + + // 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 = { + listCompanies: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'companies' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.talent.v4beta1.CompanyService', + 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.companyServiceStub) { + return this.companyServiceStub; + } + + // Put together the "service stub" for + // google.cloud.talent.v4beta1.CompanyService. + this.companyServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.talent.v4beta1.CompanyService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.talent.v4beta1.CompanyService, + 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 companyServiceStubMethods = [ + 'createCompany', + 'getCompany', + 'updateCompany', + 'deleteCompany', + 'listCompanies', + ]; + for (const methodName of companyServiceStubMethods) { + const callPromise = this.companyServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.companyServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'jobs.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 'jobs.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', + 'https://www.googleapis.com/auth/jobs', + ]; + } + + 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 new company entity. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the tenant under which the company is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + * is created, for example, "projects/foo". + * @param {google.cloud.talent.v4beta1.Company} request.company + * Required. The company to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Company]{@link google.cloud.talent.v4beta1.Company}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4beta1/company_service.create_company.js + * region_tag:jobs_v4beta1_generated_CompanyService_CreateCompany_async + */ + createCompany( + request?: protos.google.cloud.talent.v4beta1.ICreateCompanyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ICompany, + protos.google.cloud.talent.v4beta1.ICreateCompanyRequest | undefined, + {} | undefined + ] + >; + createCompany( + request: protos.google.cloud.talent.v4beta1.ICreateCompanyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4beta1.ICompany, + | protos.google.cloud.talent.v4beta1.ICreateCompanyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createCompany( + request: protos.google.cloud.talent.v4beta1.ICreateCompanyRequest, + callback: Callback< + protos.google.cloud.talent.v4beta1.ICompany, + | protos.google.cloud.talent.v4beta1.ICreateCompanyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createCompany( + request?: protos.google.cloud.talent.v4beta1.ICreateCompanyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4beta1.ICompany, + | protos.google.cloud.talent.v4beta1.ICreateCompanyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4beta1.ICompany, + | protos.google.cloud.talent.v4beta1.ICreateCompanyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ICompany, + protos.google.cloud.talent.v4beta1.ICreateCompanyRequest | 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.createCompany(request, options, callback); + } + /** + * Retrieves specified company. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the company to be retrieved. + * + * The format is + * "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for + * example, "projects/api-test-project/tenants/foo/companies/bar". + * + * If tenant id is unspecified, the default tenant is used, for + * example, "projects/api-test-project/companies/bar". + * @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 [Company]{@link google.cloud.talent.v4beta1.Company}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4beta1/company_service.get_company.js + * region_tag:jobs_v4beta1_generated_CompanyService_GetCompany_async + */ + getCompany( + request?: protos.google.cloud.talent.v4beta1.IGetCompanyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ICompany, + protos.google.cloud.talent.v4beta1.IGetCompanyRequest | undefined, + {} | undefined + ] + >; + getCompany( + request: protos.google.cloud.talent.v4beta1.IGetCompanyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4beta1.ICompany, + protos.google.cloud.talent.v4beta1.IGetCompanyRequest | null | undefined, + {} | null | undefined + > + ): void; + getCompany( + request: protos.google.cloud.talent.v4beta1.IGetCompanyRequest, + callback: Callback< + protos.google.cloud.talent.v4beta1.ICompany, + protos.google.cloud.talent.v4beta1.IGetCompanyRequest | null | undefined, + {} | null | undefined + > + ): void; + getCompany( + request?: protos.google.cloud.talent.v4beta1.IGetCompanyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4beta1.ICompany, + | protos.google.cloud.talent.v4beta1.IGetCompanyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4beta1.ICompany, + protos.google.cloud.talent.v4beta1.IGetCompanyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ICompany, + protos.google.cloud.talent.v4beta1.IGetCompanyRequest | 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.getCompany(request, options, callback); + } + /** + * Updates specified company. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.talent.v4beta1.Company} request.company + * Required. The company resource to replace the current resource in the system. + * @param {google.protobuf.FieldMask} request.updateMask + * Strongly recommended for the best service experience. + * + * If {@link google.cloud.talent.v4beta1.UpdateCompanyRequest.update_mask|update_mask} is provided, only the specified fields in + * {@link google.cloud.talent.v4beta1.UpdateCompanyRequest.company|company} are updated. Otherwise all the fields are updated. + * + * A field mask to specify the company fields to be updated. Only + * top level fields of {@link google.cloud.talent.v4beta1.Company|Company} are supported. + * @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 [Company]{@link google.cloud.talent.v4beta1.Company}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4beta1/company_service.update_company.js + * region_tag:jobs_v4beta1_generated_CompanyService_UpdateCompany_async + */ + updateCompany( + request?: protos.google.cloud.talent.v4beta1.IUpdateCompanyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ICompany, + protos.google.cloud.talent.v4beta1.IUpdateCompanyRequest | undefined, + {} | undefined + ] + >; + updateCompany( + request: protos.google.cloud.talent.v4beta1.IUpdateCompanyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4beta1.ICompany, + | protos.google.cloud.talent.v4beta1.IUpdateCompanyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateCompany( + request: protos.google.cloud.talent.v4beta1.IUpdateCompanyRequest, + callback: Callback< + protos.google.cloud.talent.v4beta1.ICompany, + | protos.google.cloud.talent.v4beta1.IUpdateCompanyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateCompany( + request?: protos.google.cloud.talent.v4beta1.IUpdateCompanyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4beta1.ICompany, + | protos.google.cloud.talent.v4beta1.IUpdateCompanyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4beta1.ICompany, + | protos.google.cloud.talent.v4beta1.IUpdateCompanyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ICompany, + protos.google.cloud.talent.v4beta1.IUpdateCompanyRequest | 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({ + 'company.name': request.company!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateCompany(request, options, callback); + } + /** + * Deletes specified company. + * Prerequisite: The company has no jobs associated with it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the company to be deleted. + * + * The format is + * "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for + * example, "projects/foo/tenants/bar/companies/baz". + * + * If tenant id is unspecified, the default tenant is used, for + * example, "projects/foo/companies/bar". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4beta1/company_service.delete_company.js + * region_tag:jobs_v4beta1_generated_CompanyService_DeleteCompany_async + */ + deleteCompany( + request?: protos.google.cloud.talent.v4beta1.IDeleteCompanyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4beta1.IDeleteCompanyRequest | undefined, + {} | undefined + ] + >; + deleteCompany( + request: protos.google.cloud.talent.v4beta1.IDeleteCompanyRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.talent.v4beta1.IDeleteCompanyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteCompany( + request: protos.google.cloud.talent.v4beta1.IDeleteCompanyRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.talent.v4beta1.IDeleteCompanyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteCompany( + request?: protos.google.cloud.talent.v4beta1.IDeleteCompanyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.talent.v4beta1.IDeleteCompanyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.talent.v4beta1.IDeleteCompanyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4beta1.IDeleteCompanyRequest | 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.deleteCompany(request, options, callback); + } + + /** + * Lists all companies associated with the project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the tenant under which the company is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenant/bar". + * + * If tenant id is unspecified, the default tenant will be used, for + * example, "projects/foo". + * @param {string} request.pageToken + * The starting indicator from which to return results. + * @param {number} request.pageSize + * The maximum number of companies to be returned, at most 100. + * Default is 100 if a non-positive number is provided. + * @param {boolean} request.requireOpenJobs + * Set to true if the companies requested must have open jobs. + * + * Defaults to false. + * + * If true, at most {@link google.cloud.talent.v4beta1.ListCompaniesRequest.page_size|page_size} of companies are fetched, among which + * only those with open jobs are returned. + * @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 [Company]{@link google.cloud.talent.v4beta1.Company}. + * 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 `listCompaniesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCompanies( + request?: protos.google.cloud.talent.v4beta1.IListCompaniesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ICompany[], + protos.google.cloud.talent.v4beta1.IListCompaniesRequest | null, + protos.google.cloud.talent.v4beta1.IListCompaniesResponse + ] + >; + listCompanies( + request: protos.google.cloud.talent.v4beta1.IListCompaniesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.talent.v4beta1.IListCompaniesRequest, + | protos.google.cloud.talent.v4beta1.IListCompaniesResponse + | null + | undefined, + protos.google.cloud.talent.v4beta1.ICompany + > + ): void; + listCompanies( + request: protos.google.cloud.talent.v4beta1.IListCompaniesRequest, + callback: PaginationCallback< + protos.google.cloud.talent.v4beta1.IListCompaniesRequest, + | protos.google.cloud.talent.v4beta1.IListCompaniesResponse + | null + | undefined, + protos.google.cloud.talent.v4beta1.ICompany + > + ): void; + listCompanies( + request?: protos.google.cloud.talent.v4beta1.IListCompaniesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.talent.v4beta1.IListCompaniesRequest, + | protos.google.cloud.talent.v4beta1.IListCompaniesResponse + | null + | undefined, + protos.google.cloud.talent.v4beta1.ICompany + >, + callback?: PaginationCallback< + protos.google.cloud.talent.v4beta1.IListCompaniesRequest, + | protos.google.cloud.talent.v4beta1.IListCompaniesResponse + | null + | undefined, + protos.google.cloud.talent.v4beta1.ICompany + > + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ICompany[], + protos.google.cloud.talent.v4beta1.IListCompaniesRequest | null, + protos.google.cloud.talent.v4beta1.IListCompaniesResponse + ] + > | 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.listCompanies(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 tenant under which the company is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenant/bar". + * + * If tenant id is unspecified, the default tenant will be used, for + * example, "projects/foo". + * @param {string} request.pageToken + * The starting indicator from which to return results. + * @param {number} request.pageSize + * The maximum number of companies to be returned, at most 100. + * Default is 100 if a non-positive number is provided. + * @param {boolean} request.requireOpenJobs + * Set to true if the companies requested must have open jobs. + * + * Defaults to false. + * + * If true, at most {@link google.cloud.talent.v4beta1.ListCompaniesRequest.page_size|page_size} of companies are fetched, among which + * only those with open jobs are returned. + * @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 [Company]{@link google.cloud.talent.v4beta1.Company} 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 `listCompaniesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCompaniesStream( + request?: protos.google.cloud.talent.v4beta1.IListCompaniesRequest, + 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['listCompanies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCompanies.createStream( + this.innerApiCalls.listCompanies as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listCompanies`, 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 tenant under which the company is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenant/bar". + * + * If tenant id is unspecified, the default tenant will be used, for + * example, "projects/foo". + * @param {string} request.pageToken + * The starting indicator from which to return results. + * @param {number} request.pageSize + * The maximum number of companies to be returned, at most 100. + * Default is 100 if a non-positive number is provided. + * @param {boolean} request.requireOpenJobs + * Set to true if the companies requested must have open jobs. + * + * Defaults to false. + * + * If true, at most {@link google.cloud.talent.v4beta1.ListCompaniesRequest.page_size|page_size} of companies are fetched, among which + * only those with open jobs are returned. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Company]{@link google.cloud.talent.v4beta1.Company}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v4beta1/company_service.list_companies.js + * region_tag:jobs_v4beta1_generated_CompanyService_ListCompanies_async + */ + listCompaniesAsync( + request?: protos.google.cloud.talent.v4beta1.IListCompaniesRequest, + 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['listCompanies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCompanies.asyncIterate( + this.innerApiCalls['listCompanies'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectCompany resource name string. + * + * @param {string} project + * @param {string} company + * @returns {string} Resource name string. + */ + projectCompanyPath(project: string, company: string) { + return this.pathTemplates.projectCompanyPathTemplate.render({ + project: project, + company: company, + }); + } + + /** + * Parse the project from ProjectCompany resource. + * + * @param {string} projectCompanyName + * A fully-qualified path representing project_company resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCompanyName(projectCompanyName: string) { + return this.pathTemplates.projectCompanyPathTemplate.match( + projectCompanyName + ).project; + } + + /** + * Parse the company from ProjectCompany resource. + * + * @param {string} projectCompanyName + * A fully-qualified path representing project_company resource. + * @returns {string} A string representing the company. + */ + matchCompanyFromProjectCompanyName(projectCompanyName: string) { + return this.pathTemplates.projectCompanyPathTemplate.match( + projectCompanyName + ).company; + } + + /** + * Return a fully-qualified projectJob resource name string. + * + * @param {string} project + * @param {string} job + * @returns {string} Resource name string. + */ + projectJobPath(project: string, job: string) { + return this.pathTemplates.projectJobPathTemplate.render({ + project: project, + job: job, + }); + } + + /** + * Parse the project from ProjectJob resource. + * + * @param {string} projectJobName + * A fully-qualified path representing project_job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectJobName(projectJobName: string) { + return this.pathTemplates.projectJobPathTemplate.match(projectJobName) + .project; + } + + /** + * Parse the job from ProjectJob resource. + * + * @param {string} projectJobName + * A fully-qualified path representing project_job resource. + * @returns {string} A string representing the job. + */ + matchJobFromProjectJobName(projectJobName: string) { + return this.pathTemplates.projectJobPathTemplate.match(projectJobName).job; + } + + /** + * Return a fully-qualified projectTenantCompany resource name string. + * + * @param {string} project + * @param {string} tenant + * @param {string} company + * @returns {string} Resource name string. + */ + projectTenantCompanyPath(project: string, tenant: string, company: string) { + return this.pathTemplates.projectTenantCompanyPathTemplate.render({ + project: project, + tenant: tenant, + company: company, + }); + } + + /** + * Parse the project from ProjectTenantCompany resource. + * + * @param {string} projectTenantCompanyName + * A fully-qualified path representing project_tenant_company resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTenantCompanyName(projectTenantCompanyName: string) { + return this.pathTemplates.projectTenantCompanyPathTemplate.match( + projectTenantCompanyName + ).project; + } + + /** + * Parse the tenant from ProjectTenantCompany resource. + * + * @param {string} projectTenantCompanyName + * A fully-qualified path representing project_tenant_company resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromProjectTenantCompanyName(projectTenantCompanyName: string) { + return this.pathTemplates.projectTenantCompanyPathTemplate.match( + projectTenantCompanyName + ).tenant; + } + + /** + * Parse the company from ProjectTenantCompany resource. + * + * @param {string} projectTenantCompanyName + * A fully-qualified path representing project_tenant_company resource. + * @returns {string} A string representing the company. + */ + matchCompanyFromProjectTenantCompanyName(projectTenantCompanyName: string) { + return this.pathTemplates.projectTenantCompanyPathTemplate.match( + projectTenantCompanyName + ).company; + } + + /** + * Return a fully-qualified projectTenantJob resource name string. + * + * @param {string} project + * @param {string} tenant + * @param {string} job + * @returns {string} Resource name string. + */ + projectTenantJobPath(project: string, tenant: string, job: string) { + return this.pathTemplates.projectTenantJobPathTemplate.render({ + project: project, + tenant: tenant, + job: job, + }); + } + + /** + * Parse the project from ProjectTenantJob resource. + * + * @param {string} projectTenantJobName + * A fully-qualified path representing project_tenant_job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTenantJobName(projectTenantJobName: string) { + return this.pathTemplates.projectTenantJobPathTemplate.match( + projectTenantJobName + ).project; + } + + /** + * Parse the tenant from ProjectTenantJob resource. + * + * @param {string} projectTenantJobName + * A fully-qualified path representing project_tenant_job resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromProjectTenantJobName(projectTenantJobName: string) { + return this.pathTemplates.projectTenantJobPathTemplate.match( + projectTenantJobName + ).tenant; + } + + /** + * Parse the job from ProjectTenantJob resource. + * + * @param {string} projectTenantJobName + * A fully-qualified path representing project_tenant_job resource. + * @returns {string} A string representing the job. + */ + matchJobFromProjectTenantJobName(projectTenantJobName: string) { + return this.pathTemplates.projectTenantJobPathTemplate.match( + projectTenantJobName + ).job; + } + + /** + * Return a fully-qualified tenant resource name string. + * + * @param {string} project + * @param {string} tenant + * @returns {string} Resource name string. + */ + tenantPath(project: string, tenant: string) { + return this.pathTemplates.tenantPathTemplate.render({ + project: project, + tenant: tenant, + }); + } + + /** + * Parse the project from Tenant resource. + * + * @param {string} tenantName + * A fully-qualified path representing Tenant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTenantName(tenantName: string) { + return this.pathTemplates.tenantPathTemplate.match(tenantName).project; + } + + /** + * Parse the tenant from Tenant resource. + * + * @param {string} tenantName + * A fully-qualified path representing Tenant resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromTenantName(tenantName: string) { + return this.pathTemplates.tenantPathTemplate.match(tenantName).tenant; + } + + /** + * 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.companyServiceStub && !this._terminated) { + return this.companyServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-talent/src/v4beta1/company_service_client_config.json b/packages/google-cloud-talent/src/v4beta1/company_service_client_config.json new file mode 100644 index 00000000000..ed5285ce221 --- /dev/null +++ b/packages/google-cloud-talent/src/v4beta1/company_service_client_config.json @@ -0,0 +1,51 @@ +{ + "interfaces": { + "google.cloud.talent.v4beta1.CompanyService": { + "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": { + "CreateCompany": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetCompany": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateCompany": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCompany": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListCompanies": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-talent/src/v4beta1/company_service_proto_list.json b/packages/google-cloud-talent/src/v4beta1/company_service_proto_list.json new file mode 100644 index 00000000000..e44f49ea525 --- /dev/null +++ b/packages/google-cloud-talent/src/v4beta1/company_service_proto_list.json @@ -0,0 +1,15 @@ +[ + "../../protos/google/cloud/talent/v4beta1/batch.proto", + "../../protos/google/cloud/talent/v4beta1/common.proto", + "../../protos/google/cloud/talent/v4beta1/company.proto", + "../../protos/google/cloud/talent/v4beta1/company_service.proto", + "../../protos/google/cloud/talent/v4beta1/completion_service.proto", + "../../protos/google/cloud/talent/v4beta1/event.proto", + "../../protos/google/cloud/talent/v4beta1/event_service.proto", + "../../protos/google/cloud/talent/v4beta1/filters.proto", + "../../protos/google/cloud/talent/v4beta1/histogram.proto", + "../../protos/google/cloud/talent/v4beta1/job.proto", + "../../protos/google/cloud/talent/v4beta1/job_service.proto", + "../../protos/google/cloud/talent/v4beta1/tenant.proto", + "../../protos/google/cloud/talent/v4beta1/tenant_service.proto" +] diff --git a/packages/google-cloud-talent/src/v4beta1/completion_client.ts b/packages/google-cloud-talent/src/v4beta1/completion_client.ts new file mode 100644 index 00000000000..23a09e9a0f9 --- /dev/null +++ b/packages/google-cloud-talent/src/v4beta1/completion_client.ts @@ -0,0 +1,723 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v4beta1/completion_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './completion_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service handles auto completion. + * @class + * @memberof v4beta1 + */ +export class CompletionClient { + 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}; + completionStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CompletionClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new CompletionClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof CompletionClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectCompanyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/companies/{company}' + ), + projectJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/jobs/{job}' + ), + projectTenantCompanyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}/companies/{company}' + ), + projectTenantJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}/jobs/{job}' + ), + tenantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.talent.v4beta1.Completion', + 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.completionStub) { + return this.completionStub; + } + + // Put together the "service stub" for + // google.cloud.talent.v4beta1.Completion. + this.completionStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.talent.v4beta1.Completion' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.talent.v4beta1.Completion, + 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 completionStubMethods = ['completeQuery']; + for (const methodName of completionStubMethods) { + const callPromise = this.completionStub.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 = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.completionStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'jobs.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 'jobs.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', + 'https://www.googleapis.com/auth/jobs', + ]; + } + + 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 -- + // ------------------- + /** + * Completes the specified prefix with keyword suggestions. + * Intended for use by a job search auto-complete search box. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of tenant the completion is performed within. + * + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenant/bar". + * + * If tenant id is unspecified, the default tenant is used, for + * example, "projects/foo". + * @param {string} request.query + * Required. The query used to generate suggestions. + * + * The maximum number of allowed characters is 255. + * @param {string[]} request.languageCodes + * The list of languages of the query. This is + * the BCP-47 language code, such as "en-US" or "sr-Latn". + * For more information, see + * [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + * + * The maximum number of allowed characters is 255. + * @param {number} request.pageSize + * Required. Completion result count. + * + * The maximum allowed page size is 10. + * @param {string} request.company + * If provided, restricts completion to specified company. + * + * The format is + * "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for + * example, "projects/foo/tenants/bar/companies/baz". + * + * If tenant id is unspecified, the default tenant is used, for + * example, "projects/foo". + * @param {google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope} request.scope + * The scope of the completion. The defaults is {@link google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope.PUBLIC|CompletionScope.PUBLIC}. + * @param {google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType} request.type + * The completion topic. The default is {@link google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType.COMBINED|CompletionType.COMBINED}. + * @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 [CompleteQueryResponse]{@link google.cloud.talent.v4beta1.CompleteQueryResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4beta1/completion.complete_query.js + * region_tag:jobs_v4beta1_generated_Completion_CompleteQuery_async + */ + completeQuery( + request?: protos.google.cloud.talent.v4beta1.ICompleteQueryRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ICompleteQueryResponse, + protos.google.cloud.talent.v4beta1.ICompleteQueryRequest | undefined, + {} | undefined + ] + >; + completeQuery( + request: protos.google.cloud.talent.v4beta1.ICompleteQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4beta1.ICompleteQueryResponse, + | protos.google.cloud.talent.v4beta1.ICompleteQueryRequest + | null + | undefined, + {} | null | undefined + > + ): void; + completeQuery( + request: protos.google.cloud.talent.v4beta1.ICompleteQueryRequest, + callback: Callback< + protos.google.cloud.talent.v4beta1.ICompleteQueryResponse, + | protos.google.cloud.talent.v4beta1.ICompleteQueryRequest + | null + | undefined, + {} | null | undefined + > + ): void; + completeQuery( + request?: protos.google.cloud.talent.v4beta1.ICompleteQueryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4beta1.ICompleteQueryResponse, + | protos.google.cloud.talent.v4beta1.ICompleteQueryRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4beta1.ICompleteQueryResponse, + | protos.google.cloud.talent.v4beta1.ICompleteQueryRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ICompleteQueryResponse, + protos.google.cloud.talent.v4beta1.ICompleteQueryRequest | 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.completeQuery(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectCompany resource name string. + * + * @param {string} project + * @param {string} company + * @returns {string} Resource name string. + */ + projectCompanyPath(project: string, company: string) { + return this.pathTemplates.projectCompanyPathTemplate.render({ + project: project, + company: company, + }); + } + + /** + * Parse the project from ProjectCompany resource. + * + * @param {string} projectCompanyName + * A fully-qualified path representing project_company resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCompanyName(projectCompanyName: string) { + return this.pathTemplates.projectCompanyPathTemplate.match( + projectCompanyName + ).project; + } + + /** + * Parse the company from ProjectCompany resource. + * + * @param {string} projectCompanyName + * A fully-qualified path representing project_company resource. + * @returns {string} A string representing the company. + */ + matchCompanyFromProjectCompanyName(projectCompanyName: string) { + return this.pathTemplates.projectCompanyPathTemplate.match( + projectCompanyName + ).company; + } + + /** + * Return a fully-qualified projectJob resource name string. + * + * @param {string} project + * @param {string} job + * @returns {string} Resource name string. + */ + projectJobPath(project: string, job: string) { + return this.pathTemplates.projectJobPathTemplate.render({ + project: project, + job: job, + }); + } + + /** + * Parse the project from ProjectJob resource. + * + * @param {string} projectJobName + * A fully-qualified path representing project_job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectJobName(projectJobName: string) { + return this.pathTemplates.projectJobPathTemplate.match(projectJobName) + .project; + } + + /** + * Parse the job from ProjectJob resource. + * + * @param {string} projectJobName + * A fully-qualified path representing project_job resource. + * @returns {string} A string representing the job. + */ + matchJobFromProjectJobName(projectJobName: string) { + return this.pathTemplates.projectJobPathTemplate.match(projectJobName).job; + } + + /** + * Return a fully-qualified projectTenantCompany resource name string. + * + * @param {string} project + * @param {string} tenant + * @param {string} company + * @returns {string} Resource name string. + */ + projectTenantCompanyPath(project: string, tenant: string, company: string) { + return this.pathTemplates.projectTenantCompanyPathTemplate.render({ + project: project, + tenant: tenant, + company: company, + }); + } + + /** + * Parse the project from ProjectTenantCompany resource. + * + * @param {string} projectTenantCompanyName + * A fully-qualified path representing project_tenant_company resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTenantCompanyName(projectTenantCompanyName: string) { + return this.pathTemplates.projectTenantCompanyPathTemplate.match( + projectTenantCompanyName + ).project; + } + + /** + * Parse the tenant from ProjectTenantCompany resource. + * + * @param {string} projectTenantCompanyName + * A fully-qualified path representing project_tenant_company resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromProjectTenantCompanyName(projectTenantCompanyName: string) { + return this.pathTemplates.projectTenantCompanyPathTemplate.match( + projectTenantCompanyName + ).tenant; + } + + /** + * Parse the company from ProjectTenantCompany resource. + * + * @param {string} projectTenantCompanyName + * A fully-qualified path representing project_tenant_company resource. + * @returns {string} A string representing the company. + */ + matchCompanyFromProjectTenantCompanyName(projectTenantCompanyName: string) { + return this.pathTemplates.projectTenantCompanyPathTemplate.match( + projectTenantCompanyName + ).company; + } + + /** + * Return a fully-qualified projectTenantJob resource name string. + * + * @param {string} project + * @param {string} tenant + * @param {string} job + * @returns {string} Resource name string. + */ + projectTenantJobPath(project: string, tenant: string, job: string) { + return this.pathTemplates.projectTenantJobPathTemplate.render({ + project: project, + tenant: tenant, + job: job, + }); + } + + /** + * Parse the project from ProjectTenantJob resource. + * + * @param {string} projectTenantJobName + * A fully-qualified path representing project_tenant_job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTenantJobName(projectTenantJobName: string) { + return this.pathTemplates.projectTenantJobPathTemplate.match( + projectTenantJobName + ).project; + } + + /** + * Parse the tenant from ProjectTenantJob resource. + * + * @param {string} projectTenantJobName + * A fully-qualified path representing project_tenant_job resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromProjectTenantJobName(projectTenantJobName: string) { + return this.pathTemplates.projectTenantJobPathTemplate.match( + projectTenantJobName + ).tenant; + } + + /** + * Parse the job from ProjectTenantJob resource. + * + * @param {string} projectTenantJobName + * A fully-qualified path representing project_tenant_job resource. + * @returns {string} A string representing the job. + */ + matchJobFromProjectTenantJobName(projectTenantJobName: string) { + return this.pathTemplates.projectTenantJobPathTemplate.match( + projectTenantJobName + ).job; + } + + /** + * Return a fully-qualified tenant resource name string. + * + * @param {string} project + * @param {string} tenant + * @returns {string} Resource name string. + */ + tenantPath(project: string, tenant: string) { + return this.pathTemplates.tenantPathTemplate.render({ + project: project, + tenant: tenant, + }); + } + + /** + * Parse the project from Tenant resource. + * + * @param {string} tenantName + * A fully-qualified path representing Tenant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTenantName(tenantName: string) { + return this.pathTemplates.tenantPathTemplate.match(tenantName).project; + } + + /** + * Parse the tenant from Tenant resource. + * + * @param {string} tenantName + * A fully-qualified path representing Tenant resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromTenantName(tenantName: string) { + return this.pathTemplates.tenantPathTemplate.match(tenantName).tenant; + } + + /** + * 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.completionStub && !this._terminated) { + return this.completionStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-talent/src/v4beta1/completion_client_config.json b/packages/google-cloud-talent/src/v4beta1/completion_client_config.json new file mode 100644 index 00000000000..cf9b1572b1e --- /dev/null +++ b/packages/google-cloud-talent/src/v4beta1/completion_client_config.json @@ -0,0 +1,31 @@ +{ + "interfaces": { + "google.cloud.talent.v4beta1.Completion": { + "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": { + "CompleteQuery": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-talent/src/v4beta1/completion_proto_list.json b/packages/google-cloud-talent/src/v4beta1/completion_proto_list.json new file mode 100644 index 00000000000..e44f49ea525 --- /dev/null +++ b/packages/google-cloud-talent/src/v4beta1/completion_proto_list.json @@ -0,0 +1,15 @@ +[ + "../../protos/google/cloud/talent/v4beta1/batch.proto", + "../../protos/google/cloud/talent/v4beta1/common.proto", + "../../protos/google/cloud/talent/v4beta1/company.proto", + "../../protos/google/cloud/talent/v4beta1/company_service.proto", + "../../protos/google/cloud/talent/v4beta1/completion_service.proto", + "../../protos/google/cloud/talent/v4beta1/event.proto", + "../../protos/google/cloud/talent/v4beta1/event_service.proto", + "../../protos/google/cloud/talent/v4beta1/filters.proto", + "../../protos/google/cloud/talent/v4beta1/histogram.proto", + "../../protos/google/cloud/talent/v4beta1/job.proto", + "../../protos/google/cloud/talent/v4beta1/job_service.proto", + "../../protos/google/cloud/talent/v4beta1/tenant.proto", + "../../protos/google/cloud/talent/v4beta1/tenant_service.proto" +] diff --git a/packages/google-cloud-talent/src/v4beta1/event_service_client.ts b/packages/google-cloud-talent/src/v4beta1/event_service_client.ts new file mode 100644 index 00000000000..82d0f56ee75 --- /dev/null +++ b/packages/google-cloud-talent/src/v4beta1/event_service_client.ts @@ -0,0 +1,701 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v4beta1/event_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './event_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service handles client event report. + * @class + * @memberof v4beta1 + */ +export class EventServiceClient { + 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}; + eventServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of EventServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new EventServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof EventServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectCompanyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/companies/{company}' + ), + projectJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/jobs/{job}' + ), + projectTenantCompanyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}/companies/{company}' + ), + projectTenantJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}/jobs/{job}' + ), + tenantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.talent.v4beta1.EventService', + 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.eventServiceStub) { + return this.eventServiceStub; + } + + // Put together the "service stub" for + // google.cloud.talent.v4beta1.EventService. + this.eventServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.talent.v4beta1.EventService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.talent.v4beta1.EventService, + 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 eventServiceStubMethods = ['createClientEvent']; + for (const methodName of eventServiceStubMethods) { + const callPromise = this.eventServiceStub.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 = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.eventServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'jobs.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 'jobs.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', + 'https://www.googleapis.com/auth/jobs', + ]; + } + + 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 -- + // ------------------- + /** + * Report events issued when end user interacts with customer's application + * that uses Cloud Talent Solution. You may inspect the created events in + * [self service + * tools](https://console.cloud.google.com/talent-solution/overview). + * [Learn + * more](https://cloud.google.com/talent-solution/docs/management-tools) + * about self service tools. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the tenant under which the event is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + * is created, for example, "projects/foo". + * @param {google.cloud.talent.v4beta1.ClientEvent} request.clientEvent + * Required. Events issued when end user interacts with customer's application that + * uses Cloud Talent Solution. + * @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 [ClientEvent]{@link google.cloud.talent.v4beta1.ClientEvent}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4beta1/event_service.create_client_event.js + * region_tag:jobs_v4beta1_generated_EventService_CreateClientEvent_async + */ + createClientEvent( + request?: protos.google.cloud.talent.v4beta1.ICreateClientEventRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4beta1.IClientEvent, + protos.google.cloud.talent.v4beta1.ICreateClientEventRequest | undefined, + {} | undefined + ] + >; + createClientEvent( + request: protos.google.cloud.talent.v4beta1.ICreateClientEventRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4beta1.IClientEvent, + | protos.google.cloud.talent.v4beta1.ICreateClientEventRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createClientEvent( + request: protos.google.cloud.talent.v4beta1.ICreateClientEventRequest, + callback: Callback< + protos.google.cloud.talent.v4beta1.IClientEvent, + | protos.google.cloud.talent.v4beta1.ICreateClientEventRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createClientEvent( + request?: protos.google.cloud.talent.v4beta1.ICreateClientEventRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4beta1.IClientEvent, + | protos.google.cloud.talent.v4beta1.ICreateClientEventRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4beta1.IClientEvent, + | protos.google.cloud.talent.v4beta1.ICreateClientEventRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4beta1.IClientEvent, + protos.google.cloud.talent.v4beta1.ICreateClientEventRequest | 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.createClientEvent(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectCompany resource name string. + * + * @param {string} project + * @param {string} company + * @returns {string} Resource name string. + */ + projectCompanyPath(project: string, company: string) { + return this.pathTemplates.projectCompanyPathTemplate.render({ + project: project, + company: company, + }); + } + + /** + * Parse the project from ProjectCompany resource. + * + * @param {string} projectCompanyName + * A fully-qualified path representing project_company resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCompanyName(projectCompanyName: string) { + return this.pathTemplates.projectCompanyPathTemplate.match( + projectCompanyName + ).project; + } + + /** + * Parse the company from ProjectCompany resource. + * + * @param {string} projectCompanyName + * A fully-qualified path representing project_company resource. + * @returns {string} A string representing the company. + */ + matchCompanyFromProjectCompanyName(projectCompanyName: string) { + return this.pathTemplates.projectCompanyPathTemplate.match( + projectCompanyName + ).company; + } + + /** + * Return a fully-qualified projectJob resource name string. + * + * @param {string} project + * @param {string} job + * @returns {string} Resource name string. + */ + projectJobPath(project: string, job: string) { + return this.pathTemplates.projectJobPathTemplate.render({ + project: project, + job: job, + }); + } + + /** + * Parse the project from ProjectJob resource. + * + * @param {string} projectJobName + * A fully-qualified path representing project_job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectJobName(projectJobName: string) { + return this.pathTemplates.projectJobPathTemplate.match(projectJobName) + .project; + } + + /** + * Parse the job from ProjectJob resource. + * + * @param {string} projectJobName + * A fully-qualified path representing project_job resource. + * @returns {string} A string representing the job. + */ + matchJobFromProjectJobName(projectJobName: string) { + return this.pathTemplates.projectJobPathTemplate.match(projectJobName).job; + } + + /** + * Return a fully-qualified projectTenantCompany resource name string. + * + * @param {string} project + * @param {string} tenant + * @param {string} company + * @returns {string} Resource name string. + */ + projectTenantCompanyPath(project: string, tenant: string, company: string) { + return this.pathTemplates.projectTenantCompanyPathTemplate.render({ + project: project, + tenant: tenant, + company: company, + }); + } + + /** + * Parse the project from ProjectTenantCompany resource. + * + * @param {string} projectTenantCompanyName + * A fully-qualified path representing project_tenant_company resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTenantCompanyName(projectTenantCompanyName: string) { + return this.pathTemplates.projectTenantCompanyPathTemplate.match( + projectTenantCompanyName + ).project; + } + + /** + * Parse the tenant from ProjectTenantCompany resource. + * + * @param {string} projectTenantCompanyName + * A fully-qualified path representing project_tenant_company resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromProjectTenantCompanyName(projectTenantCompanyName: string) { + return this.pathTemplates.projectTenantCompanyPathTemplate.match( + projectTenantCompanyName + ).tenant; + } + + /** + * Parse the company from ProjectTenantCompany resource. + * + * @param {string} projectTenantCompanyName + * A fully-qualified path representing project_tenant_company resource. + * @returns {string} A string representing the company. + */ + matchCompanyFromProjectTenantCompanyName(projectTenantCompanyName: string) { + return this.pathTemplates.projectTenantCompanyPathTemplate.match( + projectTenantCompanyName + ).company; + } + + /** + * Return a fully-qualified projectTenantJob resource name string. + * + * @param {string} project + * @param {string} tenant + * @param {string} job + * @returns {string} Resource name string. + */ + projectTenantJobPath(project: string, tenant: string, job: string) { + return this.pathTemplates.projectTenantJobPathTemplate.render({ + project: project, + tenant: tenant, + job: job, + }); + } + + /** + * Parse the project from ProjectTenantJob resource. + * + * @param {string} projectTenantJobName + * A fully-qualified path representing project_tenant_job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTenantJobName(projectTenantJobName: string) { + return this.pathTemplates.projectTenantJobPathTemplate.match( + projectTenantJobName + ).project; + } + + /** + * Parse the tenant from ProjectTenantJob resource. + * + * @param {string} projectTenantJobName + * A fully-qualified path representing project_tenant_job resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromProjectTenantJobName(projectTenantJobName: string) { + return this.pathTemplates.projectTenantJobPathTemplate.match( + projectTenantJobName + ).tenant; + } + + /** + * Parse the job from ProjectTenantJob resource. + * + * @param {string} projectTenantJobName + * A fully-qualified path representing project_tenant_job resource. + * @returns {string} A string representing the job. + */ + matchJobFromProjectTenantJobName(projectTenantJobName: string) { + return this.pathTemplates.projectTenantJobPathTemplate.match( + projectTenantJobName + ).job; + } + + /** + * Return a fully-qualified tenant resource name string. + * + * @param {string} project + * @param {string} tenant + * @returns {string} Resource name string. + */ + tenantPath(project: string, tenant: string) { + return this.pathTemplates.tenantPathTemplate.render({ + project: project, + tenant: tenant, + }); + } + + /** + * Parse the project from Tenant resource. + * + * @param {string} tenantName + * A fully-qualified path representing Tenant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTenantName(tenantName: string) { + return this.pathTemplates.tenantPathTemplate.match(tenantName).project; + } + + /** + * Parse the tenant from Tenant resource. + * + * @param {string} tenantName + * A fully-qualified path representing Tenant resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromTenantName(tenantName: string) { + return this.pathTemplates.tenantPathTemplate.match(tenantName).tenant; + } + + /** + * 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.eventServiceStub && !this._terminated) { + return this.eventServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-talent/src/v4beta1/event_service_client_config.json b/packages/google-cloud-talent/src/v4beta1/event_service_client_config.json new file mode 100644 index 00000000000..ab178899b9f --- /dev/null +++ b/packages/google-cloud-talent/src/v4beta1/event_service_client_config.json @@ -0,0 +1,31 @@ +{ + "interfaces": { + "google.cloud.talent.v4beta1.EventService": { + "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": { + "CreateClientEvent": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-talent/src/v4beta1/event_service_proto_list.json b/packages/google-cloud-talent/src/v4beta1/event_service_proto_list.json new file mode 100644 index 00000000000..e44f49ea525 --- /dev/null +++ b/packages/google-cloud-talent/src/v4beta1/event_service_proto_list.json @@ -0,0 +1,15 @@ +[ + "../../protos/google/cloud/talent/v4beta1/batch.proto", + "../../protos/google/cloud/talent/v4beta1/common.proto", + "../../protos/google/cloud/talent/v4beta1/company.proto", + "../../protos/google/cloud/talent/v4beta1/company_service.proto", + "../../protos/google/cloud/talent/v4beta1/completion_service.proto", + "../../protos/google/cloud/talent/v4beta1/event.proto", + "../../protos/google/cloud/talent/v4beta1/event_service.proto", + "../../protos/google/cloud/talent/v4beta1/filters.proto", + "../../protos/google/cloud/talent/v4beta1/histogram.proto", + "../../protos/google/cloud/talent/v4beta1/job.proto", + "../../protos/google/cloud/talent/v4beta1/job_service.proto", + "../../protos/google/cloud/talent/v4beta1/tenant.proto", + "../../protos/google/cloud/talent/v4beta1/tenant_service.proto" +] diff --git a/packages/google-cloud-talent/src/v4beta1/gapic_metadata.json b/packages/google-cloud-talent/src/v4beta1/gapic_metadata.json new file mode 100644 index 00000000000..0c0e3570439 --- /dev/null +++ b/packages/google-cloud-talent/src/v4beta1/gapic_metadata.json @@ -0,0 +1,311 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.talent.v4beta1", + "libraryPackage": "@google-cloud/talent", + "services": { + "CompanyService": { + "clients": { + "grpc": { + "libraryClient": "CompanyServiceClient", + "rpcs": { + "CreateCompany": { + "methods": [ + "createCompany" + ] + }, + "GetCompany": { + "methods": [ + "getCompany" + ] + }, + "UpdateCompany": { + "methods": [ + "updateCompany" + ] + }, + "DeleteCompany": { + "methods": [ + "deleteCompany" + ] + }, + "ListCompanies": { + "methods": [ + "listCompanies", + "listCompaniesStream", + "listCompaniesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CompanyServiceClient", + "rpcs": { + "CreateCompany": { + "methods": [ + "createCompany" + ] + }, + "GetCompany": { + "methods": [ + "getCompany" + ] + }, + "UpdateCompany": { + "methods": [ + "updateCompany" + ] + }, + "DeleteCompany": { + "methods": [ + "deleteCompany" + ] + }, + "ListCompanies": { + "methods": [ + "listCompanies", + "listCompaniesStream", + "listCompaniesAsync" + ] + } + } + } + } + }, + "Completion": { + "clients": { + "grpc": { + "libraryClient": "CompletionClient", + "rpcs": { + "CompleteQuery": { + "methods": [ + "completeQuery" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CompletionClient", + "rpcs": { + "CompleteQuery": { + "methods": [ + "completeQuery" + ] + } + } + } + } + }, + "EventService": { + "clients": { + "grpc": { + "libraryClient": "EventServiceClient", + "rpcs": { + "CreateClientEvent": { + "methods": [ + "createClientEvent" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "EventServiceClient", + "rpcs": { + "CreateClientEvent": { + "methods": [ + "createClientEvent" + ] + } + } + } + } + }, + "JobService": { + "clients": { + "grpc": { + "libraryClient": "JobServiceClient", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "UpdateJob": { + "methods": [ + "updateJob" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "BatchDeleteJobs": { + "methods": [ + "batchDeleteJobs" + ] + }, + "SearchJobs": { + "methods": [ + "searchJobs" + ] + }, + "SearchJobsForAlert": { + "methods": [ + "searchJobsForAlert" + ] + }, + "BatchCreateJobs": { + "methods": [ + "batchCreateJobs" + ] + }, + "BatchUpdateJobs": { + "methods": [ + "batchUpdateJobs" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "JobServiceClient", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "UpdateJob": { + "methods": [ + "updateJob" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "BatchDeleteJobs": { + "methods": [ + "batchDeleteJobs" + ] + }, + "SearchJobs": { + "methods": [ + "searchJobs" + ] + }, + "SearchJobsForAlert": { + "methods": [ + "searchJobsForAlert" + ] + }, + "BatchCreateJobs": { + "methods": [ + "batchCreateJobs" + ] + }, + "BatchUpdateJobs": { + "methods": [ + "batchUpdateJobs" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + } + } + } + } + }, + "TenantService": { + "clients": { + "grpc": { + "libraryClient": "TenantServiceClient", + "rpcs": { + "CreateTenant": { + "methods": [ + "createTenant" + ] + }, + "GetTenant": { + "methods": [ + "getTenant" + ] + }, + "UpdateTenant": { + "methods": [ + "updateTenant" + ] + }, + "DeleteTenant": { + "methods": [ + "deleteTenant" + ] + }, + "ListTenants": { + "methods": [ + "listTenants", + "listTenantsStream", + "listTenantsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TenantServiceClient", + "rpcs": { + "CreateTenant": { + "methods": [ + "createTenant" + ] + }, + "GetTenant": { + "methods": [ + "getTenant" + ] + }, + "UpdateTenant": { + "methods": [ + "updateTenant" + ] + }, + "DeleteTenant": { + "methods": [ + "deleteTenant" + ] + }, + "ListTenants": { + "methods": [ + "listTenants", + "listTenantsStream", + "listTenantsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-talent/src/v4beta1/index.ts b/packages/google-cloud-talent/src/v4beta1/index.ts new file mode 100644 index 00000000000..ae43ee2aedb --- /dev/null +++ b/packages/google-cloud-talent/src/v4beta1/index.ts @@ -0,0 +1,23 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {CompanyServiceClient} from './company_service_client'; +export {CompletionClient} from './completion_client'; +export {EventServiceClient} from './event_service_client'; +export {JobServiceClient} from './job_service_client'; +export {TenantServiceClient} from './tenant_service_client'; diff --git a/packages/google-cloud-talent/src/v4beta1/job_service_client.ts b/packages/google-cloud-talent/src/v4beta1/job_service_client.ts new file mode 100644 index 00000000000..0e59269730b --- /dev/null +++ b/packages/google-cloud-talent/src/v4beta1/job_service_client.ts @@ -0,0 +1,2590 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v4beta1/job_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './job_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service handles job management, including job CRUD, enumeration and search. + * @class + * @memberof v4beta1 + */ +export class JobServiceClient { + 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; + jobServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of JobServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new JobServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof JobServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectCompanyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/companies/{company}' + ), + projectJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/jobs/{job}' + ), + projectTenantCompanyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}/companies/{company}' + ), + projectTenantJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}/jobs/{job}' + ), + tenantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listJobs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'jobs' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v4beta1/{name=projects/*/operations/*}', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const batchCreateJobsResponse = protoFilesRoot.lookup( + '.google.cloud.talent.v4beta1.JobOperationResult' + ) as gax.protobuf.Type; + const batchCreateJobsMetadata = protoFilesRoot.lookup( + '.google.cloud.talent.v4beta1.BatchOperationMetadata' + ) as gax.protobuf.Type; + const batchUpdateJobsResponse = protoFilesRoot.lookup( + '.google.cloud.talent.v4beta1.JobOperationResult' + ) as gax.protobuf.Type; + const batchUpdateJobsMetadata = protoFilesRoot.lookup( + '.google.cloud.talent.v4beta1.BatchOperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + batchCreateJobs: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchCreateJobsResponse.decode.bind(batchCreateJobsResponse), + batchCreateJobsMetadata.decode.bind(batchCreateJobsMetadata) + ), + batchUpdateJobs: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchUpdateJobsResponse.decode.bind(batchUpdateJobsResponse), + batchUpdateJobsMetadata.decode.bind(batchUpdateJobsMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.talent.v4beta1.JobService', + 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.jobServiceStub) { + return this.jobServiceStub; + } + + // Put together the "service stub" for + // google.cloud.talent.v4beta1.JobService. + this.jobServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.talent.v4beta1.JobService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.talent.v4beta1.JobService, + 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 jobServiceStubMethods = [ + 'createJob', + 'batchCreateJobs', + 'getJob', + 'updateJob', + 'batchUpdateJobs', + 'deleteJob', + 'batchDeleteJobs', + 'listJobs', + 'searchJobs', + 'searchJobsForAlert', + ]; + for (const methodName of jobServiceStubMethods) { + const callPromise = this.jobServiceStub.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.jobServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'jobs.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 'jobs.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', + 'https://www.googleapis.com/auth/jobs', + ]; + } + + 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 new job. + * + * Typically, the job becomes searchable within 10 seconds, but it may take + * up to 5 minutes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the tenant under which the job is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenant/bar". If tenant id is unspecified a default tenant + * is created. For example, "projects/foo". + * @param {google.cloud.talent.v4beta1.Job} request.job + * Required. The Job to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Job]{@link google.cloud.talent.v4beta1.Job}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4beta1/job_service.create_job.js + * region_tag:jobs_v4beta1_generated_JobService_CreateJob_async + */ + createJob( + request?: protos.google.cloud.talent.v4beta1.ICreateJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4beta1.IJob, + protos.google.cloud.talent.v4beta1.ICreateJobRequest | undefined, + {} | undefined + ] + >; + createJob( + request: protos.google.cloud.talent.v4beta1.ICreateJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4beta1.IJob, + protos.google.cloud.talent.v4beta1.ICreateJobRequest | null | undefined, + {} | null | undefined + > + ): void; + createJob( + request: protos.google.cloud.talent.v4beta1.ICreateJobRequest, + callback: Callback< + protos.google.cloud.talent.v4beta1.IJob, + protos.google.cloud.talent.v4beta1.ICreateJobRequest | null | undefined, + {} | null | undefined + > + ): void; + createJob( + request?: protos.google.cloud.talent.v4beta1.ICreateJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4beta1.IJob, + | protos.google.cloud.talent.v4beta1.ICreateJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4beta1.IJob, + protos.google.cloud.talent.v4beta1.ICreateJobRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4beta1.IJob, + protos.google.cloud.talent.v4beta1.ICreateJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createJob(request, options, callback); + } + /** + * Retrieves the specified job, whose status is OPEN or recently EXPIRED + * within the last 90 days. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the job to retrieve. + * + * The format is + * "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For + * example, "projects/foo/tenants/bar/jobs/baz". + * + * If tenant id is unspecified, the default tenant is used. For + * example, "projects/foo/jobs/bar". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Job]{@link google.cloud.talent.v4beta1.Job}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4beta1/job_service.get_job.js + * region_tag:jobs_v4beta1_generated_JobService_GetJob_async + */ + getJob( + request?: protos.google.cloud.talent.v4beta1.IGetJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4beta1.IJob, + protos.google.cloud.talent.v4beta1.IGetJobRequest | undefined, + {} | undefined + ] + >; + getJob( + request: protos.google.cloud.talent.v4beta1.IGetJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4beta1.IJob, + protos.google.cloud.talent.v4beta1.IGetJobRequest | null | undefined, + {} | null | undefined + > + ): void; + getJob( + request: protos.google.cloud.talent.v4beta1.IGetJobRequest, + callback: Callback< + protos.google.cloud.talent.v4beta1.IJob, + protos.google.cloud.talent.v4beta1.IGetJobRequest | null | undefined, + {} | null | undefined + > + ): void; + getJob( + request?: protos.google.cloud.talent.v4beta1.IGetJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4beta1.IJob, + protos.google.cloud.talent.v4beta1.IGetJobRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4beta1.IJob, + protos.google.cloud.talent.v4beta1.IGetJobRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4beta1.IJob, + protos.google.cloud.talent.v4beta1.IGetJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getJob(request, options, callback); + } + /** + * Updates specified job. + * + * Typically, updated contents become visible in search results within 10 + * seconds, but it may take up to 5 minutes. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.talent.v4beta1.Job} request.job + * Required. The Job to be updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Strongly recommended for the best service experience. + * + * If {@link google.cloud.talent.v4beta1.UpdateJobRequest.update_mask|update_mask} is provided, only the specified fields in + * {@link google.cloud.talent.v4beta1.UpdateJobRequest.job|job} are updated. Otherwise all the fields are updated. + * + * A field mask to restrict the fields that are updated. Only + * top level fields of {@link google.cloud.talent.v4beta1.Job|Job} are supported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Job]{@link google.cloud.talent.v4beta1.Job}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4beta1/job_service.update_job.js + * region_tag:jobs_v4beta1_generated_JobService_UpdateJob_async + */ + updateJob( + request?: protos.google.cloud.talent.v4beta1.IUpdateJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4beta1.IJob, + protos.google.cloud.talent.v4beta1.IUpdateJobRequest | undefined, + {} | undefined + ] + >; + updateJob( + request: protos.google.cloud.talent.v4beta1.IUpdateJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4beta1.IJob, + protos.google.cloud.talent.v4beta1.IUpdateJobRequest | null | undefined, + {} | null | undefined + > + ): void; + updateJob( + request: protos.google.cloud.talent.v4beta1.IUpdateJobRequest, + callback: Callback< + protos.google.cloud.talent.v4beta1.IJob, + protos.google.cloud.talent.v4beta1.IUpdateJobRequest | null | undefined, + {} | null | undefined + > + ): void; + updateJob( + request?: protos.google.cloud.talent.v4beta1.IUpdateJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4beta1.IJob, + | protos.google.cloud.talent.v4beta1.IUpdateJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4beta1.IJob, + protos.google.cloud.talent.v4beta1.IUpdateJobRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4beta1.IJob, + protos.google.cloud.talent.v4beta1.IUpdateJobRequest | 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({ + 'job.name': request.job!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateJob(request, options, callback); + } + /** + * Deletes the specified job. + * + * Typically, the job becomes unsearchable within 10 seconds, but it may take + * up to 5 minutes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the job to be deleted. + * + * The format is + * "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For + * example, "projects/foo/tenants/bar/jobs/baz". + * + * If tenant id is unspecified, the default tenant is used. For + * example, "projects/foo/jobs/bar". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4beta1/job_service.delete_job.js + * region_tag:jobs_v4beta1_generated_JobService_DeleteJob_async + */ + deleteJob( + request?: protos.google.cloud.talent.v4beta1.IDeleteJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4beta1.IDeleteJobRequest | undefined, + {} | undefined + ] + >; + deleteJob( + request: protos.google.cloud.talent.v4beta1.IDeleteJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4beta1.IDeleteJobRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteJob( + request: protos.google.cloud.talent.v4beta1.IDeleteJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4beta1.IDeleteJobRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteJob( + request?: protos.google.cloud.talent.v4beta1.IDeleteJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.talent.v4beta1.IDeleteJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4beta1.IDeleteJobRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4beta1.IDeleteJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteJob(request, options, callback); + } + /** + * Deletes a list of {@link google.cloud.talent.v4beta1.Job|Job}s by filter. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the tenant under which the job is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + * is created. For example, "projects/foo". + * @param {string} request.filter + * Required. The filter string specifies the jobs to be deleted. + * + * Supported operator: =, AND + * + * The fields eligible for filtering are: + * + * * `companyName` (Required) + * * `requisitionId` (Required) + * + * Sample Query: companyName = "projects/foo/companies/bar" AND + * requisitionId = "req-1" + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4beta1/job_service.batch_delete_jobs.js + * region_tag:jobs_v4beta1_generated_JobService_BatchDeleteJobs_async + */ + batchDeleteJobs( + request?: protos.google.cloud.talent.v4beta1.IBatchDeleteJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4beta1.IBatchDeleteJobsRequest | undefined, + {} | undefined + ] + >; + batchDeleteJobs( + request: protos.google.cloud.talent.v4beta1.IBatchDeleteJobsRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.talent.v4beta1.IBatchDeleteJobsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchDeleteJobs( + request: protos.google.cloud.talent.v4beta1.IBatchDeleteJobsRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.talent.v4beta1.IBatchDeleteJobsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchDeleteJobs( + request?: protos.google.cloud.talent.v4beta1.IBatchDeleteJobsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.talent.v4beta1.IBatchDeleteJobsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.talent.v4beta1.IBatchDeleteJobsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4beta1.IBatchDeleteJobsRequest | 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.batchDeleteJobs(request, options, callback); + } + /** + * Searches for jobs using the provided {@link google.cloud.talent.v4beta1.SearchJobsRequest|SearchJobsRequest}. + * + * This call constrains the {@link google.cloud.talent.v4beta1.Job.visibility|visibility} of jobs + * present in the database, and only returns jobs that the caller has + * permission to search against. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the tenant to search within. + * + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + * is created. For example, "projects/foo". + * @param {google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode} request.searchMode + * Mode of a search. + * + * Defaults to {@link google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode.JOB_SEARCH|SearchMode.JOB_SEARCH}. + * @param {google.cloud.talent.v4beta1.RequestMetadata} request.requestMetadata + * Required. The meta information collected about the job searcher, used to improve the + * search quality of the service. The identifiers (such as `user_id`) are + * provided by users, and must be unique and consistent. + * @param {google.cloud.talent.v4beta1.JobQuery} request.jobQuery + * Query used to search against jobs, such as keyword, location filters, etc. + * @param {boolean} request.enableBroadening + * Controls whether to broaden the search when it produces sparse results. + * Broadened queries append results to the end of the matching results + * list. + * + * Defaults to false. + * @param {boolean} request.requirePreciseResultSize + * This field is deprecated. + * @param {number[]} request.histogramQueries + * An expression specifies a histogram request against matching jobs. + * + * Expression syntax is an aggregation function call with histogram facets and + * other options. + * + * Available aggregation function calls are: + * * `count(string_histogram_facet)`: Count the number of matching entities, + * for each distinct attribute value. + * * `count(numeric_histogram_facet, list of buckets)`: Count the number of + * matching entities within each bucket. + * + * A maximum of 200 histogram buckets are supported. + * + * Data types: + * + * * Histogram facet: facet names with format `{@link a-zA-Z0-9_|a-zA-Z}+`. + * * String: string like "any string with backslash escape for quote(\")." + * * Number: whole number and floating point number like 10, -1 and -0.01. + * * List: list of elements with comma(,) separator surrounded by square + * brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + * + * Built-in constants: + * + * * MIN (minimum number similar to java Double.MIN_VALUE) + * * MAX (maximum number similar to java Double.MAX_VALUE) + * + * Built-in functions: + * + * * bucket(start, end[, label]): bucket built-in function creates a bucket + * with range of [start, end). Note that the end is exclusive, for example, + * bucket(1, MAX, "positive number") or bucket(1, 10). + * + * Job histogram facets: + * + * * company_display_name: histogram by {@link google.cloud.talent.v4beta1.Job.company_display_name|Job.company_display_name}. + * * employment_type: histogram by {@link google.cloud.talent.v4beta1.Job.employment_types|Job.employment_types}, for example, + * "FULL_TIME", "PART_TIME". + * * company_size (DEPRECATED): histogram by {@link google.cloud.talent.v4beta1.CompanySize|CompanySize}, for example, + * "SMALL", "MEDIUM", "BIG". + * * publish_time_in_day: histogram by the {@link google.cloud.talent.v4beta1.Job.posting_publish_time|Job.posting_publish_time} + * in days. + * Must specify list of numeric buckets in spec. + * * publish_time_in_month: histogram by the {@link google.cloud.talent.v4beta1.Job.posting_publish_time|Job.posting_publish_time} + * in months. + * Must specify list of numeric buckets in spec. + * * publish_time_in_year: histogram by the {@link google.cloud.talent.v4beta1.Job.posting_publish_time|Job.posting_publish_time} + * in years. + * Must specify list of numeric buckets in spec. + * * degree_types: histogram by the {@link google.cloud.talent.v4beta1.Job.degree_types|Job.degree_types}, for example, + * "Bachelors", "Masters". + * * job_level: histogram by the {@link google.cloud.talent.v4beta1.Job.job_level|Job.job_level}, for example, "Entry + * Level". + * * country: histogram by the country code of jobs, for example, "US", "FR". + * * admin1: histogram by the admin1 code of jobs, which is a global + * placeholder referring to the state, province, or the particular term a + * country uses to define the geographic structure below the country level, + * for example, "CA", "IL". + * * city: histogram by a combination of the "city name, admin1 code". For + * example, "Mountain View, CA", "New York, NY". + * * admin1_country: histogram by a combination of the "admin1 code, country", + * for example, "CA, US", "IL, US". + * * city_coordinate: histogram by the city center's GPS coordinates (latitude + * and longitude), for example, 37.4038522,-122.0987765. Since the + * coordinates of a city center can change, customers may need to refresh + * them periodically. + * * locale: histogram by the {@link google.cloud.talent.v4beta1.Job.language_code|Job.language_code}, for example, "en-US", + * "fr-FR". + * * language: histogram by the language subtag of the {@link google.cloud.talent.v4beta1.Job.language_code|Job.language_code}, + * for example, "en", "fr". + * * category: histogram by the {@link google.cloud.talent.v4beta1.JobCategory|JobCategory}, for example, + * "COMPUTER_AND_IT", "HEALTHCARE". + * * base_compensation_unit: histogram by the + * {@link google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit|CompensationInfo.CompensationUnit} of base + * salary, for example, "WEEKLY", "MONTHLY". + * * base_compensation: histogram by the base salary. Must specify list of + * numeric buckets to group results by. + * * annualized_base_compensation: histogram by the base annualized salary. + * Must specify list of numeric buckets to group results by. + * * annualized_total_compensation: histogram by the total annualized salary. + * Must specify list of numeric buckets to group results by. + * * string_custom_attribute: histogram by string {@link google.cloud.talent.v4beta1.Job.custom_attributes|Job.custom_attributes}. + * Values can be accessed via square bracket notations like + * string_custom_attribute["key1"]. + * * numeric_custom_attribute: histogram by numeric {@link google.cloud.talent.v4beta1.Job.custom_attributes|Job.custom_attributes}. + * Values can be accessed via square bracket notations like + * numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + * group results by. + * + * Example expressions: + * + * * `count(admin1)` + * * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + * bucket(100000, MAX)])` + * * `count(string_custom_attribute["some-string-custom-attribute"])` + * * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + * [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + * @param {google.cloud.talent.v4beta1.JobView} request.jobView + * The desired job attributes returned for jobs in the search response. + * Defaults to {@link google.cloud.talent.v4beta1.JobView.JOB_VIEW_SMALL|JobView.JOB_VIEW_SMALL} if no value is specified. + * @param {number} request.offset + * An integer that specifies the current offset (that is, starting result + * location, amongst the jobs deemed by the API as relevant) in search + * results. This field is only considered if {@link google.cloud.talent.v4beta1.SearchJobsRequest.page_token|page_token} is unset. + * + * The maximum allowed value is 5000. Otherwise an error is thrown. + * + * For example, 0 means to return results starting from the first matching + * job, and 10 means to return from the 11th job. This can be used for + * pagination, (for example, pageSize = 10 and offset = 10 means to return + * from the second page). + * @param {number} request.pageSize + * A limit on the number of jobs returned in the search results. + * Increasing this value above the default value of 10 can increase search + * response time. The value can be between 1 and 100. + * @param {string} request.pageToken + * The token specifying the current offset within + * search results. See {@link google.cloud.talent.v4beta1.SearchJobsResponse.next_page_token|SearchJobsResponse.next_page_token} for + * an explanation of how to obtain the next set of query results. + * @param {string} request.orderBy + * The criteria determining how search results are sorted. Default is + * `"relevance desc"`. + * + * Supported options are: + * + * * `"relevance desc"`: By relevance descending, as determined by the API + * algorithms. Relevance thresholding of query results is only available + * with this ordering. + * * `"posting_publish_time desc"`: By {@link google.cloud.talent.v4beta1.Job.posting_publish_time|Job.posting_publish_time} + * descending. + * * `"posting_update_time desc"`: By {@link google.cloud.talent.v4beta1.Job.posting_update_time|Job.posting_update_time} + * descending. + * * `"title"`: By {@link google.cloud.talent.v4beta1.Job.title|Job.title} ascending. + * * `"title desc"`: By {@link google.cloud.talent.v4beta1.Job.title|Job.title} descending. + * * `"annualized_base_compensation"`: By job's + * {@link google.cloud.talent.v4beta1.CompensationInfo.annualized_base_compensation_range|CompensationInfo.annualized_base_compensation_range} ascending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_base_compensation desc"`: By job's + * {@link google.cloud.talent.v4beta1.CompensationInfo.annualized_base_compensation_range|CompensationInfo.annualized_base_compensation_range} descending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_total_compensation"`: By job's + * {@link google.cloud.talent.v4beta1.CompensationInfo.annualized_total_compensation_range|CompensationInfo.annualized_total_compensation_range} ascending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_total_compensation desc"`: By job's + * {@link google.cloud.talent.v4beta1.CompensationInfo.annualized_total_compensation_range|CompensationInfo.annualized_total_compensation_range} descending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"custom_ranking desc"`: By the relevance score adjusted to the + * {@link google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ranking_expression|SearchJobsRequest.CustomRankingInfo.ranking_expression} with weight + * factor assigned by + * {@link google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.importance_level|SearchJobsRequest.CustomRankingInfo.importance_level} in descending + * order. + * * Location sorting: Use the special syntax to order jobs by distance:
+ * `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ * `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ * `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + * multiple locations. See details below.
+ * `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + * multiple locations. See details below.
+ * The string can have a maximum of 256 characters. When multiple distance + * centers are provided, a job that is close to any of the distance centers + * would have a high rank. When a job has multiple locations, the job + * location closest to one of the distance centers will be used. Jobs that + * don't have locations will be ranked at the bottom. Distance is calculated + * with a precision of 11.3 meters (37.4 feet). Diversification strategy is + * still applied unless explicitly disabled in + * {@link google.cloud.talent.v4beta1.SearchJobsRequest.diversification_level|diversification_level}. + * @param {google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel} request.diversificationLevel + * Controls whether highly similar jobs are returned next to each other in + * the search results. Jobs are identified as highly similar based on + * their titles, job categories, and locations. Highly similar results are + * clustered so that only one representative job of the cluster is + * displayed to the job seeker higher up in the results, with the other jobs + * being displayed lower down in the results. + * + * Defaults to {@link google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel.SIMPLE|DiversificationLevel.SIMPLE} if no value + * is specified. + * @param {google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo} request.customRankingInfo + * Controls over how job documents get ranked on top of existing relevance + * score (determined by API algorithm). + * @param {boolean} request.disableKeywordMatch + * This field is deprecated. Please use + * {@link google.cloud.talent.v4beta1.SearchJobsRequest.keyword_match_mode|SearchJobsRequest.keyword_match_mode} going forward. + * + * To migrate, disable_keyword_match set to false maps to + * {@link google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL|KeywordMatchMode.KEYWORD_MATCH_ALL}, and disable_keyword_match set to + * true maps to {@link google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_DISABLED|KeywordMatchMode.KEYWORD_MATCH_DISABLED}. If + * {@link google.cloud.talent.v4beta1.SearchJobsRequest.keyword_match_mode|SearchJobsRequest.keyword_match_mode} is set, this field is ignored. + * + * Controls whether to disable exact keyword match on {@link google.cloud.talent.v4beta1.Job.title|Job.title}, + * {@link google.cloud.talent.v4beta1.Job.description|Job.description}, {@link google.cloud.talent.v4beta1.Job.company_display_name|Job.company_display_name}, {@link google.cloud.talent.v4beta1.Job.addresses|Job.addresses}, + * {@link google.cloud.talent.v4beta1.Job.qualifications|Job.qualifications}. When disable keyword match is turned off, a + * keyword match returns jobs that do not match given category filters when + * there are matching keywords. For example, for the query "program manager," + * a result is returned even if the job posting has the title "software + * developer," which doesn't fall into "program manager" ontology, but does + * have "program manager" appearing in its description. + * + * For queries like "cloud" that don't contain title or + * location specific ontology, jobs with "cloud" keyword matches are returned + * regardless of this flag's value. + * + * Use {@link google.cloud.talent.v4beta1.Company.keyword_searchable_job_custom_attributes|Company.keyword_searchable_job_custom_attributes} if + * company-specific globally matched custom field/attribute string values are + * needed. Enabling keyword match improves recall of subsequent search + * requests. + * + * Defaults to false. + * @param {google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode} request.keywordMatchMode + * Controls what keyword match options to use. + * + * Defaults to {@link google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL|KeywordMatchMode.KEYWORD_MATCH_ALL} if no value + * is specified. + * @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 [SearchJobsResponse]{@link google.cloud.talent.v4beta1.SearchJobsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4beta1/job_service.search_jobs.js + * region_tag:jobs_v4beta1_generated_JobService_SearchJobs_async + */ + searchJobs( + request?: protos.google.cloud.talent.v4beta1.ISearchJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ISearchJobsResponse, + protos.google.cloud.talent.v4beta1.ISearchJobsRequest | undefined, + {} | undefined + ] + >; + searchJobs( + request: protos.google.cloud.talent.v4beta1.ISearchJobsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4beta1.ISearchJobsResponse, + protos.google.cloud.talent.v4beta1.ISearchJobsRequest | null | undefined, + {} | null | undefined + > + ): void; + searchJobs( + request: protos.google.cloud.talent.v4beta1.ISearchJobsRequest, + callback: Callback< + protos.google.cloud.talent.v4beta1.ISearchJobsResponse, + protos.google.cloud.talent.v4beta1.ISearchJobsRequest | null | undefined, + {} | null | undefined + > + ): void; + searchJobs( + request?: protos.google.cloud.talent.v4beta1.ISearchJobsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4beta1.ISearchJobsResponse, + | protos.google.cloud.talent.v4beta1.ISearchJobsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4beta1.ISearchJobsResponse, + protos.google.cloud.talent.v4beta1.ISearchJobsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ISearchJobsResponse, + protos.google.cloud.talent.v4beta1.ISearchJobsRequest | 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.searchJobs(request, options, callback); + } + /** + * Searches for jobs using the provided {@link google.cloud.talent.v4beta1.SearchJobsRequest|SearchJobsRequest}. + * + * This API call is intended for the use case of targeting passive job + * seekers (for example, job seekers who have signed up to receive email + * alerts about potential job opportunities), and has different algorithmic + * adjustments that are targeted to passive job seekers. + * + * This call constrains the {@link google.cloud.talent.v4beta1.Job.visibility|visibility} of jobs + * present in the database, and only returns jobs the caller has + * permission to search against. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the tenant to search within. + * + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + * is created. For example, "projects/foo". + * @param {google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode} request.searchMode + * Mode of a search. + * + * Defaults to {@link google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode.JOB_SEARCH|SearchMode.JOB_SEARCH}. + * @param {google.cloud.talent.v4beta1.RequestMetadata} request.requestMetadata + * Required. The meta information collected about the job searcher, used to improve the + * search quality of the service. The identifiers (such as `user_id`) are + * provided by users, and must be unique and consistent. + * @param {google.cloud.talent.v4beta1.JobQuery} request.jobQuery + * Query used to search against jobs, such as keyword, location filters, etc. + * @param {boolean} request.enableBroadening + * Controls whether to broaden the search when it produces sparse results. + * Broadened queries append results to the end of the matching results + * list. + * + * Defaults to false. + * @param {boolean} request.requirePreciseResultSize + * This field is deprecated. + * @param {number[]} request.histogramQueries + * An expression specifies a histogram request against matching jobs. + * + * Expression syntax is an aggregation function call with histogram facets and + * other options. + * + * Available aggregation function calls are: + * * `count(string_histogram_facet)`: Count the number of matching entities, + * for each distinct attribute value. + * * `count(numeric_histogram_facet, list of buckets)`: Count the number of + * matching entities within each bucket. + * + * A maximum of 200 histogram buckets are supported. + * + * Data types: + * + * * Histogram facet: facet names with format `{@link a-zA-Z0-9_|a-zA-Z}+`. + * * String: string like "any string with backslash escape for quote(\")." + * * Number: whole number and floating point number like 10, -1 and -0.01. + * * List: list of elements with comma(,) separator surrounded by square + * brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + * + * Built-in constants: + * + * * MIN (minimum number similar to java Double.MIN_VALUE) + * * MAX (maximum number similar to java Double.MAX_VALUE) + * + * Built-in functions: + * + * * bucket(start, end[, label]): bucket built-in function creates a bucket + * with range of [start, end). Note that the end is exclusive, for example, + * bucket(1, MAX, "positive number") or bucket(1, 10). + * + * Job histogram facets: + * + * * company_display_name: histogram by {@link google.cloud.talent.v4beta1.Job.company_display_name|Job.company_display_name}. + * * employment_type: histogram by {@link google.cloud.talent.v4beta1.Job.employment_types|Job.employment_types}, for example, + * "FULL_TIME", "PART_TIME". + * * company_size (DEPRECATED): histogram by {@link google.cloud.talent.v4beta1.CompanySize|CompanySize}, for example, + * "SMALL", "MEDIUM", "BIG". + * * publish_time_in_day: histogram by the {@link google.cloud.talent.v4beta1.Job.posting_publish_time|Job.posting_publish_time} + * in days. + * Must specify list of numeric buckets in spec. + * * publish_time_in_month: histogram by the {@link google.cloud.talent.v4beta1.Job.posting_publish_time|Job.posting_publish_time} + * in months. + * Must specify list of numeric buckets in spec. + * * publish_time_in_year: histogram by the {@link google.cloud.talent.v4beta1.Job.posting_publish_time|Job.posting_publish_time} + * in years. + * Must specify list of numeric buckets in spec. + * * degree_types: histogram by the {@link google.cloud.talent.v4beta1.Job.degree_types|Job.degree_types}, for example, + * "Bachelors", "Masters". + * * job_level: histogram by the {@link google.cloud.talent.v4beta1.Job.job_level|Job.job_level}, for example, "Entry + * Level". + * * country: histogram by the country code of jobs, for example, "US", "FR". + * * admin1: histogram by the admin1 code of jobs, which is a global + * placeholder referring to the state, province, or the particular term a + * country uses to define the geographic structure below the country level, + * for example, "CA", "IL". + * * city: histogram by a combination of the "city name, admin1 code". For + * example, "Mountain View, CA", "New York, NY". + * * admin1_country: histogram by a combination of the "admin1 code, country", + * for example, "CA, US", "IL, US". + * * city_coordinate: histogram by the city center's GPS coordinates (latitude + * and longitude), for example, 37.4038522,-122.0987765. Since the + * coordinates of a city center can change, customers may need to refresh + * them periodically. + * * locale: histogram by the {@link google.cloud.talent.v4beta1.Job.language_code|Job.language_code}, for example, "en-US", + * "fr-FR". + * * language: histogram by the language subtag of the {@link google.cloud.talent.v4beta1.Job.language_code|Job.language_code}, + * for example, "en", "fr". + * * category: histogram by the {@link google.cloud.talent.v4beta1.JobCategory|JobCategory}, for example, + * "COMPUTER_AND_IT", "HEALTHCARE". + * * base_compensation_unit: histogram by the + * {@link google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit|CompensationInfo.CompensationUnit} of base + * salary, for example, "WEEKLY", "MONTHLY". + * * base_compensation: histogram by the base salary. Must specify list of + * numeric buckets to group results by. + * * annualized_base_compensation: histogram by the base annualized salary. + * Must specify list of numeric buckets to group results by. + * * annualized_total_compensation: histogram by the total annualized salary. + * Must specify list of numeric buckets to group results by. + * * string_custom_attribute: histogram by string {@link google.cloud.talent.v4beta1.Job.custom_attributes|Job.custom_attributes}. + * Values can be accessed via square bracket notations like + * string_custom_attribute["key1"]. + * * numeric_custom_attribute: histogram by numeric {@link google.cloud.talent.v4beta1.Job.custom_attributes|Job.custom_attributes}. + * Values can be accessed via square bracket notations like + * numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + * group results by. + * + * Example expressions: + * + * * `count(admin1)` + * * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + * bucket(100000, MAX)])` + * * `count(string_custom_attribute["some-string-custom-attribute"])` + * * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + * [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + * @param {google.cloud.talent.v4beta1.JobView} request.jobView + * The desired job attributes returned for jobs in the search response. + * Defaults to {@link google.cloud.talent.v4beta1.JobView.JOB_VIEW_SMALL|JobView.JOB_VIEW_SMALL} if no value is specified. + * @param {number} request.offset + * An integer that specifies the current offset (that is, starting result + * location, amongst the jobs deemed by the API as relevant) in search + * results. This field is only considered if {@link google.cloud.talent.v4beta1.SearchJobsRequest.page_token|page_token} is unset. + * + * The maximum allowed value is 5000. Otherwise an error is thrown. + * + * For example, 0 means to return results starting from the first matching + * job, and 10 means to return from the 11th job. This can be used for + * pagination, (for example, pageSize = 10 and offset = 10 means to return + * from the second page). + * @param {number} request.pageSize + * A limit on the number of jobs returned in the search results. + * Increasing this value above the default value of 10 can increase search + * response time. The value can be between 1 and 100. + * @param {string} request.pageToken + * The token specifying the current offset within + * search results. See {@link google.cloud.talent.v4beta1.SearchJobsResponse.next_page_token|SearchJobsResponse.next_page_token} for + * an explanation of how to obtain the next set of query results. + * @param {string} request.orderBy + * The criteria determining how search results are sorted. Default is + * `"relevance desc"`. + * + * Supported options are: + * + * * `"relevance desc"`: By relevance descending, as determined by the API + * algorithms. Relevance thresholding of query results is only available + * with this ordering. + * * `"posting_publish_time desc"`: By {@link google.cloud.talent.v4beta1.Job.posting_publish_time|Job.posting_publish_time} + * descending. + * * `"posting_update_time desc"`: By {@link google.cloud.talent.v4beta1.Job.posting_update_time|Job.posting_update_time} + * descending. + * * `"title"`: By {@link google.cloud.talent.v4beta1.Job.title|Job.title} ascending. + * * `"title desc"`: By {@link google.cloud.talent.v4beta1.Job.title|Job.title} descending. + * * `"annualized_base_compensation"`: By job's + * {@link google.cloud.talent.v4beta1.CompensationInfo.annualized_base_compensation_range|CompensationInfo.annualized_base_compensation_range} ascending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_base_compensation desc"`: By job's + * {@link google.cloud.talent.v4beta1.CompensationInfo.annualized_base_compensation_range|CompensationInfo.annualized_base_compensation_range} descending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_total_compensation"`: By job's + * {@link google.cloud.talent.v4beta1.CompensationInfo.annualized_total_compensation_range|CompensationInfo.annualized_total_compensation_range} ascending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"annualized_total_compensation desc"`: By job's + * {@link google.cloud.talent.v4beta1.CompensationInfo.annualized_total_compensation_range|CompensationInfo.annualized_total_compensation_range} descending. Jobs + * whose annualized base compensation is unspecified are put at the end of + * search results. + * * `"custom_ranking desc"`: By the relevance score adjusted to the + * {@link google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ranking_expression|SearchJobsRequest.CustomRankingInfo.ranking_expression} with weight + * factor assigned by + * {@link google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.importance_level|SearchJobsRequest.CustomRankingInfo.importance_level} in descending + * order. + * * Location sorting: Use the special syntax to order jobs by distance:
+ * `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ * `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ * `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + * multiple locations. See details below.
+ * `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + * multiple locations. See details below.
+ * The string can have a maximum of 256 characters. When multiple distance + * centers are provided, a job that is close to any of the distance centers + * would have a high rank. When a job has multiple locations, the job + * location closest to one of the distance centers will be used. Jobs that + * don't have locations will be ranked at the bottom. Distance is calculated + * with a precision of 11.3 meters (37.4 feet). Diversification strategy is + * still applied unless explicitly disabled in + * {@link google.cloud.talent.v4beta1.SearchJobsRequest.diversification_level|diversification_level}. + * @param {google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel} request.diversificationLevel + * Controls whether highly similar jobs are returned next to each other in + * the search results. Jobs are identified as highly similar based on + * their titles, job categories, and locations. Highly similar results are + * clustered so that only one representative job of the cluster is + * displayed to the job seeker higher up in the results, with the other jobs + * being displayed lower down in the results. + * + * Defaults to {@link google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel.SIMPLE|DiversificationLevel.SIMPLE} if no value + * is specified. + * @param {google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo} request.customRankingInfo + * Controls over how job documents get ranked on top of existing relevance + * score (determined by API algorithm). + * @param {boolean} request.disableKeywordMatch + * This field is deprecated. Please use + * {@link google.cloud.talent.v4beta1.SearchJobsRequest.keyword_match_mode|SearchJobsRequest.keyword_match_mode} going forward. + * + * To migrate, disable_keyword_match set to false maps to + * {@link google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL|KeywordMatchMode.KEYWORD_MATCH_ALL}, and disable_keyword_match set to + * true maps to {@link google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_DISABLED|KeywordMatchMode.KEYWORD_MATCH_DISABLED}. If + * {@link google.cloud.talent.v4beta1.SearchJobsRequest.keyword_match_mode|SearchJobsRequest.keyword_match_mode} is set, this field is ignored. + * + * Controls whether to disable exact keyword match on {@link google.cloud.talent.v4beta1.Job.title|Job.title}, + * {@link google.cloud.talent.v4beta1.Job.description|Job.description}, {@link google.cloud.talent.v4beta1.Job.company_display_name|Job.company_display_name}, {@link google.cloud.talent.v4beta1.Job.addresses|Job.addresses}, + * {@link google.cloud.talent.v4beta1.Job.qualifications|Job.qualifications}. When disable keyword match is turned off, a + * keyword match returns jobs that do not match given category filters when + * there are matching keywords. For example, for the query "program manager," + * a result is returned even if the job posting has the title "software + * developer," which doesn't fall into "program manager" ontology, but does + * have "program manager" appearing in its description. + * + * For queries like "cloud" that don't contain title or + * location specific ontology, jobs with "cloud" keyword matches are returned + * regardless of this flag's value. + * + * Use {@link google.cloud.talent.v4beta1.Company.keyword_searchable_job_custom_attributes|Company.keyword_searchable_job_custom_attributes} if + * company-specific globally matched custom field/attribute string values are + * needed. Enabling keyword match improves recall of subsequent search + * requests. + * + * Defaults to false. + * @param {google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode} request.keywordMatchMode + * Controls what keyword match options to use. + * + * Defaults to {@link google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode.KEYWORD_MATCH_ALL|KeywordMatchMode.KEYWORD_MATCH_ALL} if no value + * is specified. + * @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 [SearchJobsResponse]{@link google.cloud.talent.v4beta1.SearchJobsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4beta1/job_service.search_jobs_for_alert.js + * region_tag:jobs_v4beta1_generated_JobService_SearchJobsForAlert_async + */ + searchJobsForAlert( + request?: protos.google.cloud.talent.v4beta1.ISearchJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ISearchJobsResponse, + protos.google.cloud.talent.v4beta1.ISearchJobsRequest | undefined, + {} | undefined + ] + >; + searchJobsForAlert( + request: protos.google.cloud.talent.v4beta1.ISearchJobsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4beta1.ISearchJobsResponse, + protos.google.cloud.talent.v4beta1.ISearchJobsRequest | null | undefined, + {} | null | undefined + > + ): void; + searchJobsForAlert( + request: protos.google.cloud.talent.v4beta1.ISearchJobsRequest, + callback: Callback< + protos.google.cloud.talent.v4beta1.ISearchJobsResponse, + protos.google.cloud.talent.v4beta1.ISearchJobsRequest | null | undefined, + {} | null | undefined + > + ): void; + searchJobsForAlert( + request?: protos.google.cloud.talent.v4beta1.ISearchJobsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4beta1.ISearchJobsResponse, + | protos.google.cloud.talent.v4beta1.ISearchJobsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4beta1.ISearchJobsResponse, + protos.google.cloud.talent.v4beta1.ISearchJobsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ISearchJobsResponse, + protos.google.cloud.talent.v4beta1.ISearchJobsRequest | 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.searchJobsForAlert(request, options, callback); + } + + /** + * Begins executing a batch create jobs operation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the tenant under which the job is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + * is created. For example, "projects/foo". + * @param {number[]} request.jobs + * Required. The jobs to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v4beta1/job_service.batch_create_jobs.js + * region_tag:jobs_v4beta1_generated_JobService_BatchCreateJobs_async + */ + batchCreateJobs( + request?: protos.google.cloud.talent.v4beta1.IBatchCreateJobsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.talent.v4beta1.IJobOperationResult, + protos.google.cloud.talent.v4beta1.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchCreateJobs( + request: protos.google.cloud.talent.v4beta1.IBatchCreateJobsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.talent.v4beta1.IJobOperationResult, + protos.google.cloud.talent.v4beta1.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchCreateJobs( + request: protos.google.cloud.talent.v4beta1.IBatchCreateJobsRequest, + callback: Callback< + LROperation< + protos.google.cloud.talent.v4beta1.IJobOperationResult, + protos.google.cloud.talent.v4beta1.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchCreateJobs( + request?: protos.google.cloud.talent.v4beta1.IBatchCreateJobsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.talent.v4beta1.IJobOperationResult, + protos.google.cloud.talent.v4beta1.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.talent.v4beta1.IJobOperationResult, + protos.google.cloud.talent.v4beta1.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.talent.v4beta1.IJobOperationResult, + protos.google.cloud.talent.v4beta1.IBatchOperationMetadata + >, + 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.batchCreateJobs(request, options, callback); + } + /** + * Check the status of the long running operation returned by `batchCreateJobs()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v4beta1/job_service.batch_create_jobs.js + * region_tag:jobs_v4beta1_generated_JobService_BatchCreateJobs_async + */ + async checkBatchCreateJobsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.talent.v4beta1.JobOperationResult, + protos.google.cloud.talent.v4beta1.BatchOperationMetadata + > + > { + 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.batchCreateJobs, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.talent.v4beta1.JobOperationResult, + protos.google.cloud.talent.v4beta1.BatchOperationMetadata + >; + } + /** + * Begins executing a batch update jobs operation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the tenant under which the job is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + * is created. For example, "projects/foo". + * @param {number[]} request.jobs + * Required. The jobs to be updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Strongly recommended for the best service experience. Be aware that it will + * also increase latency when checking the status of a batch operation. + * + * If {@link google.cloud.talent.v4beta1.BatchUpdateJobsRequest.update_mask|update_mask} is provided, only the specified fields in + * {@link google.cloud.talent.v4beta1.Job|Job} are updated. Otherwise all the fields are updated. + * + * A field mask to restrict the fields that are updated. Only + * top level fields of {@link google.cloud.talent.v4beta1.Job|Job} are supported. + * + * If {@link google.cloud.talent.v4beta1.BatchUpdateJobsRequest.update_mask|update_mask} is provided, The {@link google.cloud.talent.v4beta1.Job|Job} inside + * {@link google.cloud.talent.v4beta1.JobOperationResult.JobResult|JobResult} + * will only contains fields that is updated, plus the Id of the Job. + * Otherwise, {@link google.cloud.talent.v4beta1.Job|Job} will include all fields, which can yield a very + * large response. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v4beta1/job_service.batch_update_jobs.js + * region_tag:jobs_v4beta1_generated_JobService_BatchUpdateJobs_async + */ + batchUpdateJobs( + request?: protos.google.cloud.talent.v4beta1.IBatchUpdateJobsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.talent.v4beta1.IJobOperationResult, + protos.google.cloud.talent.v4beta1.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchUpdateJobs( + request: protos.google.cloud.talent.v4beta1.IBatchUpdateJobsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.talent.v4beta1.IJobOperationResult, + protos.google.cloud.talent.v4beta1.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchUpdateJobs( + request: protos.google.cloud.talent.v4beta1.IBatchUpdateJobsRequest, + callback: Callback< + LROperation< + protos.google.cloud.talent.v4beta1.IJobOperationResult, + protos.google.cloud.talent.v4beta1.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchUpdateJobs( + request?: protos.google.cloud.talent.v4beta1.IBatchUpdateJobsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.talent.v4beta1.IJobOperationResult, + protos.google.cloud.talent.v4beta1.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.talent.v4beta1.IJobOperationResult, + protos.google.cloud.talent.v4beta1.IBatchOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.talent.v4beta1.IJobOperationResult, + protos.google.cloud.talent.v4beta1.IBatchOperationMetadata + >, + 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.batchUpdateJobs(request, options, callback); + } + /** + * Check the status of the long running operation returned by `batchUpdateJobs()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v4beta1/job_service.batch_update_jobs.js + * region_tag:jobs_v4beta1_generated_JobService_BatchUpdateJobs_async + */ + async checkBatchUpdateJobsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.talent.v4beta1.JobOperationResult, + protos.google.cloud.talent.v4beta1.BatchOperationMetadata + > + > { + 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.batchUpdateJobs, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.talent.v4beta1.JobOperationResult, + protos.google.cloud.talent.v4beta1.BatchOperationMetadata + >; + } + /** + * Lists jobs by filter. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the tenant under which the job is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + * is created. For example, "projects/foo". + * @param {string} request.filter + * Required. The filter string specifies the jobs to be enumerated. + * + * Supported operator: =, AND + * + * The fields eligible for filtering are: + * + * * `companyName` + * * `requisitionId` + * * `status` Available values: OPEN, EXPIRED, ALL. Defaults to + * OPEN if no value is specified. + * + * At least one of `companyName` and `requisitionId` must present or an + * INVALID_ARGUMENT error is thrown. + * + * Sample Query: + * + * * companyName = "projects/foo/tenants/bar/companies/baz" + * * companyName = "projects/foo/tenants/bar/companies/baz" AND + * requisitionId = "req-1" + * * companyName = "projects/foo/tenants/bar/companies/baz" AND + * status = "EXPIRED" + * * requisitionId = "req-1" + * * requisitionId = "req-1" AND status = "EXPIRED" + * @param {string} request.pageToken + * The starting point of a query result. + * @param {number} request.pageSize + * The maximum number of jobs to be returned per page of results. + * + * If {@link google.cloud.talent.v4beta1.ListJobsRequest.job_view|job_view} is set to {@link google.cloud.talent.v4beta1.JobView.JOB_VIEW_ID_ONLY|JobView.JOB_VIEW_ID_ONLY}, the maximum allowed + * page size is 1000. Otherwise, the maximum allowed page size is 100. + * + * Default is 100 if empty or a number < 1 is specified. + * @param {google.cloud.talent.v4beta1.JobView} request.jobView + * The desired job attributes returned for jobs in the + * search response. Defaults to {@link google.cloud.talent.v4beta1.JobView.JOB_VIEW_FULL|JobView.JOB_VIEW_FULL} if no value is + * specified. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Job]{@link google.cloud.talent.v4beta1.Job}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listJobs( + request?: protos.google.cloud.talent.v4beta1.IListJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4beta1.IJob[], + protos.google.cloud.talent.v4beta1.IListJobsRequest | null, + protos.google.cloud.talent.v4beta1.IListJobsResponse + ] + >; + listJobs( + request: protos.google.cloud.talent.v4beta1.IListJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.talent.v4beta1.IListJobsRequest, + protos.google.cloud.talent.v4beta1.IListJobsResponse | null | undefined, + protos.google.cloud.talent.v4beta1.IJob + > + ): void; + listJobs( + request: protos.google.cloud.talent.v4beta1.IListJobsRequest, + callback: PaginationCallback< + protos.google.cloud.talent.v4beta1.IListJobsRequest, + protos.google.cloud.talent.v4beta1.IListJobsResponse | null | undefined, + protos.google.cloud.talent.v4beta1.IJob + > + ): void; + listJobs( + request?: protos.google.cloud.talent.v4beta1.IListJobsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.talent.v4beta1.IListJobsRequest, + | protos.google.cloud.talent.v4beta1.IListJobsResponse + | null + | undefined, + protos.google.cloud.talent.v4beta1.IJob + >, + callback?: PaginationCallback< + protos.google.cloud.talent.v4beta1.IListJobsRequest, + protos.google.cloud.talent.v4beta1.IListJobsResponse | null | undefined, + protos.google.cloud.talent.v4beta1.IJob + > + ): Promise< + [ + protos.google.cloud.talent.v4beta1.IJob[], + protos.google.cloud.talent.v4beta1.IListJobsRequest | null, + protos.google.cloud.talent.v4beta1.IListJobsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listJobs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the tenant under which the job is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + * is created. For example, "projects/foo". + * @param {string} request.filter + * Required. The filter string specifies the jobs to be enumerated. + * + * Supported operator: =, AND + * + * The fields eligible for filtering are: + * + * * `companyName` + * * `requisitionId` + * * `status` Available values: OPEN, EXPIRED, ALL. Defaults to + * OPEN if no value is specified. + * + * At least one of `companyName` and `requisitionId` must present or an + * INVALID_ARGUMENT error is thrown. + * + * Sample Query: + * + * * companyName = "projects/foo/tenants/bar/companies/baz" + * * companyName = "projects/foo/tenants/bar/companies/baz" AND + * requisitionId = "req-1" + * * companyName = "projects/foo/tenants/bar/companies/baz" AND + * status = "EXPIRED" + * * requisitionId = "req-1" + * * requisitionId = "req-1" AND status = "EXPIRED" + * @param {string} request.pageToken + * The starting point of a query result. + * @param {number} request.pageSize + * The maximum number of jobs to be returned per page of results. + * + * If {@link google.cloud.talent.v4beta1.ListJobsRequest.job_view|job_view} is set to {@link google.cloud.talent.v4beta1.JobView.JOB_VIEW_ID_ONLY|JobView.JOB_VIEW_ID_ONLY}, the maximum allowed + * page size is 1000. Otherwise, the maximum allowed page size is 100. + * + * Default is 100 if empty or a number < 1 is specified. + * @param {google.cloud.talent.v4beta1.JobView} request.jobView + * The desired job attributes returned for jobs in the + * search response. Defaults to {@link google.cloud.talent.v4beta1.JobView.JOB_VIEW_FULL|JobView.JOB_VIEW_FULL} if no value is + * specified. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Job]{@link google.cloud.talent.v4beta1.Job} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listJobsStream( + request?: protos.google.cloud.talent.v4beta1.IListJobsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobs.createStream( + this.innerApiCalls.listJobs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the tenant under which the job is created. + * + * The format is "projects/{project_id}/tenants/{tenant_id}". For example, + * "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + * is created. For example, "projects/foo". + * @param {string} request.filter + * Required. The filter string specifies the jobs to be enumerated. + * + * Supported operator: =, AND + * + * The fields eligible for filtering are: + * + * * `companyName` + * * `requisitionId` + * * `status` Available values: OPEN, EXPIRED, ALL. Defaults to + * OPEN if no value is specified. + * + * At least one of `companyName` and `requisitionId` must present or an + * INVALID_ARGUMENT error is thrown. + * + * Sample Query: + * + * * companyName = "projects/foo/tenants/bar/companies/baz" + * * companyName = "projects/foo/tenants/bar/companies/baz" AND + * requisitionId = "req-1" + * * companyName = "projects/foo/tenants/bar/companies/baz" AND + * status = "EXPIRED" + * * requisitionId = "req-1" + * * requisitionId = "req-1" AND status = "EXPIRED" + * @param {string} request.pageToken + * The starting point of a query result. + * @param {number} request.pageSize + * The maximum number of jobs to be returned per page of results. + * + * If {@link google.cloud.talent.v4beta1.ListJobsRequest.job_view|job_view} is set to {@link google.cloud.talent.v4beta1.JobView.JOB_VIEW_ID_ONLY|JobView.JOB_VIEW_ID_ONLY}, the maximum allowed + * page size is 1000. Otherwise, the maximum allowed page size is 100. + * + * Default is 100 if empty or a number < 1 is specified. + * @param {google.cloud.talent.v4beta1.JobView} request.jobView + * The desired job attributes returned for jobs in the + * search response. Defaults to {@link google.cloud.talent.v4beta1.JobView.JOB_VIEW_FULL|JobView.JOB_VIEW_FULL} if no value is + * specified. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Job]{@link google.cloud.talent.v4beta1.Job}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v4beta1/job_service.list_jobs.js + * region_tag:jobs_v4beta1_generated_JobService_ListJobs_async + */ + listJobsAsync( + request?: protos.google.cloud.talent.v4beta1.IListJobsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobs.asyncIterate( + this.innerApiCalls['listJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectCompany resource name string. + * + * @param {string} project + * @param {string} company + * @returns {string} Resource name string. + */ + projectCompanyPath(project: string, company: string) { + return this.pathTemplates.projectCompanyPathTemplate.render({ + project: project, + company: company, + }); + } + + /** + * Parse the project from ProjectCompany resource. + * + * @param {string} projectCompanyName + * A fully-qualified path representing project_company resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCompanyName(projectCompanyName: string) { + return this.pathTemplates.projectCompanyPathTemplate.match( + projectCompanyName + ).project; + } + + /** + * Parse the company from ProjectCompany resource. + * + * @param {string} projectCompanyName + * A fully-qualified path representing project_company resource. + * @returns {string} A string representing the company. + */ + matchCompanyFromProjectCompanyName(projectCompanyName: string) { + return this.pathTemplates.projectCompanyPathTemplate.match( + projectCompanyName + ).company; + } + + /** + * Return a fully-qualified projectJob resource name string. + * + * @param {string} project + * @param {string} job + * @returns {string} Resource name string. + */ + projectJobPath(project: string, job: string) { + return this.pathTemplates.projectJobPathTemplate.render({ + project: project, + job: job, + }); + } + + /** + * Parse the project from ProjectJob resource. + * + * @param {string} projectJobName + * A fully-qualified path representing project_job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectJobName(projectJobName: string) { + return this.pathTemplates.projectJobPathTemplate.match(projectJobName) + .project; + } + + /** + * Parse the job from ProjectJob resource. + * + * @param {string} projectJobName + * A fully-qualified path representing project_job resource. + * @returns {string} A string representing the job. + */ + matchJobFromProjectJobName(projectJobName: string) { + return this.pathTemplates.projectJobPathTemplate.match(projectJobName).job; + } + + /** + * Return a fully-qualified projectTenantCompany resource name string. + * + * @param {string} project + * @param {string} tenant + * @param {string} company + * @returns {string} Resource name string. + */ + projectTenantCompanyPath(project: string, tenant: string, company: string) { + return this.pathTemplates.projectTenantCompanyPathTemplate.render({ + project: project, + tenant: tenant, + company: company, + }); + } + + /** + * Parse the project from ProjectTenantCompany resource. + * + * @param {string} projectTenantCompanyName + * A fully-qualified path representing project_tenant_company resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTenantCompanyName(projectTenantCompanyName: string) { + return this.pathTemplates.projectTenantCompanyPathTemplate.match( + projectTenantCompanyName + ).project; + } + + /** + * Parse the tenant from ProjectTenantCompany resource. + * + * @param {string} projectTenantCompanyName + * A fully-qualified path representing project_tenant_company resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromProjectTenantCompanyName(projectTenantCompanyName: string) { + return this.pathTemplates.projectTenantCompanyPathTemplate.match( + projectTenantCompanyName + ).tenant; + } + + /** + * Parse the company from ProjectTenantCompany resource. + * + * @param {string} projectTenantCompanyName + * A fully-qualified path representing project_tenant_company resource. + * @returns {string} A string representing the company. + */ + matchCompanyFromProjectTenantCompanyName(projectTenantCompanyName: string) { + return this.pathTemplates.projectTenantCompanyPathTemplate.match( + projectTenantCompanyName + ).company; + } + + /** + * Return a fully-qualified projectTenantJob resource name string. + * + * @param {string} project + * @param {string} tenant + * @param {string} job + * @returns {string} Resource name string. + */ + projectTenantJobPath(project: string, tenant: string, job: string) { + return this.pathTemplates.projectTenantJobPathTemplate.render({ + project: project, + tenant: tenant, + job: job, + }); + } + + /** + * Parse the project from ProjectTenantJob resource. + * + * @param {string} projectTenantJobName + * A fully-qualified path representing project_tenant_job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTenantJobName(projectTenantJobName: string) { + return this.pathTemplates.projectTenantJobPathTemplate.match( + projectTenantJobName + ).project; + } + + /** + * Parse the tenant from ProjectTenantJob resource. + * + * @param {string} projectTenantJobName + * A fully-qualified path representing project_tenant_job resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromProjectTenantJobName(projectTenantJobName: string) { + return this.pathTemplates.projectTenantJobPathTemplate.match( + projectTenantJobName + ).tenant; + } + + /** + * Parse the job from ProjectTenantJob resource. + * + * @param {string} projectTenantJobName + * A fully-qualified path representing project_tenant_job resource. + * @returns {string} A string representing the job. + */ + matchJobFromProjectTenantJobName(projectTenantJobName: string) { + return this.pathTemplates.projectTenantJobPathTemplate.match( + projectTenantJobName + ).job; + } + + /** + * Return a fully-qualified tenant resource name string. + * + * @param {string} project + * @param {string} tenant + * @returns {string} Resource name string. + */ + tenantPath(project: string, tenant: string) { + return this.pathTemplates.tenantPathTemplate.render({ + project: project, + tenant: tenant, + }); + } + + /** + * Parse the project from Tenant resource. + * + * @param {string} tenantName + * A fully-qualified path representing Tenant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTenantName(tenantName: string) { + return this.pathTemplates.tenantPathTemplate.match(tenantName).project; + } + + /** + * Parse the tenant from Tenant resource. + * + * @param {string} tenantName + * A fully-qualified path representing Tenant resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromTenantName(tenantName: string) { + return this.pathTemplates.tenantPathTemplate.match(tenantName).tenant; + } + + /** + * 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.jobServiceStub && !this._terminated) { + return this.jobServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-talent/src/v4beta1/job_service_client_config.json b/packages/google-cloud-talent/src/v4beta1/job_service_client_config.json new file mode 100644 index 00000000000..48bb7c6ef9e --- /dev/null +++ b/packages/google-cloud-talent/src/v4beta1/job_service_client_config.json @@ -0,0 +1,76 @@ +{ + "interfaces": { + "google.cloud.talent.v4beta1.JobService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateJob": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchCreateJobs": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetJob": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateJob": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchUpdateJobs": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteJob": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "BatchDeleteJobs": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListJobs": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "SearchJobs": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SearchJobsForAlert": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-talent/src/v4beta1/job_service_proto_list.json b/packages/google-cloud-talent/src/v4beta1/job_service_proto_list.json new file mode 100644 index 00000000000..e44f49ea525 --- /dev/null +++ b/packages/google-cloud-talent/src/v4beta1/job_service_proto_list.json @@ -0,0 +1,15 @@ +[ + "../../protos/google/cloud/talent/v4beta1/batch.proto", + "../../protos/google/cloud/talent/v4beta1/common.proto", + "../../protos/google/cloud/talent/v4beta1/company.proto", + "../../protos/google/cloud/talent/v4beta1/company_service.proto", + "../../protos/google/cloud/talent/v4beta1/completion_service.proto", + "../../protos/google/cloud/talent/v4beta1/event.proto", + "../../protos/google/cloud/talent/v4beta1/event_service.proto", + "../../protos/google/cloud/talent/v4beta1/filters.proto", + "../../protos/google/cloud/talent/v4beta1/histogram.proto", + "../../protos/google/cloud/talent/v4beta1/job.proto", + "../../protos/google/cloud/talent/v4beta1/job_service.proto", + "../../protos/google/cloud/talent/v4beta1/tenant.proto", + "../../protos/google/cloud/talent/v4beta1/tenant_service.proto" +] diff --git a/packages/google-cloud-talent/src/v4beta1/tenant_service_client.ts b/packages/google-cloud-talent/src/v4beta1/tenant_service_client.ts new file mode 100644 index 00000000000..44001687463 --- /dev/null +++ b/packages/google-cloud-talent/src/v4beta1/tenant_service_client.ts @@ -0,0 +1,1194 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v4beta1/tenant_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './tenant_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service that handles tenant management, including CRUD and enumeration. + * @class + * @memberof v4beta1 + */ +export class TenantServiceClient { + 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}; + tenantServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TenantServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new TenantServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof TenantServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectCompanyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/companies/{company}' + ), + projectJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/jobs/{job}' + ), + projectTenantCompanyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}/companies/{company}' + ), + projectTenantJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}/jobs/{job}' + ), + tenantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/tenants/{tenant}' + ), + }; + + // 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 = { + listTenants: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'tenants' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.talent.v4beta1.TenantService', + 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.tenantServiceStub) { + return this.tenantServiceStub; + } + + // Put together the "service stub" for + // google.cloud.talent.v4beta1.TenantService. + this.tenantServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.talent.v4beta1.TenantService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.talent.v4beta1.TenantService, + 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 tenantServiceStubMethods = [ + 'createTenant', + 'getTenant', + 'updateTenant', + 'deleteTenant', + 'listTenants', + ]; + for (const methodName of tenantServiceStubMethods) { + const callPromise = this.tenantServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.tenantServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'jobs.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 'jobs.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', + 'https://www.googleapis.com/auth/jobs', + ]; + } + + 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 new tenant entity. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the project under which the tenant is created. + * + * The format is "projects/{project_id}", for example, + * "projects/foo". + * @param {google.cloud.talent.v4beta1.Tenant} request.tenant + * Required. The tenant to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Tenant]{@link google.cloud.talent.v4beta1.Tenant}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4beta1/tenant_service.create_tenant.js + * region_tag:jobs_v4beta1_generated_TenantService_CreateTenant_async + */ + createTenant( + request?: protos.google.cloud.talent.v4beta1.ICreateTenantRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ITenant, + protos.google.cloud.talent.v4beta1.ICreateTenantRequest | undefined, + {} | undefined + ] + >; + createTenant( + request: protos.google.cloud.talent.v4beta1.ICreateTenantRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4beta1.ITenant, + | protos.google.cloud.talent.v4beta1.ICreateTenantRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createTenant( + request: protos.google.cloud.talent.v4beta1.ICreateTenantRequest, + callback: Callback< + protos.google.cloud.talent.v4beta1.ITenant, + | protos.google.cloud.talent.v4beta1.ICreateTenantRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createTenant( + request?: protos.google.cloud.talent.v4beta1.ICreateTenantRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4beta1.ITenant, + | protos.google.cloud.talent.v4beta1.ICreateTenantRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4beta1.ITenant, + | protos.google.cloud.talent.v4beta1.ICreateTenantRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ITenant, + protos.google.cloud.talent.v4beta1.ICreateTenantRequest | 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.createTenant(request, options, callback); + } + /** + * Retrieves specified tenant. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the tenant to be retrieved. + * + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenants/bar". + * @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 [Tenant]{@link google.cloud.talent.v4beta1.Tenant}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4beta1/tenant_service.get_tenant.js + * region_tag:jobs_v4beta1_generated_TenantService_GetTenant_async + */ + getTenant( + request?: protos.google.cloud.talent.v4beta1.IGetTenantRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ITenant, + protos.google.cloud.talent.v4beta1.IGetTenantRequest | undefined, + {} | undefined + ] + >; + getTenant( + request: protos.google.cloud.talent.v4beta1.IGetTenantRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4beta1.ITenant, + protos.google.cloud.talent.v4beta1.IGetTenantRequest | null | undefined, + {} | null | undefined + > + ): void; + getTenant( + request: protos.google.cloud.talent.v4beta1.IGetTenantRequest, + callback: Callback< + protos.google.cloud.talent.v4beta1.ITenant, + protos.google.cloud.talent.v4beta1.IGetTenantRequest | null | undefined, + {} | null | undefined + > + ): void; + getTenant( + request?: protos.google.cloud.talent.v4beta1.IGetTenantRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4beta1.ITenant, + | protos.google.cloud.talent.v4beta1.IGetTenantRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4beta1.ITenant, + protos.google.cloud.talent.v4beta1.IGetTenantRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ITenant, + protos.google.cloud.talent.v4beta1.IGetTenantRequest | 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.getTenant(request, options, callback); + } + /** + * Updates specified tenant. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.talent.v4beta1.Tenant} request.tenant + * Required. The tenant resource to replace the current resource in the system. + * @param {google.protobuf.FieldMask} request.updateMask + * Strongly recommended for the best service experience. + * + * If {@link google.cloud.talent.v4beta1.UpdateTenantRequest.update_mask|update_mask} is provided, only the specified fields in + * {@link google.cloud.talent.v4beta1.UpdateTenantRequest.tenant|tenant} are updated. Otherwise all the fields are updated. + * + * A field mask to specify the tenant fields to be updated. Only + * top level fields of {@link google.cloud.talent.v4beta1.Tenant|Tenant} are supported. + * @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 [Tenant]{@link google.cloud.talent.v4beta1.Tenant}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4beta1/tenant_service.update_tenant.js + * region_tag:jobs_v4beta1_generated_TenantService_UpdateTenant_async + */ + updateTenant( + request?: protos.google.cloud.talent.v4beta1.IUpdateTenantRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ITenant, + protos.google.cloud.talent.v4beta1.IUpdateTenantRequest | undefined, + {} | undefined + ] + >; + updateTenant( + request: protos.google.cloud.talent.v4beta1.IUpdateTenantRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.talent.v4beta1.ITenant, + | protos.google.cloud.talent.v4beta1.IUpdateTenantRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateTenant( + request: protos.google.cloud.talent.v4beta1.IUpdateTenantRequest, + callback: Callback< + protos.google.cloud.talent.v4beta1.ITenant, + | protos.google.cloud.talent.v4beta1.IUpdateTenantRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateTenant( + request?: protos.google.cloud.talent.v4beta1.IUpdateTenantRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.talent.v4beta1.ITenant, + | protos.google.cloud.talent.v4beta1.IUpdateTenantRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.talent.v4beta1.ITenant, + | protos.google.cloud.talent.v4beta1.IUpdateTenantRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ITenant, + protos.google.cloud.talent.v4beta1.IUpdateTenantRequest | 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({ + 'tenant.name': request.tenant!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateTenant(request, options, callback); + } + /** + * Deletes specified tenant. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the tenant to be deleted. + * + * The format is "projects/{project_id}/tenants/{tenant_id}", for example, + * "projects/foo/tenants/bar". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v4beta1/tenant_service.delete_tenant.js + * region_tag:jobs_v4beta1_generated_TenantService_DeleteTenant_async + */ + deleteTenant( + request?: protos.google.cloud.talent.v4beta1.IDeleteTenantRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4beta1.IDeleteTenantRequest | undefined, + {} | undefined + ] + >; + deleteTenant( + request: protos.google.cloud.talent.v4beta1.IDeleteTenantRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.talent.v4beta1.IDeleteTenantRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteTenant( + request: protos.google.cloud.talent.v4beta1.IDeleteTenantRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.talent.v4beta1.IDeleteTenantRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteTenant( + request?: protos.google.cloud.talent.v4beta1.IDeleteTenantRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.talent.v4beta1.IDeleteTenantRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.talent.v4beta1.IDeleteTenantRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.talent.v4beta1.IDeleteTenantRequest | 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.deleteTenant(request, options, callback); + } + + /** + * Lists all tenants associated with the project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the project under which the tenant is created. + * + * The format is "projects/{project_id}", for example, + * "projects/foo". + * @param {string} request.pageToken + * The starting indicator from which to return results. + * @param {number} request.pageSize + * The maximum number of tenants to be returned, at most 100. + * Default is 100 if a non-positive number is provided. + * @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 [Tenant]{@link google.cloud.talent.v4beta1.Tenant}. + * 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 `listTenantsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTenants( + request?: protos.google.cloud.talent.v4beta1.IListTenantsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ITenant[], + protos.google.cloud.talent.v4beta1.IListTenantsRequest | null, + protos.google.cloud.talent.v4beta1.IListTenantsResponse + ] + >; + listTenants( + request: protos.google.cloud.talent.v4beta1.IListTenantsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.talent.v4beta1.IListTenantsRequest, + | protos.google.cloud.talent.v4beta1.IListTenantsResponse + | null + | undefined, + protos.google.cloud.talent.v4beta1.ITenant + > + ): void; + listTenants( + request: protos.google.cloud.talent.v4beta1.IListTenantsRequest, + callback: PaginationCallback< + protos.google.cloud.talent.v4beta1.IListTenantsRequest, + | protos.google.cloud.talent.v4beta1.IListTenantsResponse + | null + | undefined, + protos.google.cloud.talent.v4beta1.ITenant + > + ): void; + listTenants( + request?: protos.google.cloud.talent.v4beta1.IListTenantsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.talent.v4beta1.IListTenantsRequest, + | protos.google.cloud.talent.v4beta1.IListTenantsResponse + | null + | undefined, + protos.google.cloud.talent.v4beta1.ITenant + >, + callback?: PaginationCallback< + protos.google.cloud.talent.v4beta1.IListTenantsRequest, + | protos.google.cloud.talent.v4beta1.IListTenantsResponse + | null + | undefined, + protos.google.cloud.talent.v4beta1.ITenant + > + ): Promise< + [ + protos.google.cloud.talent.v4beta1.ITenant[], + protos.google.cloud.talent.v4beta1.IListTenantsRequest | null, + protos.google.cloud.talent.v4beta1.IListTenantsResponse + ] + > | 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.listTenants(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 under which the tenant is created. + * + * The format is "projects/{project_id}", for example, + * "projects/foo". + * @param {string} request.pageToken + * The starting indicator from which to return results. + * @param {number} request.pageSize + * The maximum number of tenants to be returned, at most 100. + * Default is 100 if a non-positive number is provided. + * @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 [Tenant]{@link google.cloud.talent.v4beta1.Tenant} 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 `listTenantsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTenantsStream( + request?: protos.google.cloud.talent.v4beta1.IListTenantsRequest, + 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['listTenants']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTenants.createStream( + this.innerApiCalls.listTenants as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTenants`, 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 under which the tenant is created. + * + * The format is "projects/{project_id}", for example, + * "projects/foo". + * @param {string} request.pageToken + * The starting indicator from which to return results. + * @param {number} request.pageSize + * The maximum number of tenants to be returned, at most 100. + * Default is 100 if a non-positive number is provided. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Tenant]{@link google.cloud.talent.v4beta1.Tenant}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v4beta1/tenant_service.list_tenants.js + * region_tag:jobs_v4beta1_generated_TenantService_ListTenants_async + */ + listTenantsAsync( + request?: protos.google.cloud.talent.v4beta1.IListTenantsRequest, + 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['listTenants']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTenants.asyncIterate( + this.innerApiCalls['listTenants'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectCompany resource name string. + * + * @param {string} project + * @param {string} company + * @returns {string} Resource name string. + */ + projectCompanyPath(project: string, company: string) { + return this.pathTemplates.projectCompanyPathTemplate.render({ + project: project, + company: company, + }); + } + + /** + * Parse the project from ProjectCompany resource. + * + * @param {string} projectCompanyName + * A fully-qualified path representing project_company resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCompanyName(projectCompanyName: string) { + return this.pathTemplates.projectCompanyPathTemplate.match( + projectCompanyName + ).project; + } + + /** + * Parse the company from ProjectCompany resource. + * + * @param {string} projectCompanyName + * A fully-qualified path representing project_company resource. + * @returns {string} A string representing the company. + */ + matchCompanyFromProjectCompanyName(projectCompanyName: string) { + return this.pathTemplates.projectCompanyPathTemplate.match( + projectCompanyName + ).company; + } + + /** + * Return a fully-qualified projectJob resource name string. + * + * @param {string} project + * @param {string} job + * @returns {string} Resource name string. + */ + projectJobPath(project: string, job: string) { + return this.pathTemplates.projectJobPathTemplate.render({ + project: project, + job: job, + }); + } + + /** + * Parse the project from ProjectJob resource. + * + * @param {string} projectJobName + * A fully-qualified path representing project_job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectJobName(projectJobName: string) { + return this.pathTemplates.projectJobPathTemplate.match(projectJobName) + .project; + } + + /** + * Parse the job from ProjectJob resource. + * + * @param {string} projectJobName + * A fully-qualified path representing project_job resource. + * @returns {string} A string representing the job. + */ + matchJobFromProjectJobName(projectJobName: string) { + return this.pathTemplates.projectJobPathTemplate.match(projectJobName).job; + } + + /** + * Return a fully-qualified projectTenantCompany resource name string. + * + * @param {string} project + * @param {string} tenant + * @param {string} company + * @returns {string} Resource name string. + */ + projectTenantCompanyPath(project: string, tenant: string, company: string) { + return this.pathTemplates.projectTenantCompanyPathTemplate.render({ + project: project, + tenant: tenant, + company: company, + }); + } + + /** + * Parse the project from ProjectTenantCompany resource. + * + * @param {string} projectTenantCompanyName + * A fully-qualified path representing project_tenant_company resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTenantCompanyName(projectTenantCompanyName: string) { + return this.pathTemplates.projectTenantCompanyPathTemplate.match( + projectTenantCompanyName + ).project; + } + + /** + * Parse the tenant from ProjectTenantCompany resource. + * + * @param {string} projectTenantCompanyName + * A fully-qualified path representing project_tenant_company resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromProjectTenantCompanyName(projectTenantCompanyName: string) { + return this.pathTemplates.projectTenantCompanyPathTemplate.match( + projectTenantCompanyName + ).tenant; + } + + /** + * Parse the company from ProjectTenantCompany resource. + * + * @param {string} projectTenantCompanyName + * A fully-qualified path representing project_tenant_company resource. + * @returns {string} A string representing the company. + */ + matchCompanyFromProjectTenantCompanyName(projectTenantCompanyName: string) { + return this.pathTemplates.projectTenantCompanyPathTemplate.match( + projectTenantCompanyName + ).company; + } + + /** + * Return a fully-qualified projectTenantJob resource name string. + * + * @param {string} project + * @param {string} tenant + * @param {string} job + * @returns {string} Resource name string. + */ + projectTenantJobPath(project: string, tenant: string, job: string) { + return this.pathTemplates.projectTenantJobPathTemplate.render({ + project: project, + tenant: tenant, + job: job, + }); + } + + /** + * Parse the project from ProjectTenantJob resource. + * + * @param {string} projectTenantJobName + * A fully-qualified path representing project_tenant_job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTenantJobName(projectTenantJobName: string) { + return this.pathTemplates.projectTenantJobPathTemplate.match( + projectTenantJobName + ).project; + } + + /** + * Parse the tenant from ProjectTenantJob resource. + * + * @param {string} projectTenantJobName + * A fully-qualified path representing project_tenant_job resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromProjectTenantJobName(projectTenantJobName: string) { + return this.pathTemplates.projectTenantJobPathTemplate.match( + projectTenantJobName + ).tenant; + } + + /** + * Parse the job from ProjectTenantJob resource. + * + * @param {string} projectTenantJobName + * A fully-qualified path representing project_tenant_job resource. + * @returns {string} A string representing the job. + */ + matchJobFromProjectTenantJobName(projectTenantJobName: string) { + return this.pathTemplates.projectTenantJobPathTemplate.match( + projectTenantJobName + ).job; + } + + /** + * Return a fully-qualified tenant resource name string. + * + * @param {string} project + * @param {string} tenant + * @returns {string} Resource name string. + */ + tenantPath(project: string, tenant: string) { + return this.pathTemplates.tenantPathTemplate.render({ + project: project, + tenant: tenant, + }); + } + + /** + * Parse the project from Tenant resource. + * + * @param {string} tenantName + * A fully-qualified path representing Tenant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTenantName(tenantName: string) { + return this.pathTemplates.tenantPathTemplate.match(tenantName).project; + } + + /** + * Parse the tenant from Tenant resource. + * + * @param {string} tenantName + * A fully-qualified path representing Tenant resource. + * @returns {string} A string representing the tenant. + */ + matchTenantFromTenantName(tenantName: string) { + return this.pathTemplates.tenantPathTemplate.match(tenantName).tenant; + } + + /** + * 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.tenantServiceStub && !this._terminated) { + return this.tenantServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-talent/src/v4beta1/tenant_service_client_config.json b/packages/google-cloud-talent/src/v4beta1/tenant_service_client_config.json new file mode 100644 index 00000000000..09363cfdb32 --- /dev/null +++ b/packages/google-cloud-talent/src/v4beta1/tenant_service_client_config.json @@ -0,0 +1,51 @@ +{ + "interfaces": { + "google.cloud.talent.v4beta1.TenantService": { + "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": { + "CreateTenant": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTenant": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateTenant": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTenant": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListTenants": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-talent/src/v4beta1/tenant_service_proto_list.json b/packages/google-cloud-talent/src/v4beta1/tenant_service_proto_list.json new file mode 100644 index 00000000000..e44f49ea525 --- /dev/null +++ b/packages/google-cloud-talent/src/v4beta1/tenant_service_proto_list.json @@ -0,0 +1,15 @@ +[ + "../../protos/google/cloud/talent/v4beta1/batch.proto", + "../../protos/google/cloud/talent/v4beta1/common.proto", + "../../protos/google/cloud/talent/v4beta1/company.proto", + "../../protos/google/cloud/talent/v4beta1/company_service.proto", + "../../protos/google/cloud/talent/v4beta1/completion_service.proto", + "../../protos/google/cloud/talent/v4beta1/event.proto", + "../../protos/google/cloud/talent/v4beta1/event_service.proto", + "../../protos/google/cloud/talent/v4beta1/filters.proto", + "../../protos/google/cloud/talent/v4beta1/histogram.proto", + "../../protos/google/cloud/talent/v4beta1/job.proto", + "../../protos/google/cloud/talent/v4beta1/job_service.proto", + "../../protos/google/cloud/talent/v4beta1/tenant.proto", + "../../protos/google/cloud/talent/v4beta1/tenant_service.proto" +] diff --git a/packages/google-cloud-talent/system-test/.eslintrc.yml b/packages/google-cloud-talent/system-test/.eslintrc.yml new file mode 100644 index 00000000000..5adab99ca15 --- /dev/null +++ b/packages/google-cloud-talent/system-test/.eslintrc.yml @@ -0,0 +1,4 @@ +--- +rules: + node/no-unpublished-require: off + no-console: off diff --git a/packages/google-cloud-talent/system-test/fixtures/sample/src/index.js b/packages/google-cloud-talent/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..c54b08c0c95 --- /dev/null +++ b/packages/google-cloud-talent/system-test/fixtures/sample/src/index.js @@ -0,0 +1,30 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const talent = require('@google-cloud/talent'); + +function main() { + const companyServiceClient = new talent.CompanyServiceClient(); + const completionClient = new talent.CompletionClient(); + const eventServiceClient = new talent.EventServiceClient(); + const jobServiceClient = new talent.JobServiceClient(); + const tenantServiceClient = new talent.TenantServiceClient(); +} + +main(); diff --git a/packages/google-cloud-talent/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-talent/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..9f025f1684a --- /dev/null +++ b/packages/google-cloud-talent/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import { + CompanyServiceClient, + CompletionClient, + EventServiceClient, + JobServiceClient, + TenantServiceClient, +} from '@google-cloud/talent'; + +// check that the client class type name can be used +function doStuffWithCompanyServiceClient(client: CompanyServiceClient) { + client.close(); +} +function doStuffWithCompletionClient(client: CompletionClient) { + client.close(); +} +function doStuffWithEventServiceClient(client: EventServiceClient) { + client.close(); +} +function doStuffWithJobServiceClient(client: JobServiceClient) { + client.close(); +} +function doStuffWithTenantServiceClient(client: TenantServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const companyServiceClient = new CompanyServiceClient(); + doStuffWithCompanyServiceClient(companyServiceClient); + // check that the client instance can be created + const completionClient = new CompletionClient(); + doStuffWithCompletionClient(completionClient); + // check that the client instance can be created + const eventServiceClient = new EventServiceClient(); + doStuffWithEventServiceClient(eventServiceClient); + // check that the client instance can be created + const jobServiceClient = new JobServiceClient(); + doStuffWithJobServiceClient(jobServiceClient); + // check that the client instance can be created + const tenantServiceClient = new TenantServiceClient(); + doStuffWithTenantServiceClient(tenantServiceClient); +} + +main(); diff --git a/packages/google-cloud-talent/system-test/install.ts b/packages/google-cloud-talent/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-cloud-talent/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-talent/system-test/no-test.js b/packages/google-cloud-talent/system-test/no-test.js new file mode 100644 index 00000000000..ed54b008e0c --- /dev/null +++ b/packages/google-cloud-talent/system-test/no-test.js @@ -0,0 +1 @@ +console.log('no tests yet'); diff --git a/packages/google-cloud-talent/test/gapic_company_service_v4.ts b/packages/google-cloud-talent/test/gapic_company_service_v4.ts new file mode 100644 index 00000000000..c4b8337841f --- /dev/null +++ b/packages/google-cloud-talent/test/gapic_company_service_v4.ts @@ -0,0 +1,1227 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as companyserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v4.CompanyServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + companyserviceModule.v4.CompanyServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + companyserviceModule.v4.CompanyServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = companyserviceModule.v4.CompanyServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new companyserviceModule.v4.CompanyServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.companyServiceStub, undefined); + await client.initialize(); + assert(client.companyServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.companyServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.companyServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new companyserviceModule.v4.CompanyServiceClient({ + 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 companyserviceModule.v4.CompanyServiceClient({ + 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('createCompany', () => { + it('invokes createCompany without error', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.CreateCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.CreateCompanyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.Company() + ); + client.innerApiCalls.createCompany = stubSimpleCall(expectedResponse); + const [response] = await client.createCompany(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCompany without error using callback', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.CreateCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.CreateCompanyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.Company() + ); + client.innerApiCalls.createCompany = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCompany( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4.ICompany | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCompany with error', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.CreateCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.CreateCompanyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCompany = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createCompany(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCompany with closed client', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.CreateCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.CreateCompanyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createCompany(request), expectedError); + }); + }); + + describe('getCompany', () => { + it('invokes getCompany without error', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.GetCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.GetCompanyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.Company() + ); + client.innerApiCalls.getCompany = stubSimpleCall(expectedResponse); + const [response] = await client.getCompany(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCompany without error using callback', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.GetCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.GetCompanyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.Company() + ); + client.innerApiCalls.getCompany = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCompany( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4.ICompany | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCompany with error', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.GetCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.GetCompanyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCompany = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getCompany(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCompany with closed client', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.GetCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.GetCompanyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCompany(request), expectedError); + }); + }); + + describe('updateCompany', () => { + it('invokes updateCompany without error', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.UpdateCompanyRequest() + ); + request.company ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.UpdateCompanyRequest', + ['company', 'name'] + ); + request.company.name = defaultValue1; + const expectedHeaderRequestParams = `company.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.Company() + ); + client.innerApiCalls.updateCompany = stubSimpleCall(expectedResponse); + const [response] = await client.updateCompany(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCompany without error using callback', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.UpdateCompanyRequest() + ); + request.company ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.UpdateCompanyRequest', + ['company', 'name'] + ); + request.company.name = defaultValue1; + const expectedHeaderRequestParams = `company.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.Company() + ); + client.innerApiCalls.updateCompany = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCompany( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4.ICompany | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCompany with error', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.UpdateCompanyRequest() + ); + request.company ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.UpdateCompanyRequest', + ['company', 'name'] + ); + request.company.name = defaultValue1; + const expectedHeaderRequestParams = `company.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCompany = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateCompany(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCompany with closed client', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.UpdateCompanyRequest() + ); + request.company ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.UpdateCompanyRequest', + ['company', 'name'] + ); + request.company.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateCompany(request), expectedError); + }); + }); + + describe('deleteCompany', () => { + it('invokes deleteCompany without error', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.DeleteCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.DeleteCompanyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCompany = stubSimpleCall(expectedResponse); + const [response] = await client.deleteCompany(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCompany without error using callback', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.DeleteCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.DeleteCompanyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCompany = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCompany( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCompany with error', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.DeleteCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.DeleteCompanyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCompany = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteCompany(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCompany with closed client', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.DeleteCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.DeleteCompanyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteCompany(request), expectedError); + }); + }); + + describe('listCompanies', () => { + it('invokes listCompanies without error', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListCompaniesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListCompaniesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4.Company()), + generateSampleMessage(new protos.google.cloud.talent.v4.Company()), + generateSampleMessage(new protos.google.cloud.talent.v4.Company()), + ]; + client.innerApiCalls.listCompanies = stubSimpleCall(expectedResponse); + const [response] = await client.listCompanies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCompanies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCompanies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCompanies without error using callback', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListCompaniesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListCompaniesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4.Company()), + generateSampleMessage(new protos.google.cloud.talent.v4.Company()), + generateSampleMessage(new protos.google.cloud.talent.v4.Company()), + ]; + client.innerApiCalls.listCompanies = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCompanies( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4.ICompany[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCompanies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCompanies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCompanies with error', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListCompaniesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListCompaniesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCompanies = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listCompanies(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listCompanies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCompanies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCompaniesStream without error', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListCompaniesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListCompaniesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4.Company()), + generateSampleMessage(new protos.google.cloud.talent.v4.Company()), + generateSampleMessage(new protos.google.cloud.talent.v4.Company()), + ]; + client.descriptors.page.listCompanies.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCompaniesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.talent.v4.Company[] = []; + stream.on('data', (response: protos.google.cloud.talent.v4.Company) => { + 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.listCompanies.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCompanies, request) + ); + assert( + (client.descriptors.page.listCompanies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCompaniesStream with error', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListCompaniesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListCompaniesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCompanies.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCompaniesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.talent.v4.Company[] = []; + stream.on('data', (response: protos.google.cloud.talent.v4.Company) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCompanies.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCompanies, request) + ); + assert( + (client.descriptors.page.listCompanies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCompanies without error', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListCompaniesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListCompaniesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4.Company()), + generateSampleMessage(new protos.google.cloud.talent.v4.Company()), + generateSampleMessage(new protos.google.cloud.talent.v4.Company()), + ]; + client.descriptors.page.listCompanies.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.talent.v4.ICompany[] = []; + const iterable = client.listCompaniesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCompanies.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCompanies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCompanies with error', async () => { + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListCompaniesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListCompaniesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCompanies.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCompaniesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.talent.v4.ICompany[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCompanies.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCompanies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('company', () => { + const fakePath = '/rendered/path/company'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + company: 'companyValue', + }; + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.companyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.companyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('companyPath', () => { + const result = client.companyPath( + 'projectValue', + 'tenantValue', + 'companyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.companyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCompanyName', () => { + const result = client.matchProjectFromCompanyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.companyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromCompanyName', () => { + const result = client.matchTenantFromCompanyName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.companyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCompanyFromCompanyName', () => { + const result = client.matchCompanyFromCompanyName(fakePath); + assert.strictEqual(result, 'companyValue'); + assert( + (client.pathTemplates.companyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('job', () => { + const fakePath = '/rendered/path/job'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + job: 'jobValue', + }; + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.jobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.jobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('jobPath', () => { + const result = client.jobPath( + 'projectValue', + 'tenantValue', + 'jobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.jobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromJobName', () => { + const result = client.matchProjectFromJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromJobName', () => { + const result = client.matchTenantFromJobName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobFromJobName', () => { + const result = client.matchJobFromJobName(fakePath); + assert.strictEqual(result, 'jobValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tenant', () => { + const fakePath = '/rendered/path/tenant'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + }; + const client = new companyserviceModule.v4.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tenantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tenantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tenantPath', () => { + const result = client.tenantPath('projectValue', 'tenantValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tenantPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTenantName', () => { + const result = client.matchProjectFromTenantName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tenantPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromTenantName', () => { + const result = client.matchTenantFromTenantName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.tenantPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-talent/test/gapic_company_service_v4beta1.ts b/packages/google-cloud-talent/test/gapic_company_service_v4beta1.ts new file mode 100644 index 00000000000..82f39e3ba5e --- /dev/null +++ b/packages/google-cloud-talent/test/gapic_company_service_v4beta1.ts @@ -0,0 +1,1389 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as companyserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v4beta1.CompanyServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + companyserviceModule.v4beta1.CompanyServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + companyserviceModule.v4beta1.CompanyServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = companyserviceModule.v4beta1.CompanyServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.companyServiceStub, undefined); + await client.initialize(); + assert(client.companyServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.companyServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.companyServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + 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 companyserviceModule.v4beta1.CompanyServiceClient({ + 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('createCompany', () => { + it('invokes createCompany without error', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CreateCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.CreateCompanyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.Company() + ); + client.innerApiCalls.createCompany = stubSimpleCall(expectedResponse); + const [response] = await client.createCompany(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCompany without error using callback', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CreateCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.CreateCompanyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.Company() + ); + client.innerApiCalls.createCompany = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCompany( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4beta1.ICompany | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCompany with error', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CreateCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.CreateCompanyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCompany = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createCompany(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCompany with closed client', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CreateCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.CreateCompanyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createCompany(request), expectedError); + }); + }); + + describe('getCompany', () => { + it('invokes getCompany without error', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.GetCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.GetCompanyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.Company() + ); + client.innerApiCalls.getCompany = stubSimpleCall(expectedResponse); + const [response] = await client.getCompany(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCompany without error using callback', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.GetCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.GetCompanyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.Company() + ); + client.innerApiCalls.getCompany = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCompany( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4beta1.ICompany | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCompany with error', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.GetCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.GetCompanyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCompany = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getCompany(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCompany with closed client', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.GetCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.GetCompanyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCompany(request), expectedError); + }); + }); + + describe('updateCompany', () => { + it('invokes updateCompany without error', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.UpdateCompanyRequest() + ); + request.company ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.UpdateCompanyRequest', + ['company', 'name'] + ); + request.company.name = defaultValue1; + const expectedHeaderRequestParams = `company.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.Company() + ); + client.innerApiCalls.updateCompany = stubSimpleCall(expectedResponse); + const [response] = await client.updateCompany(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCompany without error using callback', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.UpdateCompanyRequest() + ); + request.company ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.UpdateCompanyRequest', + ['company', 'name'] + ); + request.company.name = defaultValue1; + const expectedHeaderRequestParams = `company.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.Company() + ); + client.innerApiCalls.updateCompany = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCompany( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4beta1.ICompany | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCompany with error', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.UpdateCompanyRequest() + ); + request.company ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.UpdateCompanyRequest', + ['company', 'name'] + ); + request.company.name = defaultValue1; + const expectedHeaderRequestParams = `company.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCompany = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateCompany(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCompany with closed client', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.UpdateCompanyRequest() + ); + request.company ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.UpdateCompanyRequest', + ['company', 'name'] + ); + request.company.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateCompany(request), expectedError); + }); + }); + + describe('deleteCompany', () => { + it('invokes deleteCompany without error', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.DeleteCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.DeleteCompanyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCompany = stubSimpleCall(expectedResponse); + const [response] = await client.deleteCompany(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCompany without error using callback', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.DeleteCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.DeleteCompanyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCompany = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCompany( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCompany with error', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.DeleteCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.DeleteCompanyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCompany = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteCompany(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCompany as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCompany as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCompany with closed client', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.DeleteCompanyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.DeleteCompanyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteCompany(request), expectedError); + }); + }); + + describe('listCompanies', () => { + it('invokes listCompanies without error', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListCompaniesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListCompaniesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Company()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Company()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Company()), + ]; + client.innerApiCalls.listCompanies = stubSimpleCall(expectedResponse); + const [response] = await client.listCompanies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCompanies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCompanies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCompanies without error using callback', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListCompaniesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListCompaniesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Company()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Company()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Company()), + ]; + client.innerApiCalls.listCompanies = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCompanies( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4beta1.ICompany[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCompanies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCompanies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCompanies with error', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListCompaniesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListCompaniesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCompanies = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listCompanies(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listCompanies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCompanies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCompaniesStream without error', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListCompaniesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListCompaniesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Company()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Company()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Company()), + ]; + client.descriptors.page.listCompanies.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCompaniesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.talent.v4beta1.Company[] = []; + stream.on( + 'data', + (response: protos.google.cloud.talent.v4beta1.Company) => { + 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.listCompanies.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCompanies, request) + ); + assert( + (client.descriptors.page.listCompanies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCompaniesStream with error', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListCompaniesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListCompaniesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCompanies.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCompaniesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.talent.v4beta1.Company[] = []; + stream.on( + 'data', + (response: protos.google.cloud.talent.v4beta1.Company) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCompanies.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCompanies, request) + ); + assert( + (client.descriptors.page.listCompanies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCompanies without error', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListCompaniesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListCompaniesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Company()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Company()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Company()), + ]; + client.descriptors.page.listCompanies.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.talent.v4beta1.ICompany[] = []; + const iterable = client.listCompaniesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCompanies.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCompanies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCompanies with error', async () => { + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListCompaniesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListCompaniesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCompanies.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCompaniesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.talent.v4beta1.ICompany[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCompanies.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCompanies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectCompany', () => { + const fakePath = '/rendered/path/projectCompany'; + const expectedParameters = { + project: 'projectValue', + company: 'companyValue', + }; + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectCompanyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectCompanyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectCompanyPath', () => { + const result = client.projectCompanyPath( + 'projectValue', + 'companyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectCompanyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectCompanyName', () => { + const result = client.matchProjectFromProjectCompanyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectCompanyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCompanyFromProjectCompanyName', () => { + const result = client.matchCompanyFromProjectCompanyName(fakePath); + assert.strictEqual(result, 'companyValue'); + assert( + (client.pathTemplates.projectCompanyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectJob', () => { + const fakePath = '/rendered/path/projectJob'; + const expectedParameters = { + project: 'projectValue', + job: 'jobValue', + }; + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectJobPath', () => { + const result = client.projectJobPath('projectValue', 'jobValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectJobName', () => { + const result = client.matchProjectFromProjectJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobFromProjectJobName', () => { + const result = client.matchJobFromProjectJobName(fakePath); + assert.strictEqual(result, 'jobValue'); + assert( + (client.pathTemplates.projectJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectTenantCompany', () => { + const fakePath = '/rendered/path/projectTenantCompany'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + company: 'companyValue', + }; + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectTenantCompanyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectTenantCompanyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectTenantCompanyPath', () => { + const result = client.projectTenantCompanyPath( + 'projectValue', + 'tenantValue', + 'companyValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectTenantCompanyName', () => { + const result = + client.matchProjectFromProjectTenantCompanyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromProjectTenantCompanyName', () => { + const result = client.matchTenantFromProjectTenantCompanyName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCompanyFromProjectTenantCompanyName', () => { + const result = + client.matchCompanyFromProjectTenantCompanyName(fakePath); + assert.strictEqual(result, 'companyValue'); + assert( + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectTenantJob', () => { + const fakePath = '/rendered/path/projectTenantJob'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + job: 'jobValue', + }; + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectTenantJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectTenantJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectTenantJobPath', () => { + const result = client.projectTenantJobPath( + 'projectValue', + 'tenantValue', + 'jobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectTenantJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectTenantJobName', () => { + const result = client.matchProjectFromProjectTenantJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectTenantJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromProjectTenantJobName', () => { + const result = client.matchTenantFromProjectTenantJobName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.projectTenantJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobFromProjectTenantJobName', () => { + const result = client.matchJobFromProjectTenantJobName(fakePath); + assert.strictEqual(result, 'jobValue'); + assert( + (client.pathTemplates.projectTenantJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tenant', () => { + const fakePath = '/rendered/path/tenant'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + }; + const client = new companyserviceModule.v4beta1.CompanyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tenantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tenantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tenantPath', () => { + const result = client.tenantPath('projectValue', 'tenantValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tenantPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTenantName', () => { + const result = client.matchProjectFromTenantName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tenantPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromTenantName', () => { + const result = client.matchTenantFromTenantName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.tenantPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-talent/test/gapic_completion_v4.ts b/packages/google-cloud-talent/test/gapic_completion_v4.ts new file mode 100644 index 00000000000..9e534e156ff --- /dev/null +++ b/packages/google-cloud-talent/test/gapic_completion_v4.ts @@ -0,0 +1,473 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as completionModule from '../src'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +describe('v4.CompletionClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = completionModule.v4.CompletionClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = completionModule.v4.CompletionClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = completionModule.v4.CompletionClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new completionModule.v4.CompletionClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new completionModule.v4.CompletionClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new completionModule.v4.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.completionStub, undefined); + await client.initialize(); + assert(client.completionStub); + }); + + it('has close method for the initialized client', done => { + const client = new completionModule.v4.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.completionStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new completionModule.v4.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.completionStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new completionModule.v4.CompletionClient({ + 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 completionModule.v4.CompletionClient({ + 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('completeQuery', () => { + it('invokes completeQuery without error', async () => { + const client = new completionModule.v4.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.CompleteQueryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.CompleteQueryRequest', + ['tenant'] + ); + request.tenant = defaultValue1; + const expectedHeaderRequestParams = `tenant=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.CompleteQueryResponse() + ); + client.innerApiCalls.completeQuery = stubSimpleCall(expectedResponse); + const [response] = await client.completeQuery(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.completeQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.completeQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeQuery without error using callback', async () => { + const client = new completionModule.v4.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.CompleteQueryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.CompleteQueryRequest', + ['tenant'] + ); + request.tenant = defaultValue1; + const expectedHeaderRequestParams = `tenant=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.CompleteQueryResponse() + ); + client.innerApiCalls.completeQuery = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.completeQuery( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4.ICompleteQueryResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.completeQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.completeQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeQuery with error', async () => { + const client = new completionModule.v4.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.CompleteQueryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.CompleteQueryRequest', + ['tenant'] + ); + request.tenant = defaultValue1; + const expectedHeaderRequestParams = `tenant=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.completeQuery = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.completeQuery(request), expectedError); + const actualRequest = ( + client.innerApiCalls.completeQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.completeQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeQuery with closed client', async () => { + const client = new completionModule.v4.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.CompleteQueryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.CompleteQueryRequest', + ['tenant'] + ); + request.tenant = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.completeQuery(request), expectedError); + }); + }); + + describe('Path templates', () => { + describe('company', () => { + const fakePath = '/rendered/path/company'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + company: 'companyValue', + }; + const client = new completionModule.v4.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.companyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.companyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('companyPath', () => { + const result = client.companyPath( + 'projectValue', + 'tenantValue', + 'companyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.companyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCompanyName', () => { + const result = client.matchProjectFromCompanyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.companyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromCompanyName', () => { + const result = client.matchTenantFromCompanyName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.companyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCompanyFromCompanyName', () => { + const result = client.matchCompanyFromCompanyName(fakePath); + assert.strictEqual(result, 'companyValue'); + assert( + (client.pathTemplates.companyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('job', () => { + const fakePath = '/rendered/path/job'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + job: 'jobValue', + }; + const client = new completionModule.v4.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.jobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.jobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('jobPath', () => { + const result = client.jobPath( + 'projectValue', + 'tenantValue', + 'jobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.jobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromJobName', () => { + const result = client.matchProjectFromJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromJobName', () => { + const result = client.matchTenantFromJobName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobFromJobName', () => { + const result = client.matchJobFromJobName(fakePath); + assert.strictEqual(result, 'jobValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tenant', () => { + const fakePath = '/rendered/path/tenant'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + }; + const client = new completionModule.v4.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tenantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tenantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tenantPath', () => { + const result = client.tenantPath('projectValue', 'tenantValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tenantPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTenantName', () => { + const result = client.matchProjectFromTenantName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tenantPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromTenantName', () => { + const result = client.matchTenantFromTenantName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.tenantPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-talent/test/gapic_completion_v4beta1.ts b/packages/google-cloud-talent/test/gapic_completion_v4beta1.ts new file mode 100644 index 00000000000..e635eb83ce8 --- /dev/null +++ b/packages/google-cloud-talent/test/gapic_completion_v4beta1.ts @@ -0,0 +1,629 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as completionModule from '../src'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +describe('v4beta1.CompletionClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = completionModule.v4beta1.CompletionClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = completionModule.v4beta1.CompletionClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = completionModule.v4beta1.CompletionClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new completionModule.v4beta1.CompletionClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new completionModule.v4beta1.CompletionClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new completionModule.v4beta1.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.completionStub, undefined); + await client.initialize(); + assert(client.completionStub); + }); + + it('has close method for the initialized client', done => { + const client = new completionModule.v4beta1.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.completionStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new completionModule.v4beta1.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.completionStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new completionModule.v4beta1.CompletionClient({ + 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 completionModule.v4beta1.CompletionClient({ + 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('completeQuery', () => { + it('invokes completeQuery without error', async () => { + const client = new completionModule.v4beta1.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CompleteQueryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.CompleteQueryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CompleteQueryResponse() + ); + client.innerApiCalls.completeQuery = stubSimpleCall(expectedResponse); + const [response] = await client.completeQuery(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.completeQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.completeQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeQuery without error using callback', async () => { + const client = new completionModule.v4beta1.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CompleteQueryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.CompleteQueryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CompleteQueryResponse() + ); + client.innerApiCalls.completeQuery = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.completeQuery( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4beta1.ICompleteQueryResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.completeQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.completeQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeQuery with error', async () => { + const client = new completionModule.v4beta1.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CompleteQueryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.CompleteQueryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.completeQuery = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.completeQuery(request), expectedError); + const actualRequest = ( + client.innerApiCalls.completeQuery as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.completeQuery as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes completeQuery with closed client', async () => { + const client = new completionModule.v4beta1.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CompleteQueryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.CompleteQueryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.completeQuery(request), expectedError); + }); + }); + + describe('Path templates', () => { + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new completionModule.v4beta1.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectCompany', () => { + const fakePath = '/rendered/path/projectCompany'; + const expectedParameters = { + project: 'projectValue', + company: 'companyValue', + }; + const client = new completionModule.v4beta1.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectCompanyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectCompanyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectCompanyPath', () => { + const result = client.projectCompanyPath( + 'projectValue', + 'companyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectCompanyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectCompanyName', () => { + const result = client.matchProjectFromProjectCompanyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectCompanyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCompanyFromProjectCompanyName', () => { + const result = client.matchCompanyFromProjectCompanyName(fakePath); + assert.strictEqual(result, 'companyValue'); + assert( + (client.pathTemplates.projectCompanyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectJob', () => { + const fakePath = '/rendered/path/projectJob'; + const expectedParameters = { + project: 'projectValue', + job: 'jobValue', + }; + const client = new completionModule.v4beta1.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectJobPath', () => { + const result = client.projectJobPath('projectValue', 'jobValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectJobName', () => { + const result = client.matchProjectFromProjectJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobFromProjectJobName', () => { + const result = client.matchJobFromProjectJobName(fakePath); + assert.strictEqual(result, 'jobValue'); + assert( + (client.pathTemplates.projectJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectTenantCompany', () => { + const fakePath = '/rendered/path/projectTenantCompany'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + company: 'companyValue', + }; + const client = new completionModule.v4beta1.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectTenantCompanyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectTenantCompanyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectTenantCompanyPath', () => { + const result = client.projectTenantCompanyPath( + 'projectValue', + 'tenantValue', + 'companyValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectTenantCompanyName', () => { + const result = + client.matchProjectFromProjectTenantCompanyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromProjectTenantCompanyName', () => { + const result = client.matchTenantFromProjectTenantCompanyName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCompanyFromProjectTenantCompanyName', () => { + const result = + client.matchCompanyFromProjectTenantCompanyName(fakePath); + assert.strictEqual(result, 'companyValue'); + assert( + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectTenantJob', () => { + const fakePath = '/rendered/path/projectTenantJob'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + job: 'jobValue', + }; + const client = new completionModule.v4beta1.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectTenantJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectTenantJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectTenantJobPath', () => { + const result = client.projectTenantJobPath( + 'projectValue', + 'tenantValue', + 'jobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectTenantJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectTenantJobName', () => { + const result = client.matchProjectFromProjectTenantJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectTenantJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromProjectTenantJobName', () => { + const result = client.matchTenantFromProjectTenantJobName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.projectTenantJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobFromProjectTenantJobName', () => { + const result = client.matchJobFromProjectTenantJobName(fakePath); + assert.strictEqual(result, 'jobValue'); + assert( + (client.pathTemplates.projectTenantJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tenant', () => { + const fakePath = '/rendered/path/tenant'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + }; + const client = new completionModule.v4beta1.CompletionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tenantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tenantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tenantPath', () => { + const result = client.tenantPath('projectValue', 'tenantValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tenantPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTenantName', () => { + const result = client.matchProjectFromTenantName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tenantPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromTenantName', () => { + const result = client.matchTenantFromTenantName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.tenantPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-talent/test/gapic_event_service_v4.ts b/packages/google-cloud-talent/test/gapic_event_service_v4.ts new file mode 100644 index 00000000000..744e1525180 --- /dev/null +++ b/packages/google-cloud-talent/test/gapic_event_service_v4.ts @@ -0,0 +1,473 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as eventserviceModule from '../src'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +describe('v4.EventServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = eventserviceModule.v4.EventServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = eventserviceModule.v4.EventServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = eventserviceModule.v4.EventServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new eventserviceModule.v4.EventServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new eventserviceModule.v4.EventServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new eventserviceModule.v4.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.eventServiceStub, undefined); + await client.initialize(); + assert(client.eventServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new eventserviceModule.v4.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.eventServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new eventserviceModule.v4.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.eventServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new eventserviceModule.v4.EventServiceClient({ + 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 eventserviceModule.v4.EventServiceClient({ + 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('createClientEvent', () => { + it('invokes createClientEvent without error', async () => { + const client = new eventserviceModule.v4.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.CreateClientEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.CreateClientEventRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.ClientEvent() + ); + client.innerApiCalls.createClientEvent = stubSimpleCall(expectedResponse); + const [response] = await client.createClientEvent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createClientEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createClientEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createClientEvent without error using callback', async () => { + const client = new eventserviceModule.v4.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.CreateClientEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.CreateClientEventRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.ClientEvent() + ); + client.innerApiCalls.createClientEvent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createClientEvent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4.IClientEvent | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createClientEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createClientEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createClientEvent with error', async () => { + const client = new eventserviceModule.v4.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.CreateClientEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.CreateClientEventRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createClientEvent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createClientEvent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createClientEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createClientEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createClientEvent with closed client', async () => { + const client = new eventserviceModule.v4.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.CreateClientEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.CreateClientEventRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createClientEvent(request), expectedError); + }); + }); + + describe('Path templates', () => { + describe('company', () => { + const fakePath = '/rendered/path/company'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + company: 'companyValue', + }; + const client = new eventserviceModule.v4.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.companyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.companyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('companyPath', () => { + const result = client.companyPath( + 'projectValue', + 'tenantValue', + 'companyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.companyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCompanyName', () => { + const result = client.matchProjectFromCompanyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.companyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromCompanyName', () => { + const result = client.matchTenantFromCompanyName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.companyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCompanyFromCompanyName', () => { + const result = client.matchCompanyFromCompanyName(fakePath); + assert.strictEqual(result, 'companyValue'); + assert( + (client.pathTemplates.companyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('job', () => { + const fakePath = '/rendered/path/job'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + job: 'jobValue', + }; + const client = new eventserviceModule.v4.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.jobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.jobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('jobPath', () => { + const result = client.jobPath( + 'projectValue', + 'tenantValue', + 'jobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.jobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromJobName', () => { + const result = client.matchProjectFromJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromJobName', () => { + const result = client.matchTenantFromJobName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobFromJobName', () => { + const result = client.matchJobFromJobName(fakePath); + assert.strictEqual(result, 'jobValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tenant', () => { + const fakePath = '/rendered/path/tenant'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + }; + const client = new eventserviceModule.v4.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tenantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tenantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tenantPath', () => { + const result = client.tenantPath('projectValue', 'tenantValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tenantPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTenantName', () => { + const result = client.matchProjectFromTenantName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tenantPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromTenantName', () => { + const result = client.matchTenantFromTenantName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.tenantPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-talent/test/gapic_event_service_v4beta1.ts b/packages/google-cloud-talent/test/gapic_event_service_v4beta1.ts new file mode 100644 index 00000000000..37a7bb8bbeb --- /dev/null +++ b/packages/google-cloud-talent/test/gapic_event_service_v4beta1.ts @@ -0,0 +1,631 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as eventserviceModule from '../src'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +describe('v4beta1.EventServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + eventserviceModule.v4beta1.EventServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + eventserviceModule.v4beta1.EventServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = eventserviceModule.v4beta1.EventServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new eventserviceModule.v4beta1.EventServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new eventserviceModule.v4beta1.EventServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new eventserviceModule.v4beta1.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.eventServiceStub, undefined); + await client.initialize(); + assert(client.eventServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new eventserviceModule.v4beta1.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.eventServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new eventserviceModule.v4beta1.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.eventServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new eventserviceModule.v4beta1.EventServiceClient({ + 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 eventserviceModule.v4beta1.EventServiceClient({ + 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('createClientEvent', () => { + it('invokes createClientEvent without error', async () => { + const client = new eventserviceModule.v4beta1.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CreateClientEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.CreateClientEventRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ClientEvent() + ); + client.innerApiCalls.createClientEvent = stubSimpleCall(expectedResponse); + const [response] = await client.createClientEvent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createClientEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createClientEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createClientEvent without error using callback', async () => { + const client = new eventserviceModule.v4beta1.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CreateClientEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.CreateClientEventRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ClientEvent() + ); + client.innerApiCalls.createClientEvent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createClientEvent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4beta1.IClientEvent | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createClientEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createClientEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createClientEvent with error', async () => { + const client = new eventserviceModule.v4beta1.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CreateClientEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.CreateClientEventRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createClientEvent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createClientEvent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createClientEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createClientEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createClientEvent with closed client', async () => { + const client = new eventserviceModule.v4beta1.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CreateClientEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.CreateClientEventRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createClientEvent(request), expectedError); + }); + }); + + describe('Path templates', () => { + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new eventserviceModule.v4beta1.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectCompany', () => { + const fakePath = '/rendered/path/projectCompany'; + const expectedParameters = { + project: 'projectValue', + company: 'companyValue', + }; + const client = new eventserviceModule.v4beta1.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectCompanyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectCompanyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectCompanyPath', () => { + const result = client.projectCompanyPath( + 'projectValue', + 'companyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectCompanyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectCompanyName', () => { + const result = client.matchProjectFromProjectCompanyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectCompanyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCompanyFromProjectCompanyName', () => { + const result = client.matchCompanyFromProjectCompanyName(fakePath); + assert.strictEqual(result, 'companyValue'); + assert( + (client.pathTemplates.projectCompanyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectJob', () => { + const fakePath = '/rendered/path/projectJob'; + const expectedParameters = { + project: 'projectValue', + job: 'jobValue', + }; + const client = new eventserviceModule.v4beta1.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectJobPath', () => { + const result = client.projectJobPath('projectValue', 'jobValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectJobName', () => { + const result = client.matchProjectFromProjectJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobFromProjectJobName', () => { + const result = client.matchJobFromProjectJobName(fakePath); + assert.strictEqual(result, 'jobValue'); + assert( + (client.pathTemplates.projectJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectTenantCompany', () => { + const fakePath = '/rendered/path/projectTenantCompany'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + company: 'companyValue', + }; + const client = new eventserviceModule.v4beta1.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectTenantCompanyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectTenantCompanyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectTenantCompanyPath', () => { + const result = client.projectTenantCompanyPath( + 'projectValue', + 'tenantValue', + 'companyValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectTenantCompanyName', () => { + const result = + client.matchProjectFromProjectTenantCompanyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromProjectTenantCompanyName', () => { + const result = client.matchTenantFromProjectTenantCompanyName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCompanyFromProjectTenantCompanyName', () => { + const result = + client.matchCompanyFromProjectTenantCompanyName(fakePath); + assert.strictEqual(result, 'companyValue'); + assert( + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectTenantJob', () => { + const fakePath = '/rendered/path/projectTenantJob'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + job: 'jobValue', + }; + const client = new eventserviceModule.v4beta1.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectTenantJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectTenantJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectTenantJobPath', () => { + const result = client.projectTenantJobPath( + 'projectValue', + 'tenantValue', + 'jobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectTenantJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectTenantJobName', () => { + const result = client.matchProjectFromProjectTenantJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectTenantJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromProjectTenantJobName', () => { + const result = client.matchTenantFromProjectTenantJobName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.projectTenantJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobFromProjectTenantJobName', () => { + const result = client.matchJobFromProjectTenantJobName(fakePath); + assert.strictEqual(result, 'jobValue'); + assert( + (client.pathTemplates.projectTenantJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tenant', () => { + const fakePath = '/rendered/path/tenant'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + }; + const client = new eventserviceModule.v4beta1.EventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tenantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tenantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tenantPath', () => { + const result = client.tenantPath('projectValue', 'tenantValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tenantPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTenantName', () => { + const result = client.matchProjectFromTenantName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tenantPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromTenantName', () => { + const result = client.matchTenantFromTenantName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.tenantPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-talent/test/gapic_job_service_v4.ts b/packages/google-cloud-talent/test/gapic_job_service_v4.ts new file mode 100644 index 00000000000..0d66e5a3fee --- /dev/null +++ b/packages/google-cloud-talent/test/gapic_job_service_v4.ts @@ -0,0 +1,2125 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as jobserviceModule 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('v4.JobServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = jobserviceModule.v4.JobServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = jobserviceModule.v4.JobServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = jobserviceModule.v4.JobServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new jobserviceModule.v4.JobServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new jobserviceModule.v4.JobServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.jobServiceStub, undefined); + await client.initialize(); + assert(client.jobServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.jobServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.jobServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new jobserviceModule.v4.JobServiceClient({ + 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 jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createJob', () => { + it('invokes createJob without error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.CreateJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.CreateJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.Job() + ); + client.innerApiCalls.createJob = stubSimpleCall(expectedResponse); + const [response] = await client.createJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob without error using callback', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.CreateJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.CreateJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.Job() + ); + client.innerApiCalls.createJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4.IJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob with error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.CreateJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.CreateJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob with closed client', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.CreateJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.CreateJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createJob(request), expectedError); + }); + }); + + describe('getJob', () => { + it('invokes getJob without error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.GetJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.GetJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.Job() + ); + client.innerApiCalls.getJob = stubSimpleCall(expectedResponse); + const [response] = await client.getJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob without error using callback', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.GetJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.GetJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.Job() + ); + client.innerApiCalls.getJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4.IJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.GetJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.GetJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getJob as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with closed client', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.GetJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.GetJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getJob(request), expectedError); + }); + }); + + describe('updateJob', () => { + it('invokes updateJob without error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.UpdateJobRequest() + ); + request.job ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.UpdateJobRequest', + ['job', 'name'] + ); + request.job.name = defaultValue1; + const expectedHeaderRequestParams = `job.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.Job() + ); + client.innerApiCalls.updateJob = stubSimpleCall(expectedResponse); + const [response] = await client.updateJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateJob without error using callback', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.UpdateJobRequest() + ); + request.job ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.UpdateJobRequest', + ['job', 'name'] + ); + request.job.name = defaultValue1; + const expectedHeaderRequestParams = `job.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.Job() + ); + client.innerApiCalls.updateJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4.IJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateJob with error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.UpdateJobRequest() + ); + request.job ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.UpdateJobRequest', + ['job', 'name'] + ); + request.job.name = defaultValue1; + const expectedHeaderRequestParams = `job.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateJob with closed client', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.UpdateJobRequest() + ); + request.job ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.UpdateJobRequest', + ['job', 'name'] + ); + request.job.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateJob(request), expectedError); + }); + }); + + describe('deleteJob', () => { + it('invokes deleteJob without error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.DeleteJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.DeleteJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteJob = stubSimpleCall(expectedResponse); + const [response] = await client.deleteJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob without error using callback', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.DeleteJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.DeleteJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteJob( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob with error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.DeleteJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.DeleteJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob with closed client', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.DeleteJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.DeleteJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteJob(request), expectedError); + }); + }); + + describe('searchJobs', () => { + it('invokes searchJobs without error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.SearchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.SearchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.SearchJobsResponse() + ); + client.innerApiCalls.searchJobs = stubSimpleCall(expectedResponse); + const [response] = await client.searchJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchJobs without error using callback', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.SearchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.SearchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.SearchJobsResponse() + ); + client.innerApiCalls.searchJobs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchJobs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4.ISearchJobsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchJobs with error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.SearchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.SearchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchJobs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.searchJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.searchJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchJobs with closed client', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.SearchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.SearchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.searchJobs(request), expectedError); + }); + }); + + describe('searchJobsForAlert', () => { + it('invokes searchJobsForAlert without error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.SearchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.SearchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.SearchJobsResponse() + ); + client.innerApiCalls.searchJobsForAlert = + stubSimpleCall(expectedResponse); + const [response] = await client.searchJobsForAlert(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchJobsForAlert as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchJobsForAlert as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchJobsForAlert without error using callback', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.SearchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.SearchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.SearchJobsResponse() + ); + client.innerApiCalls.searchJobsForAlert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchJobsForAlert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4.ISearchJobsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchJobsForAlert as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchJobsForAlert as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchJobsForAlert with error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.SearchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.SearchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchJobsForAlert = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.searchJobsForAlert(request), expectedError); + const actualRequest = ( + client.innerApiCalls.searchJobsForAlert as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchJobsForAlert as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchJobsForAlert with closed client', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.SearchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.SearchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.searchJobsForAlert(request), expectedError); + }); + }); + + describe('batchCreateJobs', () => { + it('invokes batchCreateJobs without error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.BatchCreateJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.BatchCreateJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchCreateJobs = + stubLongRunningCall(expectedResponse); + const [operation] = await client.batchCreateJobs(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchCreateJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateJobs without error using callback', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.BatchCreateJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.BatchCreateJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchCreateJobs = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchCreateJobs( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.talent.v4.IBatchCreateJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.talent.v4.IBatchCreateJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchCreateJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateJobs with call error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.BatchCreateJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.BatchCreateJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateJobs = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.batchCreateJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchCreateJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateJobs with LRO error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.BatchCreateJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.BatchCreateJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateJobs = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.batchCreateJobs(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.batchCreateJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchCreateJobsProgress without error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + 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.checkBatchCreateJobsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchCreateJobsProgress with error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + 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.checkBatchCreateJobsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('batchUpdateJobs', () => { + it('invokes batchUpdateJobs without error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.BatchUpdateJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.BatchUpdateJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchUpdateJobs = + stubLongRunningCall(expectedResponse); + const [operation] = await client.batchUpdateJobs(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchUpdateJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchUpdateJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchUpdateJobs without error using callback', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.BatchUpdateJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.BatchUpdateJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchUpdateJobs = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchUpdateJobs( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.talent.v4.IBatchUpdateJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.talent.v4.IBatchUpdateJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchUpdateJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchUpdateJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchUpdateJobs with call error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.BatchUpdateJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.BatchUpdateJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchUpdateJobs = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.batchUpdateJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchUpdateJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchUpdateJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchUpdateJobs with LRO error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.BatchUpdateJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.BatchUpdateJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchUpdateJobs = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.batchUpdateJobs(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.batchUpdateJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchUpdateJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchUpdateJobsProgress without error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + 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.checkBatchUpdateJobsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchUpdateJobsProgress with error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + 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.checkBatchUpdateJobsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('batchDeleteJobs', () => { + it('invokes batchDeleteJobs without error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.BatchDeleteJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.BatchDeleteJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchDeleteJobs = + stubLongRunningCall(expectedResponse); + const [operation] = await client.batchDeleteJobs(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchDeleteJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteJobs without error using callback', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.BatchDeleteJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.BatchDeleteJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchDeleteJobs = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchDeleteJobs( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.talent.v4.IBatchDeleteJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.talent.v4.IBatchDeleteJobsResponse, + protos.google.cloud.talent.v4.IBatchOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchDeleteJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteJobs with call error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.BatchDeleteJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.BatchDeleteJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchDeleteJobs = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.batchDeleteJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchDeleteJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteJobs with LRO error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.BatchDeleteJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.BatchDeleteJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchDeleteJobs = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.batchDeleteJobs(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.batchDeleteJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchDeleteJobsProgress without error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + 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.checkBatchDeleteJobsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchDeleteJobsProgress with error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + 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.checkBatchDeleteJobsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listJobs', () => { + it('invokes listJobs without error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4.Job()), + generateSampleMessage(new protos.google.cloud.talent.v4.Job()), + generateSampleMessage(new protos.google.cloud.talent.v4.Job()), + ]; + client.innerApiCalls.listJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs without error using callback', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4.Job()), + generateSampleMessage(new protos.google.cloud.talent.v4.Job()), + generateSampleMessage(new protos.google.cloud.talent.v4.Job()), + ]; + client.innerApiCalls.listJobs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listJobs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4.IJob[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs with error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobsStream without error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4.Job()), + generateSampleMessage(new protos.google.cloud.talent.v4.Job()), + generateSampleMessage(new protos.google.cloud.talent.v4.Job()), + ]; + client.descriptors.page.listJobs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.talent.v4.Job[] = []; + stream.on('data', (response: protos.google.cloud.talent.v4.Job) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listJobs, request) + ); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listJobsStream with error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobs.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.talent.v4.Job[] = []; + stream.on('data', (response: protos.google.cloud.talent.v4.Job) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listJobs, request) + ); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobs without error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4.Job()), + generateSampleMessage(new protos.google.cloud.talent.v4.Job()), + generateSampleMessage(new protos.google.cloud.talent.v4.Job()), + ]; + client.descriptors.page.listJobs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.talent.v4.IJob[] = []; + const iterable = client.listJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobs with error', async () => { + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.talent.v4.IJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('company', () => { + const fakePath = '/rendered/path/company'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + company: 'companyValue', + }; + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.companyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.companyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('companyPath', () => { + const result = client.companyPath( + 'projectValue', + 'tenantValue', + 'companyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.companyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCompanyName', () => { + const result = client.matchProjectFromCompanyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.companyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromCompanyName', () => { + const result = client.matchTenantFromCompanyName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.companyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCompanyFromCompanyName', () => { + const result = client.matchCompanyFromCompanyName(fakePath); + assert.strictEqual(result, 'companyValue'); + assert( + (client.pathTemplates.companyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('job', () => { + const fakePath = '/rendered/path/job'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + job: 'jobValue', + }; + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.jobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.jobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('jobPath', () => { + const result = client.jobPath( + 'projectValue', + 'tenantValue', + 'jobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.jobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromJobName', () => { + const result = client.matchProjectFromJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromJobName', () => { + const result = client.matchTenantFromJobName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobFromJobName', () => { + const result = client.matchJobFromJobName(fakePath); + assert.strictEqual(result, 'jobValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tenant', () => { + const fakePath = '/rendered/path/tenant'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + }; + const client = new jobserviceModule.v4.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tenantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tenantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tenantPath', () => { + const result = client.tenantPath('projectValue', 'tenantValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tenantPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTenantName', () => { + const result = client.matchProjectFromTenantName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tenantPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromTenantName', () => { + const result = client.matchTenantFromTenantName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.tenantPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-talent/test/gapic_job_service_v4beta1.ts b/packages/google-cloud-talent/test/gapic_job_service_v4beta1.ts new file mode 100644 index 00000000000..76e070b0c57 --- /dev/null +++ b/packages/google-cloud-talent/test/gapic_job_service_v4beta1.ts @@ -0,0 +1,2490 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as jobserviceModule 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('v4beta1.JobServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = jobserviceModule.v4beta1.JobServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = jobserviceModule.v4beta1.JobServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = jobserviceModule.v4beta1.JobServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new jobserviceModule.v4beta1.JobServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.jobServiceStub, undefined); + await client.initialize(); + assert(client.jobServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.jobServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.jobServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new jobserviceModule.v4beta1.JobServiceClient({ + 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 jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createJob', () => { + it('invokes createJob without error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CreateJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.CreateJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.Job() + ); + client.innerApiCalls.createJob = stubSimpleCall(expectedResponse); + const [response] = await client.createJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob without error using callback', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CreateJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.CreateJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.Job() + ); + client.innerApiCalls.createJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4beta1.IJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob with error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CreateJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.CreateJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob with closed client', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CreateJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.CreateJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createJob(request), expectedError); + }); + }); + + describe('getJob', () => { + it('invokes getJob without error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.GetJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.GetJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.Job() + ); + client.innerApiCalls.getJob = stubSimpleCall(expectedResponse); + const [response] = await client.getJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob without error using callback', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.GetJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.GetJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.Job() + ); + client.innerApiCalls.getJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4beta1.IJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.GetJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.GetJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getJob as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with closed client', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.GetJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.GetJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getJob(request), expectedError); + }); + }); + + describe('updateJob', () => { + it('invokes updateJob without error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.UpdateJobRequest() + ); + request.job ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.UpdateJobRequest', + ['job', 'name'] + ); + request.job.name = defaultValue1; + const expectedHeaderRequestParams = `job.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.Job() + ); + client.innerApiCalls.updateJob = stubSimpleCall(expectedResponse); + const [response] = await client.updateJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateJob without error using callback', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.UpdateJobRequest() + ); + request.job ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.UpdateJobRequest', + ['job', 'name'] + ); + request.job.name = defaultValue1; + const expectedHeaderRequestParams = `job.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.Job() + ); + client.innerApiCalls.updateJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4beta1.IJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateJob with error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.UpdateJobRequest() + ); + request.job ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.UpdateJobRequest', + ['job', 'name'] + ); + request.job.name = defaultValue1; + const expectedHeaderRequestParams = `job.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateJob with closed client', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.UpdateJobRequest() + ); + request.job ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.UpdateJobRequest', + ['job', 'name'] + ); + request.job.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateJob(request), expectedError); + }); + }); + + describe('deleteJob', () => { + it('invokes deleteJob without error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.DeleteJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.DeleteJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteJob = stubSimpleCall(expectedResponse); + const [response] = await client.deleteJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob without error using callback', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.DeleteJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.DeleteJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteJob( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob with error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.DeleteJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.DeleteJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob with closed client', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.DeleteJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.DeleteJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteJob(request), expectedError); + }); + }); + + describe('batchDeleteJobs', () => { + it('invokes batchDeleteJobs without error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.BatchDeleteJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.BatchDeleteJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.batchDeleteJobs = stubSimpleCall(expectedResponse); + const [response] = await client.batchDeleteJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchDeleteJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteJobs without error using callback', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.BatchDeleteJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.BatchDeleteJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.batchDeleteJobs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchDeleteJobs( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchDeleteJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteJobs with error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.BatchDeleteJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.BatchDeleteJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchDeleteJobs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.batchDeleteJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchDeleteJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteJobs with closed client', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.BatchDeleteJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.BatchDeleteJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchDeleteJobs(request), expectedError); + }); + }); + + describe('searchJobs', () => { + it('invokes searchJobs without error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.SearchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.SearchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.SearchJobsResponse() + ); + client.innerApiCalls.searchJobs = stubSimpleCall(expectedResponse); + const [response] = await client.searchJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchJobs without error using callback', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.SearchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.SearchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.SearchJobsResponse() + ); + client.innerApiCalls.searchJobs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchJobs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4beta1.ISearchJobsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchJobs with error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.SearchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.SearchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchJobs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.searchJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.searchJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchJobs with closed client', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.SearchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.SearchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.searchJobs(request), expectedError); + }); + }); + + describe('searchJobsForAlert', () => { + it('invokes searchJobsForAlert without error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.SearchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.SearchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.SearchJobsResponse() + ); + client.innerApiCalls.searchJobsForAlert = + stubSimpleCall(expectedResponse); + const [response] = await client.searchJobsForAlert(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchJobsForAlert as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchJobsForAlert as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchJobsForAlert without error using callback', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.SearchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.SearchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.SearchJobsResponse() + ); + client.innerApiCalls.searchJobsForAlert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchJobsForAlert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4beta1.ISearchJobsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchJobsForAlert as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchJobsForAlert as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchJobsForAlert with error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.SearchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.SearchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchJobsForAlert = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.searchJobsForAlert(request), expectedError); + const actualRequest = ( + client.innerApiCalls.searchJobsForAlert as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchJobsForAlert as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchJobsForAlert with closed client', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.SearchJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.SearchJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.searchJobsForAlert(request), expectedError); + }); + }); + + describe('batchCreateJobs', () => { + it('invokes batchCreateJobs without error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.BatchCreateJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.BatchCreateJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchCreateJobs = + stubLongRunningCall(expectedResponse); + const [operation] = await client.batchCreateJobs(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchCreateJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateJobs without error using callback', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.BatchCreateJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.BatchCreateJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchCreateJobs = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchCreateJobs( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.talent.v4beta1.IJobOperationResult, + protos.google.cloud.talent.v4beta1.IBatchOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.talent.v4beta1.IJobOperationResult, + protos.google.cloud.talent.v4beta1.IBatchOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchCreateJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateJobs with call error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.BatchCreateJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.BatchCreateJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateJobs = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.batchCreateJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchCreateJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateJobs with LRO error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.BatchCreateJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.BatchCreateJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateJobs = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.batchCreateJobs(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.batchCreateJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchCreateJobsProgress without error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + 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.checkBatchCreateJobsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchCreateJobsProgress with error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + 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.checkBatchCreateJobsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('batchUpdateJobs', () => { + it('invokes batchUpdateJobs without error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.BatchUpdateJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.BatchUpdateJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchUpdateJobs = + stubLongRunningCall(expectedResponse); + const [operation] = await client.batchUpdateJobs(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchUpdateJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchUpdateJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchUpdateJobs without error using callback', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.BatchUpdateJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.BatchUpdateJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchUpdateJobs = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchUpdateJobs( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.talent.v4beta1.IJobOperationResult, + protos.google.cloud.talent.v4beta1.IBatchOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.talent.v4beta1.IJobOperationResult, + protos.google.cloud.talent.v4beta1.IBatchOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchUpdateJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchUpdateJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchUpdateJobs with call error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.BatchUpdateJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.BatchUpdateJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchUpdateJobs = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.batchUpdateJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchUpdateJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchUpdateJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchUpdateJobs with LRO error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.BatchUpdateJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.BatchUpdateJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchUpdateJobs = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.batchUpdateJobs(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.batchUpdateJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchUpdateJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchUpdateJobsProgress without error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + 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.checkBatchUpdateJobsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchUpdateJobsProgress with error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + 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.checkBatchUpdateJobsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listJobs', () => { + it('invokes listJobs without error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Job()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Job()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Job()), + ]; + client.innerApiCalls.listJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs without error using callback', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Job()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Job()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Job()), + ]; + client.innerApiCalls.listJobs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listJobs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4beta1.IJob[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs with error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobsStream without error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Job()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Job()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Job()), + ]; + client.descriptors.page.listJobs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.talent.v4beta1.Job[] = []; + stream.on( + 'data', + (response: protos.google.cloud.talent.v4beta1.Job) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listJobs, request) + ); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listJobsStream with error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobs.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.talent.v4beta1.Job[] = []; + stream.on( + 'data', + (response: protos.google.cloud.talent.v4beta1.Job) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listJobs, request) + ); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobs without error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Job()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Job()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Job()), + ]; + client.descriptors.page.listJobs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.talent.v4beta1.IJob[] = []; + const iterable = client.listJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobs with error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.talent.v4beta1.IJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectCompany', () => { + const fakePath = '/rendered/path/projectCompany'; + const expectedParameters = { + project: 'projectValue', + company: 'companyValue', + }; + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectCompanyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectCompanyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectCompanyPath', () => { + const result = client.projectCompanyPath( + 'projectValue', + 'companyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectCompanyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectCompanyName', () => { + const result = client.matchProjectFromProjectCompanyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectCompanyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCompanyFromProjectCompanyName', () => { + const result = client.matchCompanyFromProjectCompanyName(fakePath); + assert.strictEqual(result, 'companyValue'); + assert( + (client.pathTemplates.projectCompanyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectJob', () => { + const fakePath = '/rendered/path/projectJob'; + const expectedParameters = { + project: 'projectValue', + job: 'jobValue', + }; + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectJobPath', () => { + const result = client.projectJobPath('projectValue', 'jobValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectJobName', () => { + const result = client.matchProjectFromProjectJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobFromProjectJobName', () => { + const result = client.matchJobFromProjectJobName(fakePath); + assert.strictEqual(result, 'jobValue'); + assert( + (client.pathTemplates.projectJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectTenantCompany', () => { + const fakePath = '/rendered/path/projectTenantCompany'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + company: 'companyValue', + }; + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectTenantCompanyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectTenantCompanyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectTenantCompanyPath', () => { + const result = client.projectTenantCompanyPath( + 'projectValue', + 'tenantValue', + 'companyValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectTenantCompanyName', () => { + const result = + client.matchProjectFromProjectTenantCompanyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromProjectTenantCompanyName', () => { + const result = client.matchTenantFromProjectTenantCompanyName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCompanyFromProjectTenantCompanyName', () => { + const result = + client.matchCompanyFromProjectTenantCompanyName(fakePath); + assert.strictEqual(result, 'companyValue'); + assert( + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectTenantJob', () => { + const fakePath = '/rendered/path/projectTenantJob'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + job: 'jobValue', + }; + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectTenantJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectTenantJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectTenantJobPath', () => { + const result = client.projectTenantJobPath( + 'projectValue', + 'tenantValue', + 'jobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectTenantJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectTenantJobName', () => { + const result = client.matchProjectFromProjectTenantJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectTenantJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromProjectTenantJobName', () => { + const result = client.matchTenantFromProjectTenantJobName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.projectTenantJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobFromProjectTenantJobName', () => { + const result = client.matchJobFromProjectTenantJobName(fakePath); + assert.strictEqual(result, 'jobValue'); + assert( + (client.pathTemplates.projectTenantJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tenant', () => { + const fakePath = '/rendered/path/tenant'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + }; + const client = new jobserviceModule.v4beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tenantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tenantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tenantPath', () => { + const result = client.tenantPath('projectValue', 'tenantValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tenantPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTenantName', () => { + const result = client.matchProjectFromTenantName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tenantPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromTenantName', () => { + const result = client.matchTenantFromTenantName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.tenantPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-talent/test/gapic_tenant_service_v4.ts b/packages/google-cloud-talent/test/gapic_tenant_service_v4.ts new file mode 100644 index 00000000000..9b254655772 --- /dev/null +++ b/packages/google-cloud-talent/test/gapic_tenant_service_v4.ts @@ -0,0 +1,1266 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as tenantserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v4.TenantServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + tenantserviceModule.v4.TenantServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + tenantserviceModule.v4.TenantServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = tenantserviceModule.v4.TenantServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new tenantserviceModule.v4.TenantServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.tenantServiceStub, undefined); + await client.initialize(); + assert(client.tenantServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.tenantServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.tenantServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new tenantserviceModule.v4.TenantServiceClient({ + 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 tenantserviceModule.v4.TenantServiceClient({ + 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('createTenant', () => { + it('invokes createTenant without error', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.CreateTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.CreateTenantRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.Tenant() + ); + client.innerApiCalls.createTenant = stubSimpleCall(expectedResponse); + const [response] = await client.createTenant(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTenant without error using callback', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.CreateTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.CreateTenantRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.Tenant() + ); + client.innerApiCalls.createTenant = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTenant( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4.ITenant | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTenant with error', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.CreateTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.CreateTenantRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTenant = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createTenant(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTenant with closed client', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.CreateTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.CreateTenantRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createTenant(request), expectedError); + }); + }); + + describe('getTenant', () => { + it('invokes getTenant without error', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.GetTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.GetTenantRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.Tenant() + ); + client.innerApiCalls.getTenant = stubSimpleCall(expectedResponse); + const [response] = await client.getTenant(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTenant without error using callback', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.GetTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.GetTenantRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.Tenant() + ); + client.innerApiCalls.getTenant = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTenant( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4.ITenant | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTenant with error', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.GetTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.GetTenantRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTenant = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTenant(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTenant with closed client', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.GetTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.GetTenantRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTenant(request), expectedError); + }); + }); + + describe('updateTenant', () => { + it('invokes updateTenant without error', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.UpdateTenantRequest() + ); + request.tenant ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.UpdateTenantRequest', + ['tenant', 'name'] + ); + request.tenant.name = defaultValue1; + const expectedHeaderRequestParams = `tenant.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.Tenant() + ); + client.innerApiCalls.updateTenant = stubSimpleCall(expectedResponse); + const [response] = await client.updateTenant(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTenant without error using callback', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.UpdateTenantRequest() + ); + request.tenant ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.UpdateTenantRequest', + ['tenant', 'name'] + ); + request.tenant.name = defaultValue1; + const expectedHeaderRequestParams = `tenant.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4.Tenant() + ); + client.innerApiCalls.updateTenant = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTenant( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4.ITenant | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTenant with error', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.UpdateTenantRequest() + ); + request.tenant ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.UpdateTenantRequest', + ['tenant', 'name'] + ); + request.tenant.name = defaultValue1; + const expectedHeaderRequestParams = `tenant.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTenant = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateTenant(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTenant with closed client', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.UpdateTenantRequest() + ); + request.tenant ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.UpdateTenantRequest', + ['tenant', 'name'] + ); + request.tenant.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateTenant(request), expectedError); + }); + }); + + describe('deleteTenant', () => { + it('invokes deleteTenant without error', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.DeleteTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.DeleteTenantRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTenant = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTenant(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTenant without error using callback', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.DeleteTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.DeleteTenantRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTenant = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTenant( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTenant with error', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.DeleteTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.DeleteTenantRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTenant = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteTenant(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTenant with closed client', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.DeleteTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.DeleteTenantRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteTenant(request), expectedError); + }); + }); + + describe('listTenants', () => { + it('invokes listTenants without error', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListTenantsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListTenantsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4.Tenant()), + generateSampleMessage(new protos.google.cloud.talent.v4.Tenant()), + generateSampleMessage(new protos.google.cloud.talent.v4.Tenant()), + ]; + client.innerApiCalls.listTenants = stubSimpleCall(expectedResponse); + const [response] = await client.listTenants(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTenants as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTenants as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTenants without error using callback', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListTenantsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListTenantsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4.Tenant()), + generateSampleMessage(new protos.google.cloud.talent.v4.Tenant()), + generateSampleMessage(new protos.google.cloud.talent.v4.Tenant()), + ]; + client.innerApiCalls.listTenants = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTenants( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4.ITenant[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTenants as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTenants as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTenants with error', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListTenantsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListTenantsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTenants = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTenants(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTenants as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTenants as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTenantsStream without error', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListTenantsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListTenantsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4.Tenant()), + generateSampleMessage(new protos.google.cloud.talent.v4.Tenant()), + generateSampleMessage(new protos.google.cloud.talent.v4.Tenant()), + ]; + client.descriptors.page.listTenants.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTenantsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.talent.v4.Tenant[] = []; + stream.on('data', (response: protos.google.cloud.talent.v4.Tenant) => { + 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.listTenants.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTenants, request) + ); + assert( + (client.descriptors.page.listTenants.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTenantsStream with error', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListTenantsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListTenantsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTenants.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listTenantsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.talent.v4.Tenant[] = []; + stream.on('data', (response: protos.google.cloud.talent.v4.Tenant) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTenants.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTenants, request) + ); + assert( + (client.descriptors.page.listTenants.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTenants without error', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListTenantsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListTenantsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4.Tenant()), + generateSampleMessage(new protos.google.cloud.talent.v4.Tenant()), + generateSampleMessage(new protos.google.cloud.talent.v4.Tenant()), + ]; + client.descriptors.page.listTenants.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.talent.v4.ITenant[] = []; + const iterable = client.listTenantsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTenants.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listTenants.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTenants with error', async () => { + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4.ListTenantsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4.ListTenantsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTenants.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listTenantsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.talent.v4.ITenant[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTenants.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listTenants.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('company', () => { + const fakePath = '/rendered/path/company'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + company: 'companyValue', + }; + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.companyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.companyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('companyPath', () => { + const result = client.companyPath( + 'projectValue', + 'tenantValue', + 'companyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.companyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCompanyName', () => { + const result = client.matchProjectFromCompanyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.companyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromCompanyName', () => { + const result = client.matchTenantFromCompanyName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.companyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCompanyFromCompanyName', () => { + const result = client.matchCompanyFromCompanyName(fakePath); + assert.strictEqual(result, 'companyValue'); + assert( + (client.pathTemplates.companyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('job', () => { + const fakePath = '/rendered/path/job'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + job: 'jobValue', + }; + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.jobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.jobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('jobPath', () => { + const result = client.jobPath( + 'projectValue', + 'tenantValue', + 'jobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.jobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromJobName', () => { + const result = client.matchProjectFromJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromJobName', () => { + const result = client.matchTenantFromJobName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobFromJobName', () => { + const result = client.matchJobFromJobName(fakePath); + assert.strictEqual(result, 'jobValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tenant', () => { + const fakePath = '/rendered/path/tenant'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + }; + const client = new tenantserviceModule.v4.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tenantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tenantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tenantPath', () => { + const result = client.tenantPath('projectValue', 'tenantValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tenantPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTenantName', () => { + const result = client.matchProjectFromTenantName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tenantPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromTenantName', () => { + const result = client.matchTenantFromTenantName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.tenantPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-talent/test/gapic_tenant_service_v4beta1.ts b/packages/google-cloud-talent/test/gapic_tenant_service_v4beta1.ts new file mode 100644 index 00000000000..c7a39b69dc7 --- /dev/null +++ b/packages/google-cloud-talent/test/gapic_tenant_service_v4beta1.ts @@ -0,0 +1,1390 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as tenantserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v4beta1.TenantServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + tenantserviceModule.v4beta1.TenantServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + tenantserviceModule.v4beta1.TenantServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = tenantserviceModule.v4beta1.TenantServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.tenantServiceStub, undefined); + await client.initialize(); + assert(client.tenantServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.tenantServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.tenantServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + 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 tenantserviceModule.v4beta1.TenantServiceClient({ + 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('createTenant', () => { + it('invokes createTenant without error', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CreateTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.CreateTenantRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.Tenant() + ); + client.innerApiCalls.createTenant = stubSimpleCall(expectedResponse); + const [response] = await client.createTenant(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTenant without error using callback', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CreateTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.CreateTenantRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.Tenant() + ); + client.innerApiCalls.createTenant = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTenant( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4beta1.ITenant | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTenant with error', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CreateTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.CreateTenantRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTenant = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createTenant(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTenant with closed client', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.CreateTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.CreateTenantRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createTenant(request), expectedError); + }); + }); + + describe('getTenant', () => { + it('invokes getTenant without error', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.GetTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.GetTenantRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.Tenant() + ); + client.innerApiCalls.getTenant = stubSimpleCall(expectedResponse); + const [response] = await client.getTenant(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTenant without error using callback', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.GetTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.GetTenantRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.Tenant() + ); + client.innerApiCalls.getTenant = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTenant( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4beta1.ITenant | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTenant with error', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.GetTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.GetTenantRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTenant = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTenant(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTenant with closed client', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.GetTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.GetTenantRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTenant(request), expectedError); + }); + }); + + describe('updateTenant', () => { + it('invokes updateTenant without error', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.UpdateTenantRequest() + ); + request.tenant ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.UpdateTenantRequest', + ['tenant', 'name'] + ); + request.tenant.name = defaultValue1; + const expectedHeaderRequestParams = `tenant.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.Tenant() + ); + client.innerApiCalls.updateTenant = stubSimpleCall(expectedResponse); + const [response] = await client.updateTenant(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTenant without error using callback', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.UpdateTenantRequest() + ); + request.tenant ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.UpdateTenantRequest', + ['tenant', 'name'] + ); + request.tenant.name = defaultValue1; + const expectedHeaderRequestParams = `tenant.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.Tenant() + ); + client.innerApiCalls.updateTenant = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTenant( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4beta1.ITenant | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTenant with error', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.UpdateTenantRequest() + ); + request.tenant ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.UpdateTenantRequest', + ['tenant', 'name'] + ); + request.tenant.name = defaultValue1; + const expectedHeaderRequestParams = `tenant.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTenant = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateTenant(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTenant with closed client', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.UpdateTenantRequest() + ); + request.tenant ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.UpdateTenantRequest', + ['tenant', 'name'] + ); + request.tenant.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateTenant(request), expectedError); + }); + }); + + describe('deleteTenant', () => { + it('invokes deleteTenant without error', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.DeleteTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.DeleteTenantRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTenant = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTenant(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTenant without error using callback', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.DeleteTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.DeleteTenantRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTenant = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTenant( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTenant with error', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.DeleteTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.DeleteTenantRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTenant = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteTenant(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTenant as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTenant as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTenant with closed client', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.DeleteTenantRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.DeleteTenantRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteTenant(request), expectedError); + }); + }); + + describe('listTenants', () => { + it('invokes listTenants without error', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListTenantsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListTenantsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Tenant()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Tenant()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Tenant()), + ]; + client.innerApiCalls.listTenants = stubSimpleCall(expectedResponse); + const [response] = await client.listTenants(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTenants as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTenants as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTenants without error using callback', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListTenantsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListTenantsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Tenant()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Tenant()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Tenant()), + ]; + client.innerApiCalls.listTenants = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTenants( + request, + ( + err?: Error | null, + result?: protos.google.cloud.talent.v4beta1.ITenant[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTenants as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTenants as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTenants with error', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListTenantsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListTenantsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTenants = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTenants(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTenants as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTenants as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTenantsStream without error', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListTenantsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListTenantsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Tenant()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Tenant()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Tenant()), + ]; + client.descriptors.page.listTenants.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTenantsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.talent.v4beta1.Tenant[] = []; + stream.on( + 'data', + (response: protos.google.cloud.talent.v4beta1.Tenant) => { + 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.listTenants.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTenants, request) + ); + assert( + (client.descriptors.page.listTenants.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTenantsStream with error', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListTenantsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListTenantsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTenants.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listTenantsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.talent.v4beta1.Tenant[] = []; + stream.on( + 'data', + (response: protos.google.cloud.talent.v4beta1.Tenant) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTenants.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTenants, request) + ); + assert( + (client.descriptors.page.listTenants.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTenants without error', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListTenantsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListTenantsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Tenant()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Tenant()), + generateSampleMessage(new protos.google.cloud.talent.v4beta1.Tenant()), + ]; + client.descriptors.page.listTenants.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.talent.v4beta1.ITenant[] = []; + const iterable = client.listTenantsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTenants.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listTenants.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTenants with error', async () => { + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.talent.v4beta1.ListTenantsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.talent.v4beta1.ListTenantsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTenants.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listTenantsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.talent.v4beta1.ITenant[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTenants.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listTenants.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectCompany', () => { + const fakePath = '/rendered/path/projectCompany'; + const expectedParameters = { + project: 'projectValue', + company: 'companyValue', + }; + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectCompanyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectCompanyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectCompanyPath', () => { + const result = client.projectCompanyPath( + 'projectValue', + 'companyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectCompanyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectCompanyName', () => { + const result = client.matchProjectFromProjectCompanyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectCompanyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCompanyFromProjectCompanyName', () => { + const result = client.matchCompanyFromProjectCompanyName(fakePath); + assert.strictEqual(result, 'companyValue'); + assert( + (client.pathTemplates.projectCompanyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectJob', () => { + const fakePath = '/rendered/path/projectJob'; + const expectedParameters = { + project: 'projectValue', + job: 'jobValue', + }; + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectJobPath', () => { + const result = client.projectJobPath('projectValue', 'jobValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectJobName', () => { + const result = client.matchProjectFromProjectJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobFromProjectJobName', () => { + const result = client.matchJobFromProjectJobName(fakePath); + assert.strictEqual(result, 'jobValue'); + assert( + (client.pathTemplates.projectJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectTenantCompany', () => { + const fakePath = '/rendered/path/projectTenantCompany'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + company: 'companyValue', + }; + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectTenantCompanyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectTenantCompanyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectTenantCompanyPath', () => { + const result = client.projectTenantCompanyPath( + 'projectValue', + 'tenantValue', + 'companyValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectTenantCompanyName', () => { + const result = + client.matchProjectFromProjectTenantCompanyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromProjectTenantCompanyName', () => { + const result = client.matchTenantFromProjectTenantCompanyName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCompanyFromProjectTenantCompanyName', () => { + const result = + client.matchCompanyFromProjectTenantCompanyName(fakePath); + assert.strictEqual(result, 'companyValue'); + assert( + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectTenantJob', () => { + const fakePath = '/rendered/path/projectTenantJob'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + job: 'jobValue', + }; + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectTenantJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectTenantJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectTenantJobPath', () => { + const result = client.projectTenantJobPath( + 'projectValue', + 'tenantValue', + 'jobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectTenantJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectTenantJobName', () => { + const result = client.matchProjectFromProjectTenantJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectTenantJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromProjectTenantJobName', () => { + const result = client.matchTenantFromProjectTenantJobName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.projectTenantJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobFromProjectTenantJobName', () => { + const result = client.matchJobFromProjectTenantJobName(fakePath); + assert.strictEqual(result, 'jobValue'); + assert( + (client.pathTemplates.projectTenantJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tenant', () => { + const fakePath = '/rendered/path/tenant'; + const expectedParameters = { + project: 'projectValue', + tenant: 'tenantValue', + }; + const client = new tenantserviceModule.v4beta1.TenantServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tenantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tenantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tenantPath', () => { + const result = client.tenantPath('projectValue', 'tenantValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tenantPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTenantName', () => { + const result = client.matchProjectFromTenantName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tenantPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTenantFromTenantName', () => { + const result = client.matchTenantFromTenantName(fakePath); + assert.strictEqual(result, 'tenantValue'); + assert( + (client.pathTemplates.tenantPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-talent/tsconfig.json b/packages/google-cloud-talent/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-talent/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-talent/webpack.config.js b/packages/google-cloud-talent/webpack.config.js new file mode 100644 index 00000000000..26fe5be51ac --- /dev/null +++ b/packages/google-cloud-talent/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: 'talent', + filename: './talent.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', +};